From 50a558e89b15328df97aa118f2b295b493f28948 Mon Sep 17 00:00:00 2001 From: Bruce Becker Date: Sat, 18 May 2024 10:10:11 +0200 Subject: [PATCH] fix(grafana): fix consul exporter configuration Signed-off-by: Bruce Becker --- .../grafana-integrations-consul.yml.tmpl | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/grafana-agent/grafana-integrations-consul.yml.tmpl b/grafana-agent/grafana-integrations-consul.yml.tmpl index a994b5b..de53359 100644 --- a/grafana-agent/grafana-integrations-consul.yml.tmpl +++ b/grafana-agent/grafana-integrations-consul.yml.tmpl @@ -2,21 +2,35 @@ server: log_level: info metrics: - kvstore_config: - store: consul - prefix: "grafana/configurations/" - consul: - host: "localhost:8500" + # kvstore_config: + # store: consul + # prefix: "grafana/configurations/" + # consul: + # host: "localhost:8500" wal_directory: tmp/wal global: scrape_interval: 60s + configs: + - name: integrations + remote_write: + - basic_auth: + password: '{{ .Data.data.api_key }}' + username: '{{ .Data.data.metrics_id }}' + url: '{{ .Data.data.metrics_url }}/push' + scrape_configs: + - job_name: 'integrations/consul' + metrics_path: /v1/agent/metrics + params: + format: ["prometheus"] + static_configs: + - targets: ['localhost:8500'] integrations: prometheus_remote_write: - basic_auth: password: '{{ .Data.data.api_key }}' username: '{{ .Data.data.metrics_id }}' - url: '{{ .Data.data.metrics_url }}/api/prom/push' + url: '{{ .Data.data.metrics_url }}/push' agent: enabled: true relabel_configs: @@ -45,7 +59,7 @@ integrations: target_label: job metric_relabel_configs: - action: keep - regex: consul_raft_leader|consul_raft_leader_lastcontact_count|consul_raft_peers|consul_up + regex: '.*' source_labels: - __name__