Repository navigation
ruler: allow configuring custom HTTP headers for query and Alertmanager endpoints - #9056
Merged
Merged
Conversation
âĶer endpoints Signed-off-by: Aditya <205600203+Rohilalala@users.noreply.github.com>
Codecov Reportâ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9056 +/- ##
==========================================
+ Coverage 64.56% 64.63% +0.06%
==========================================
Files 289 289
Lines 37420 37423 +3
==========================================
+ Hits 24162 24190 +28
+ Misses 11158 11143 -15
+ Partials 2100 2090 -10 â View full report in Codecov by Harness. ð New features to boost your workflow:
|
saswatamcode
reviewed
Oct 1, 2026
| endpoint_addresses: [] | ||
| ``` | ||
|
|
||
| To send extra headers with every HTTP query, for example a tenant ID, set `http_headers` in `http_config`. Each header takes `values`, `secrets` or `files`, as in Prometheus' `http_headers`; relative `files` paths are resolved from the working directory. The Alertmanager `http_config` accepts it too: |
Member
There was a problem hiding this comment.
Maybe just a comment, I'd probably not recommend running a ruler per tenant (unless you have limited number of tenants)
âĶounts Signed-off-by: Aditya <205600203+Rohilalala@users.noreply.github.com>
saswatamcode
approved these changes
Oct 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9052
Right now the Ruler can't send custom headers (like a tenant ID) when it queries, so you end up running a proxy just to add them. This adds an http_headers option to the HTTP client config. It works the same way as http_headers in Prometheus, so you can use values, secrets or files.
Since it's on the shared client config, it also works for Alertmanager, Sidecar and Receive. Headers like Authorization are still rejected at startup, same as in Prometheus.
I added tests in pkg/clientconfig that check the headers actually reach a test server (including one read from a file) and that Authorization gets rejected. Also added a small example to the Ruler docs and a CHANGELOG entry.
This PR was written in part with the assistance of generative AI; I reviewed and tested the changes.