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

Method initOverridesAPI

cmd/tempo/app/modules.go:220–243  ·  cmd/tempo/app/modules.go::App.initOverridesAPI
()

Source from the content-addressed store, hash-verified

218}
219
220func (t *App) initOverridesAPI() (services.Service, error) {
221 cfg := t.cfg.Overrides.UserConfigurableOverridesConfig
222
223 if !cfg.Enabled {
224 return services.NewIdleService(nil, nil), nil
225 }
226
227 userConfigOverridesAPI, err := userconfigurableoverridesapi.New(&cfg.API, &cfg.Client, t.Overrides, newOverridesValidator(&t.cfg))
228 if err != nil {
229 return nil, fmt.Errorf("failed to create user-configurable overrides API: %w", err)
230 }
231
232 overridesPath := addHTTPAPIPrefix(&t.cfg, api.PathOverrides)
233 wrapHandler := func(h http.HandlerFunc) http.Handler {
234 return t.HTTPAuthMiddleware.Wrap(h)
235 }
236
237 t.Server.HTTPRouter().Path(overridesPath).Methods(http.MethodGet).Handler(wrapHandler(userConfigOverridesAPI.GetHandler))
238 t.Server.HTTPRouter().Path(overridesPath).Methods(http.MethodPost).Handler(wrapHandler(userConfigOverridesAPI.PostHandler))
239 t.Server.HTTPRouter().Path(overridesPath).Methods(http.MethodPatch).Handler(wrapHandler(userConfigOverridesAPI.PatchHandler))
240 t.Server.HTTPRouter().Path(overridesPath).Methods(http.MethodDelete).Handler(wrapHandler(userConfigOverridesAPI.DeleteHandler))
241
242 return userConfigOverridesAPI, nil
243}
244
245func (t *App) initDistributor() (services.Service, error) {
246 singleBinary := IsSingleBinary(t.cfg.Target)

Callers

nothing calls this directly

Calls 5

newOverridesValidatorFunction · 0.85
addHTTPAPIPrefixFunction · 0.85
HandlerMethod · 0.80
WrapMethod · 0.65
HTTPRouterMethod · 0.65

Tested by

no test coverage detected