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

Custom HTTP headers for discovery.http #6261

Closed
llamafilm opened this issue Jan 27, 2024 · 1 comment · Fixed by #6306
Closed

Custom HTTP headers for discovery.http #6261

llamafilm opened this issue Jan 27, 2024 · 1 comment · Fixed by #6306
Labels
enhancement New feature or request frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.

Comments

@llamafilm
Copy link

Request

I would like to set custom HTTP headers in discovery.http

Use case

I'm getting Prometheus targets from Netbox using this plugin: https://github.com/FlxPeters/netbox-plugin-prometheus-sd
Netbox requires the Authorization: Token xxxx header for authentication. My Netbox system is behind an Apache proxy which uses Authorization for another purpose, so I rename the header using an Apache config like this:

RequestHeader set Authorization "expr=%{req:Netbox-Authorization}"

Therefore I need to set the Netbox-Authorization header.

@llamafilm llamafilm added the enhancement New feature or request label Jan 27, 2024
@erikbaranowski
Copy link
Contributor

it sounds like what you need is the proxy_connect_header configuration option available in prometheus http_sd_config and documented here:

https://prometheus.io/docs/prometheus/latest/configuration/configuration/#http_sd_config

I will look at wiring up the remaining proxy config options that were added to prometheus but not included in the agent yet.

@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Mar 11, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants