Skip to content

Conversation

@gabor
Copy link
Contributor

@gabor gabor commented Nov 4, 2025

the datasource apiserver code explicitly adds a list of headers to QueryDataRequest.Headers:

Headers: query_headers.ExtractKnownHeaders(req.Header),

if we compare this to how single-tenant grafana does it, single-tenant grafana just creates an empty headers-field:

req := &backend.QueryDataRequest{
Headers: map[string]string{},
Queries: []backend.DataQuery{},
}

the needed headers will be later added by various middlewares.

to make the apiserver-code more similar to single-tenant grafana, i did the same change in apiserver-code.

then i tested this, and all the headers from https://github.com/grafana/grafana/blob/fc34b181226e8caa5bbbcfc47de0c1bd132fb16f/pkg/registry/apis/query/header_utils.go are still getting set correctly.
there is one exception: the X-Cache-Skip header was forwarded before, but it is not after this change. but, i checked single-tenant grafana, and they also do not forward X-Cache-Skip, so i think that is ok.

(the motivation here is that i need a different header-list for query.go and a different one for sub_query.go. if i can remove ExtractKnownHeaders from sub_query.go, it will make my work easier.

(also a unit-test was removed, because now there is no functionality to test. also, while in theory, the unit-test could have been kept, it would not work in it's current form, it would need substantial additions to also call the middlewares that populate the headers)

@gabor gabor marked this pull request as ready for review November 4, 2025 08:35
@gabor gabor requested a review from a team as a code owner November 4, 2025 08:35
@gabor gabor requested review from charandas and owen-d and removed request for a team November 4, 2025 08:35
@github-actions github-actions bot added this to the 12.3.x milestone Nov 4, 2025
@gabor gabor added the no-changelog Skip including change in changelog/release notes label Nov 4, 2025
@gabor gabor requested a review from a team November 4, 2025 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/backend no-changelog Skip including change in changelog/release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants