From 36a5dfc1988b39f4ffeae0441e3ad4ebe193cec8 Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Tue, 28 May 2024 20:23:05 +0100 Subject: [PATCH] Upgrade prometheus, reduce retention time, and drop top metrics. --- services/prometheus.hcl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/services/prometheus.hcl b/services/prometheus.hcl index 203a97d..e45ba58 100644 --- a/services/prometheus.hcl +++ b/services/prometheus.hcl @@ -23,9 +23,14 @@ job "prometheus" { driver = "docker" config { - image = "prom/prometheus:v2.44.0" + image = "prom/prometheus:v2.52.0" network_mode = "host" - args = ["--storage.tsdb.path", "/opt/prometheus", "--web.listen-address", "0.0.0.0:9090", "--storage.tsdb.retention.time", "900d"] + args = [ + "--storage.tsdb.path", "/opt/prometheus", + "--web.listen-address", "0.0.0.0:9090", + "--storage.tsdb.retention.time", "730d", + "--web.enable-admin-api" + ] force_pull = true ports = ["http"] volumes = [ @@ -98,6 +103,10 @@ scrape_configs: regex: '.*job-(.*?)(,.*)' replacement: '${1}' target_label: 'job_name' + metric_relabel_configs: + - source_labels: [__name__] + regex: '(traefik_service_request_duration_seconds_bucket|traefik_entrypoint_request_duration_seconds_bucket)' + action: drop - job_name: 'consul-server' scrape_interval: 10s