Adds the optional ability to split the tenant request header by comma #223
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.
Currently, prom-label-proxy will accept multiple header values only if they correspond to separately-occurring header lines in the incoming HTTP request. Example request:
Attempting to pass multiple header values via list-style syntax as described in RFC 9110 (https://www.rfc-editor.org/rfc/rfc9110#name-field-lines-and-combined-fi), on the other hand, results in a single tenant value consisting of the entire comma-separated string. Example request:
With the above sample request, the tenant label match expression becomes "firsttenant, secondtenant"
This is inconvenient for use with Custom Header configuration on Grafana Data Sources, which seem to be unable to pass more than one request header line for a given header name -- the last header value overwrites the first.
This pull request adds OPTIONAL support for parsing the tenant request header as a comma-separated list. To enable, add the parameter "-header-uses-list-syntax" to the prom-label-proxy's commandline.
When the list syntax option enabled, the sample request containing the "firsttenant, secondtenant" list given above ultimately produces the tenant label match expression "firsttenant|secondtenant".