You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-3
Original file line number
Diff line number
Diff line change
@@ -41,7 +41,7 @@ go get github.com/prometheus-community/prom-label-proxy
41
41
This application proxies the following endpoints and it ensures that a particular label is enforced in the particular request and response:
42
42
43
43
*`/federate` for GET method (Prometheus)
44
-
*`/api/v1/query_exemplars` for GET and POST methods (Prometheus)
44
+
*`/api/v1/query_exemplars` for GET and POST methods (Prometheus/Thanos)
45
45
*`/api/v1/query` for GET and POST methods (Prometheus/Thanos)
46
46
*`/api/v1/query_range` for GET and POST methods (Prometheus/Thanos)
47
47
*`/api/v1/series` for GET method (Prometheus/Thanos)
@@ -103,8 +103,7 @@ This is enforced for any case, whether a label matcher is specified in the origi
103
103
104
104
Similar to query endpoint, for metadata endpoints `/api/v1/series`, `/api/v1/labels`, `/api/v1/label/<name>/values` the proxy injects the specified label all the provided `match[]` selectors.
105
105
106
-
NOTE: At the moment of creation `/api/v1/labels`, `/api/v1/label/<name>/values` does not support `match[]` so they are disabled by default. Use `-enable-label-apis` flag to enable
107
-
those (see https://github.com/prometheus/prometheus/issues/6178 for tracking development).
106
+
NOTE: When the `/api/v1/labels` and `/api/v1/label/<name>/values` endpoints were added to `prom-label-proxy`, the Prometheus and Thanos endpoints didn't support the `match[]` parameter hence the `prom-label-proxy` labels endpoints are disabled by default. Use the `-enable-label-apis` flag to enable after you've ensured that the upstream endpoints support label selectors (see https://github.com/prometheus/prometheus/issues/6178 and https://github.com/thanos-io/thanos/issues/3351).
Copy file name to clipboardExpand all lines: main.go
+6-6
Original file line number
Diff line number
Diff line change
@@ -43,12 +43,12 @@ func main() {
43
43
flagset.StringVar(&label, "label", "", "The label to enforce in all proxied PromQL queries. "+
44
44
"This label will be also required as the URL parameter to get the value to be injected. For example: -label=tenant will"+
45
45
" make it required for this proxy to have URL in form of: <URL>?tenant=abc&other_params...")
46
-
flagset.BoolVar(&enableLabelAPIs, "enable-label-apis", false, "When specified proxy allows to inject label to label APIs like /api/v1/labels and /api/v1/label/<name>/values."+
47
-
"NOTE: Enable with care. Selection of matcher is still in development, see https://github.com/thanos-io/thanos/issues/3351 and https://github.com/prometheus/prometheus/issues/6178. If enabled and"+
48
-
"any labels endpoint does not support selectors, injected matcher will be silently dropped.")
49
-
flagset.StringVar(&unsafePassthroughPaths, "unsafe-passthrough-paths", "", "Comma delimited allow list of exact HTTP path segments should be allowed to hit upstream URL without any enforcement."+
50
-
"This option is checked after Prometheus APIs, you can cannot override enforced API to be not enforced with this option. Use carefully as it can easily cause a data leak if the provided path is an important"+
51
-
"API like targets or configuration. NOTE: \"all\" matching paths like \"/\" or \"\" and regex are not allowed.")
46
+
flagset.BoolVar(&enableLabelAPIs, "enable-label-apis", false, "When specified proxy allows to inject label to label APIs like /api/v1/labels and /api/v1/label/<name>/values."+
47
+
"NOTE: Enable with care because filtering by matcher is not implemented in older versions of Prometheus/Thanos (see https://github.com/thanos-io/thanos/issues/3351 and https://github.com/prometheus/prometheus/issues/6178). If enabled and"+
48
+
"any labels endpoint does not support selectors, the injected matcher will have no effect.")
49
+
flagset.StringVar(&unsafePassthroughPaths, "unsafe-passthrough-paths", "", "Comma delimited allow list of exact HTTP path segments that should be allowed to hit upstream URL without any enforcement."+
50
+
"This option is checked after Prometheus APIs, you cannot override enforced API endpoints to be not enforced with this option. Use carefully as it can easily cause a data leak if the provided path is an important"+
51
+
"API (like /api/v1/configuration) which isn't enforced by prom-label-proxy. NOTE: \"all\" matching paths like \"/\" or \"\" and regex are not allowed.")
52
52
flagset.BoolVar(&errorOnReplace, "error-on-replace", false, "When specified, the proxy will return HTTP status code 400 if the query already contains a label matcher that differs from the one the proxy would inject.")
0 commit comments