prom-label-proxy
prom-label-proxy copied to clipboard
feat: Provide label value by http header
Fixes #117
Closes #64
Can we get this merged? Would be very useful.
@squat could you take a look here?
Tagging all owners since there have been related PRs (#54 #64 #117 ) with the same feature pending for quite a while.
@brancz @krasi-georgiev @metalmatze @paulfantom @pgier @s-urbaniak @simonpasquier @squat @lilic
@fpetkovski maybe?
Would also be interested into this. Also into a new release because the actual 0.5.0 doesnt support the -values parameter (only the version in main does this).
How we can proceed here?
Hey @simonpasquier, I saw you suggestions, but I recommend to create an additional PR which superseeds this PR or modify to existing one. "Allow edits by maintainers" is enabled. if you have maintainer permissions on https://github.com/prometheus-community/prom-label-proxy, feel free to commit here. I wont do any refactorings, since I don't have the full golang knowledge.
@jkroepke can you reopen my PR on your fork and merge it then? I could have pushed my changes on top of your branch but I didn't want to do it without you being aware :)
Hey @simonpasquier please take a look that the merge conflict now which appears now after merging the PR
@jkroepke sure, let me resolve this!
@fpetkovski I'd like your input on this PR. In particular there's a slight difference compared to what you implemented in #116. With this change, users have to select the method to retrieve the label value from incoming requests:
- from the HTTP form/query parameters (
-query-param
or-label
) - from the HTTP headers (
-header-name
) - statically defined (
-label-value
)
It isn't possible to pass -label-value
and -label
at the same time hence when a static label value is used, the proxy will not remove anything from the HTTP parameters. Did you have a concrete use case for cleaning up the HTTP parameters when using the static configuration?
It isn't possible to pass
-label-value
and-label
at the same time hence when a static label value is used, the proxy will not remove anything from the HTTP parameters. Did you have a concrete use case for cleaning up the HTTP parameters when using the static configuration?
After discussing offline with @fpetkovski the statement above isn't correct: in the current version, the proxy will return an HTTP error code when configured with -label-value
and the incoming HTTP request has a label query parameter. With this PR, the proxy configured with -label-value
won't remove any HTTP query/form parameter but it sounds ok as it will be ignored anyway.
thanks a lot @jkroepke for your work and patience!