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

allow headers to be added to prometheus requests #1757

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

otternq
Copy link

@otternq otternq commented Jan 14, 2025

This update allows the Prometheus metrics provisioner to add HTTP headers to its requests.

I'm specifically adding this to support Grafana Mimir's multi-tenant feature. Mimir looks for the X-Scope-OrgID header to determine which tenant a query is for. Though I haven't tried it, it looks like Thanos also uses headers for multi-tenancy

Copy link
Member

@aryan9600 aryan9600 left a comment

Choose a reason for hiding this comment

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

thanks for this PR!

prom := PrometheusProvider{
timeout: 5 * time.Second,
url: *promURL,
headers: headers,
Copy link
Member

Choose a reason for hiding this comment

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

can't we just do headers: provider.Headers here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants