Add conf fragment to expose patroni prometheus metrics
This commit is contained in:
parent
d690f16a66
commit
2139d4d44d
|
@ -331,7 +331,7 @@ _EOT
|
|||
[[- if $c.prometheus.enabled ]]
|
||||
|
||||
|
||||
[[ template "common/task.metrics_proxy.tpl" $c ]]
|
||||
[[ template "common/task.metrics_proxy.tpl" merge (dict "prometheus" (dict "additional_proxy_conf" (tmpl.Exec "postgres/nginx_patroni.conf.tpl" $c))) $c ]]
|
||||
|
||||
task "exporter" {
|
||||
driver = [[ $c.nomad.driver | toJSON ]]
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
server {
|
||||
listen {{ env "NOMAD_ALLOC_PORT_patroni-metrics" }} ssl http2;
|
||||
ssl_certificate /secrets/metrics.bundle.pem;
|
||||
ssl_certificate_key /secrets/metrics.bundle.pem;
|
||||
ssl_client_certificate /local/monitoring.ca.pem;
|
||||
ssl_verify_client on;
|
||||
ssl_protocols TLSv1.2 TLSv1.3;
|
||||
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
|
||||
ssl_session_cache shared:SSL:10m;
|
||||
ssl_session_timeout 1h;
|
||||
ssl_session_tickets off;
|
||||
|
||||
gzip on;
|
||||
gzip_types
|
||||
text/plain;
|
||||
gzip_vary on;
|
||||
|
||||
server_tokens off;
|
||||
|
||||
if ($request_method !~ ^(GET|HEAD)$ ) {
|
||||
return 405;
|
||||
}
|
||||
location /metrics {
|
||||
proxy_pass https://localhost:{{ env "NOMAD_ALLOC_PORT_patroni" }}/metrics;
|
||||
proxy_ssl_verify off;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue