Plugins: Pass through dashboard/contextual HTTP headers to plugins/datasources (#60301)
`X-Dashboard-Uid`, `X-Datasource-Uid`, `X-Grafana-Org-Id`, `X-Panel-Id` are very useful headers set by Grafana front-end that we would like to see on the data source as well. This is so that it would be possible to pinpoint from where slow queries are coming in Mimir/Thanos/Cortex/etc., for example. Relevant Mimir code lines: https://github.com/grafana/mimir/blob/0a94f26203cae7c1784a6d3040ccddb6c2063de9/pkg/frontend/transport/handler.go#L182-L184 Tested manually that with these changes the headers are visible.
This commit is contained in:
@@ -72,6 +72,7 @@ func NewClientDecorator(cfg *setting.Cfg, pCfg *config.Cfg,
|
||||
func CreateMiddlewares(cfg *setting.Cfg, oAuthTokenService oauthtoken.OAuthTokenService) []plugins.ClientMiddleware {
|
||||
skipCookiesNames := []string{cfg.LoginCookieName}
|
||||
middlewares := []plugins.ClientMiddleware{
|
||||
clientmiddleware.NewTracingHeaderMiddleware(),
|
||||
clientmiddleware.NewClearAuthHeadersMiddleware(),
|
||||
clientmiddleware.NewOAuthTokenMiddleware(oAuthTokenService),
|
||||
clientmiddleware.NewCookiesMiddleware(skipCookiesNames),
|
||||
|
||||
Reference in New Issue
Block a user