MCPcopy
hub / github.com/grafana/tempo / New

Function New

cmd/tempo/app/app.go:99–125  ·  view source on GitHub ↗

New makes a new app.

(cfg Config)

Source from the content-addressed store, hash-verified

97
98// New makes a new app.
99func New(cfg Config) (*App, error) {
100 app := &App{
101 cfg: cfg,
102 readRings: map[string]*ring.Ring{},
103 Server: newTempoServer(),
104 }
105
106 usagestats.Edition("oss")
107
108 statFeatureEnabledAuth.Set(0)
109 if cfg.AuthEnabled {
110 statFeatureEnabledAuth.Set(1)
111 }
112
113 statFeatureEnabledMultitenancy.Set(0)
114 if cfg.MultitenancyEnabled {
115 statFeatureEnabledMultitenancy.Set(1)
116 }
117
118 app.setupAuthMiddleware()
119
120 if err := app.setupModuleManager(); err != nil {
121 return nil, fmt.Errorf("failed to setup module manager: %w", err)
122 }
123
124 return app, nil
125}
126
127func (t *App) setupAuthMiddleware() {
128 if t.cfg.MultitenancyIsEnabled() {

Calls 5

setupAuthMiddlewareMethod · 0.95
setupModuleManagerMethod · 0.95
EditionFunction · 0.92
newTempoServerFunction · 0.85
SetMethod · 0.65