Skip to content
Snippets Groups Projects
Commit 7f1a7f93 authored by ale's avatar ale
Browse files

Support multiple HTTP methods for the health check probes

Not all processes respond to HEAD requests on /metrics, so use the new
'healthcheck_http_method' attribute of monitoring_endpoints to select
another method.
parent 418412e4
No related branches found
No related tags found
No related merge requests found
modules: modules:
# Healthcheck probe to use on internal Prometheus targets. Only use
# when the target does not support HTTP methods that do not transfer
# data (HEAD / OPTIONS).
http_health_get:
prober: http
timeout: 5s
http:
valid_status_codes: [200]
method: GET
fail_if_ssl: false
fail_if_not_ssl: false
preferred_ip_protocol: ip4
tls_config:
ca_file: /etc/credentials/x509/prometheus/ca.pem
cert_file: /etc/credentials/x509/prometheus/client/cert.pem
key_file: /etc/credentials/x509/prometheus/client/private_key.pem
insecure_skip_verify: false
# Healthcheck probe to use on internal Prometheus targets, makes # Healthcheck probe to use on internal Prometheus targets, makes
# a simple HEAD request to /metrics to avoid transferring the entire # a simple HEAD request to /metrics to avoid transferring the entire
# metrics dump (which might be huge). # metrics dump (which might be huge).
http_health: http_health_head:
prober: http prober: http
timeout: 5s timeout: 5s
http: http:
...@@ -18,6 +36,25 @@ modules: ...@@ -18,6 +36,25 @@ modules:
key_file: /etc/credentials/x509/prometheus/client/private_key.pem key_file: /etc/credentials/x509/prometheus/client/private_key.pem
insecure_skip_verify: false insecure_skip_verify: false
# Healthcheck probe to use on internal Prometheus targets, makes
# a simple OPTIONS request to /metrics to avoid transferring the entire
# metrics dump (which might be huge). In particular, Prometheus jobs
# themselves do not support the HEAD method, but do understand OPTIONS.
http_health_options:
prober: http
timeout: 5s
http:
valid_status_codes: [200]
method: OPTIONS
fail_if_ssl: false
fail_if_not_ssl: false
preferred_ip_protocol: ip4
tls_config:
ca_file: /etc/credentials/x509/prometheus/ca.pem
cert_file: /etc/credentials/x509/prometheus/client/cert.pem
key_file: /etc/credentials/x509/prometheus/client/private_key.pem
insecure_skip_verify: false
# Base HTTPS probe that will not verify certificates, used # Base HTTPS probe that will not verify certificates, used
# only to check that NGINX is up and running. # only to check that NGINX is up and running.
http_base: http_base:
......
...@@ -111,7 +111,7 @@ scrape_configs: ...@@ -111,7 +111,7 @@ scrape_configs:
metrics_path: "/probe" metrics_path: "/probe"
params: params:
module: module:
- http_health - http_health_{{ target_config.healthcheck_http_method | default('HEAD') | lower }}
relabel_configs: relabel_configs:
- source_labels: [__address__] - source_labels: [__address__]
target_label: host target_label: host
......
...@@ -34,6 +34,7 @@ prometheus-lts: ...@@ -34,6 +34,7 @@ prometheus-lts:
monitoring_endpoints: monitoring_endpoints:
- port: 9099 - port: 9099
scheme: http scheme: http
healtcheck_http_method: OPTIONS
- port: 10912 - port: 10912
scheme: http scheme: http
ports: ports:
......
...@@ -143,10 +143,13 @@ prometheus: ...@@ -143,10 +143,13 @@ prometheus:
monitoring_endpoints: monitoring_endpoints:
- port: 9090 - port: 9090
scheme: http scheme: http
healtcheck_http_method: OPTIONS
- port: 9093 - port: 9093
scheme: http scheme: http
healtcheck_http_method: OPTIONS
- port: 9193 - port: 9193
scheme: http scheme: http
healtcheck_http_method: GET
- port: 2929 - port: 2929
scheme: https scheme: https
- port: 10904 - port: 10904
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment