2020-05-22 15:38:49 +02:00
|
|
|
# Arbitrary number of usernames may be put here.
|
2022-07-19 18:42:36 +02:00
|
|
|
# It is possible to set multiple identical usernames with different passwords.
|
|
|
|
# Such usernames can be differentiated by `name` option.
|
2020-05-22 15:38:49 +02:00
|
|
|
|
|
|
|
users:
|
2022-03-18 17:41:19 +01:00
|
|
|
# Requests with the 'Authorization: Bearer XXXX' and 'Authorization: Token XXXX'
|
|
|
|
# header are proxied to http://localhost:8428 .
|
2021-04-20 09:58:29 +02:00
|
|
|
# For example, http://vmauth:8427/api/v1/query is proxied to http://localhost:8428/api/v1/query
|
2021-11-17 12:31:16 +01:00
|
|
|
# Requests with the Basic Auth username=XXXX are proxied to http://localhost:8428 as well.
|
2021-04-20 09:58:29 +02:00
|
|
|
- bearer_token: "XXXX"
|
|
|
|
url_prefix: "http://localhost:8428"
|
2020-05-22 15:38:49 +02:00
|
|
|
|
2021-10-22 18:08:06 +02:00
|
|
|
# Requests with the 'Authorization: Bearer YYY' header are proxied to http://localhost:8428 ,
|
|
|
|
# The `X-Scope-OrgID: foobar` http header is added to every proxied request.
|
2023-08-31 14:26:51 +02:00
|
|
|
# The `X-Server-Hostname:` http header is removed from the proxied response.
|
2021-10-22 18:08:06 +02:00
|
|
|
# For example, http://vmauth:8427/api/v1/query is proxied to http://localhost:8428/api/v1/query
|
|
|
|
- bearer_token: "YYY"
|
|
|
|
url_prefix: "http://localhost:8428"
|
2023-08-31 14:26:51 +02:00
|
|
|
# extra headers to add to the request or remove from the request (if header value is empty)
|
2021-10-22 18:08:06 +02:00
|
|
|
headers:
|
|
|
|
- "X-Scope-OrgID: foobar"
|
2023-08-31 14:26:51 +02:00
|
|
|
# extra headers to add to the response or remove from the response (if header value is empty)
|
|
|
|
response_headers:
|
|
|
|
- "X-Server-Hostname:" # empty value means the header will be removed from the response
|
2021-10-22 18:08:06 +02:00
|
|
|
|
2020-05-22 15:38:49 +02:00
|
|
|
# All the requests to http://vmauth:8427 with the given Basic Auth (username:password)
|
2023-02-10 05:03:01 +01:00
|
|
|
# are proxied to http://localhost:8428 .
|
2021-04-20 09:58:29 +02:00
|
|
|
# For example, http://vmauth:8427/api/v1/query is proxied to http://localhost:8428/api/v1/query
|
2023-02-10 05:03:01 +01:00
|
|
|
#
|
|
|
|
# The given user can send maximum 10 concurrent requests according to the provided max_concurrent_requests.
|
|
|
|
# Excess concurrent requests are rejected with 429 HTTP status code.
|
2023-02-11 06:57:49 +01:00
|
|
|
# See also -maxConcurrentPerUserRequests and -maxConcurrentRequests command-line flags.
|
2020-05-22 15:38:49 +02:00
|
|
|
- username: "local-single-node"
|
|
|
|
password: "***"
|
|
|
|
url_prefix: "http://localhost:8428"
|
2023-02-10 05:03:01 +01:00
|
|
|
max_concurrent_requests: 10
|
2020-05-22 15:38:49 +02:00
|
|
|
|
2021-04-20 09:51:03 +02:00
|
|
|
# All the requests to http://vmauth:8427 with the given Basic Auth (username:password)
|
2023-02-10 05:03:01 +01:00
|
|
|
# are proxied to http://localhost:8428 with extra_label=team=dev query arg.
|
2023-11-29 19:48:48 +01:00
|
|
|
# For example, http://vmauth:8427/api/v1/query is proxied to http://localhost:8428/api/v1/query?extra_label=team=dev
|
2023-02-10 05:03:01 +01:00
|
|
|
- username: "local-single-node2"
|
2021-04-20 09:51:03 +02:00
|
|
|
password: "***"
|
|
|
|
url_prefix: "http://localhost:8428?extra_label=team=dev"
|
|
|
|
|
2023-11-11 12:46:57 +01:00
|
|
|
# All the requests to http://vmauth:8427 with the given Basic Auth (username:password)
|
|
|
|
# are proxied to https://localhost:8428
|
2023-11-29 19:48:48 +01:00
|
|
|
# For example, http://vmauth:8427/api/v1/query is proxied to https://localhost/api/v1/query
|
2023-11-11 12:46:57 +01:00
|
|
|
# TLS verification is ignored for https://localhost.
|
|
|
|
- username: "local-single-node-with-tls"
|
|
|
|
password: "***"
|
|
|
|
url_prefix: "https://localhost"
|
|
|
|
tls_insecure_skip_verify: true
|
|
|
|
|
2020-05-22 15:38:49 +02:00
|
|
|
# All the requests to http://vmauth:8427 with the given Basic Auth (username:password)
|
2023-02-10 05:03:01 +01:00
|
|
|
# are load-balanced among http://vmselect1:8481/select/123/prometheus and http://vmselect2:8481/select/123/prometheus
|
2021-05-29 00:00:23 +02:00
|
|
|
# For example, http://vmauth:8427/api/v1/query is proxied to the following urls in a round-robin manner:
|
|
|
|
# - http://vmselect1:8481/select/123/prometheus/api/v1/select
|
|
|
|
# - http://vmselect2:8481/select/123/prometheus/api/v1/select
|
2020-05-22 15:38:49 +02:00
|
|
|
- username: "cluster-select-account-123"
|
|
|
|
password: "***"
|
2021-05-29 00:00:23 +02:00
|
|
|
url_prefix:
|
|
|
|
- "http://vmselect1:8481/select/123/prometheus"
|
|
|
|
- "http://vmselect2:8481/select/123/prometheus"
|
2020-05-22 15:38:49 +02:00
|
|
|
|
2021-04-20 09:58:29 +02:00
|
|
|
# All the requests to http://vmauth:8427 with the given Basic Auth (username:password)
|
2023-02-10 05:03:01 +01:00
|
|
|
# are load-balanced between http://vminsert1:8480/insert/42/prometheus and http://vminsert2:8480/insert/42/prometheus
|
2021-05-29 00:00:23 +02:00
|
|
|
# For example, http://vmauth:8427/api/v1/write is proxied to the following urls in a round-robin manner:
|
|
|
|
# - http://vminsert1:8480/insert/42/prometheus/api/v1/write
|
|
|
|
# - http://vminsert2:8480/insert/42/prometheus/api/v1/write
|
2020-05-22 15:38:49 +02:00
|
|
|
- username: "cluster-insert-account-42"
|
|
|
|
password: "***"
|
2021-05-29 00:00:23 +02:00
|
|
|
url_prefix:
|
|
|
|
- "http://vminsert1:8480/insert/42/prometheus"
|
|
|
|
- "http://vminsert2:8480/insert/42/prometheus"
|
2021-04-20 09:58:29 +02:00
|
|
|
|
|
|
|
# A single user for querying and inserting data:
|
2023-05-09 00:12:19 +02:00
|
|
|
#
|
2021-04-20 09:58:29 +02:00
|
|
|
# - Requests to http://vmauth:8427/api/v1/query, http://vmauth:8427/api/v1/query_range
|
2021-05-29 00:00:23 +02:00
|
|
|
# and http://vmauth:8427/api/v1/label/<label_name>/values are proxied to the following urls in a round-robin manner:
|
|
|
|
# - http://vmselect1:8481/select/42/prometheus
|
|
|
|
# - http://vmselect2:8481/select/42/prometheus
|
|
|
|
# For example, http://vmauth:8427/api/v1/query is proxied to http://vmselect1:8480/select/42/prometheus/api/v1/query
|
|
|
|
# or to http://vmselect2:8480/select/42/prometheus/api/v1/query .
|
2023-09-08 22:39:17 +02:00
|
|
|
# Requests are re-tried at other url_prefix backends if response status codes match 500 or 502.
|
2023-05-09 00:12:19 +02:00
|
|
|
#
|
2021-10-22 18:08:06 +02:00
|
|
|
# - Requests to http://vmauth:8427/api/v1/write are proxied to http://vminsert:8480/insert/42/prometheus/api/v1/write .
|
|
|
|
# The "X-Scope-OrgID: abc" http header is added to these requests.
|
2023-05-09 00:12:19 +02:00
|
|
|
#
|
|
|
|
# Request which do not match `src_paths` from the `url_map` are proxied to the urls from `default_url`
|
|
|
|
# in a round-robin manner. The original request path is passed in `request_path` query arg.
|
|
|
|
# For example, request to http://vmauth:8427/non/existing/path are proxied:
|
|
|
|
# - to http://default1:8888/unsupported_url_handler?request_path=/non/existing/path
|
|
|
|
# - or http://default2:8888/unsupported_url_handler?request_path=/non/existing/path
|
2023-11-01 20:59:46 +01:00
|
|
|
#
|
2023-12-13 23:46:36 +01:00
|
|
|
# Regular expressions are allowed in `src_paths` and `src_hosts` entries.
|
2021-04-20 09:58:29 +02:00
|
|
|
- username: "foobar"
|
|
|
|
url_map:
|
2021-06-09 14:38:09 +02:00
|
|
|
- src_paths:
|
|
|
|
- "/api/v1/query"
|
|
|
|
- "/api/v1/query_range"
|
|
|
|
- "/api/v1/label/[^/]+/values"
|
2021-05-29 00:00:23 +02:00
|
|
|
url_prefix:
|
|
|
|
- "http://vmselect1:8481/select/42/prometheus"
|
|
|
|
- "http://vmselect2:8481/select/42/prometheus"
|
2023-09-08 22:39:17 +02:00
|
|
|
retry_status_codes: [500, 502]
|
2021-04-20 09:58:29 +02:00
|
|
|
- src_paths: ["/api/v1/write"]
|
|
|
|
url_prefix: "http://vminsert:8480/insert/42/prometheus"
|
2021-10-22 18:08:06 +02:00
|
|
|
headers:
|
|
|
|
- "X-Scope-OrgID: abc"
|
2023-05-08 22:29:06 +02:00
|
|
|
default_url:
|
2023-05-09 00:12:19 +02:00
|
|
|
- "http://default1:8888/unsupported_url_handler"
|
|
|
|
- "http://default2:8888/unsupported_url_handler"
|
2023-05-08 22:29:06 +02:00
|
|
|
|
2023-11-29 19:48:48 +01:00
|
|
|
# Requests without Authorization header are proxied according to `unauthorized_user` section.
|
|
|
|
# Requests are proxied in round-robin fashion between `url_prefix` backends.
|
|
|
|
# The deny_partial_response query arg is added to all the proxied requests.
|
2023-09-08 22:39:17 +02:00
|
|
|
# The requests are re-tried if url_prefix backends send 500 or 503 response status codes.
|
2023-05-08 22:29:06 +02:00
|
|
|
unauthorized_user:
|
2023-09-08 22:39:17 +02:00
|
|
|
url_prefix:
|
|
|
|
- http://vmselect-az1/?deny_partial_response=1
|
|
|
|
- http://vmselect-az2/?deny_partial_response=1
|
|
|
|
retry_status_codes: [503, 500]
|