Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Introduce special header that tells Loki not to modify query results #12327

Merged
merged 7 commits into from
Mar 25, 2024

Conversation

MasslessParticle
Copy link
Contributor

This PR introduces the new LokiOriginalResults header and ensures it's propagated to any component that could modify query results.

@MasslessParticle MasslessParticle requested a review from a team as a code owner March 22, 2024 20:18
@@ -404,7 +404,7 @@ func (t *Loki) initQuerier() (services.Service, error) {
toMerge := []middleware.Interface{
httpreq.ExtractQueryMetricsMiddleware(),
httpreq.ExtractQueryTagsMiddleware(),
httpreq.PropagateHeadersMiddleware(httpreq.LokiEncodingFlagsHeader),
httpreq.PropagateHeadersMiddleware(httpreq.LokiEncodingFlagsHeader, httpreq.LokiOriginalQueryResultsHeader),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the querier change here only handles requests directly made to queriers http endpoint.

for requests that pass through schedulers, i believe we are encoding these headers within the request itself.
for protobuf encoding and json encoding

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty, good catch

@MasslessParticle MasslessParticle added backport k195 type/bug Somehing is not working as expected labels Mar 25, 2024
@grafanabot
Copy link
Collaborator

Hello @MasslessParticle!
Backport pull requests need to be either:

  • Pull requests which address bugs,
  • Urgent fixes which need product approval, in order to get merged,
  • Docs changes.

Please, if the current pull request addresses a bug fix, label it with the type/bug label.
If it already has the product approval, please add the product-approved label. For docs changes, please add the type/docs label.
If the pull request modifies CI behaviour, please add the type/ci label.
If none of the above applies, please consider removing the backport label and target the next major/minor release.
Thanks!

@grafanabot
Copy link
Collaborator

This PR must be merged before a backport PR will be created.

@MasslessParticle MasslessParticle merged commit c8d2c32 into main Mar 25, 2024
16 checks passed
@MasslessParticle MasslessParticle deleted the tpatterson/original-query-results branch March 25, 2024 18:50
grafanabot pushed a commit that referenced this pull request Mar 25, 2024
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport k195 size/L type/bug Somehing is not working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants