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

query-frontend: add option to preserve specific request headers #4486

Merged
merged 17 commits into from
Nov 19, 2021

Conversation

srijan55
Copy link
Contributor

@srijan55 srijan55 commented Sep 20, 2021

What this PR does:
When applying PrometheusCodec headers from the requests are not transferred, which makes using Cortex in frontend-only mode with any other Prometheus engine harder. This PR fixes this issue.

Which issue(s) this PR fixes:
Fixes #4416

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

srijan55 and others added 2 commits September 19, 2021 20:50
…ferred, which makes using Cortex in frontend only mode with any other Prometheus engine harder. This PR fixes this issue.

Signed-off-by: Manish Kumar Gupta <[email protected]>
@srijan55 srijan55 marked this pull request as ready for review September 20, 2021 16:52
@srijan55
Copy link
Contributor Author

@pstibrany maybe you can have a look or assign it to someone who is the best for the area? I reached out on the slack channel as well, but couldn't get engagement on this.

Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

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

Thanks; some thoughts below.

Signed-off-by: Manish Kumar Gupta <[email protected]>
@srijan55
Copy link
Contributor Author

@bboreham Thanks for your comments. Incorporated changes. Please review.

@srijan55
Copy link
Contributor Author

@bboreham Thanks for your comments. Incorporated changes. Please review.

@bboreham , friendly ping again on this. Hope you can find a moment to review and merge

@srijan55
Copy link
Contributor Author

srijan55 commented Oct 4, 2021

@bboreham , Thanks for another round of comments. Addressed all of them. Please review and help with the merge when you have a moment.

@srijan55 srijan55 requested a review from bboreham October 5, 2021 03:16
@srijan55
Copy link
Contributor Author

@bboreham , I wasn't able to reproduce the integration tests failing, so I have pushed another commit in hope that it might help. Can you kick off the workflows again.

@srijan55
Copy link
Contributor Author

@bboreham, please help review /merge again. I figure out how to run integration tests and fixed the issue. They should all be green now. Thank you .

@srijan55
Copy link
Contributor Author

Thanks for valuable comments.

@bboreham
Copy link
Contributor

Hi, we discussed this at the Cortex community call today; the general feeling was that rather than passing all headers and having a specific block-list, Cortex should drop all headers by default and let the administrator configure an allow-list.

Could you have a go at that please?

@srijan55
Copy link
Contributor Author

Hi, we discussed this at the Cortex community call today; the general feeling was that rather than passing all headers and having a specific block-list, Cortex should drop all headers by default and let the administrator configure an allow-list.

Could you have a go at that please?

Sure. I'll work on that. Would you prefer the new config setting to be in frontend subsection or querier or somewhere else?

@srijan55
Copy link
Contributor Author

Hi, we discussed this at the Cortex community call today; the general feeling was that rather than passing all headers and having a specific block-list, Cortex should drop all headers by default and let the administrator configure an allow-list.

Could you have a go at that please?

Did the change. Can you help quickly review, so I know I haven't missed obvious things. This is first contribution so still learning.

Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

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

Getting there. I have a number of suggestions to word things differently, and one more copy of an object that I don't understand.

Signed-off-by: Manish Kumar Gupta <[email protected]>
Signed-off-by: Manish Kumar Gupta <[email protected]>
@srijan55
Copy link
Contributor Author

Getting there. I have a number of suggestions to word things differently, and one more copy of an object that I don't understand.

Please have a look again, when you get a moment.

@srijan55 srijan55 requested a review from bboreham November 12, 2021 08:19
Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

Makes sense to me. I left a non blocking comment. Thanks!

Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for this Manish.

@bboreham bboreham merged commit ca39b4c into cortexproject:master Nov 19, 2021
@bboreham bboreham changed the title Preserve requests headers in PrometheusCodec query-frontend: add option to preserve specific request headers Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Range queries don't transmit other headers on Requests
3 participants