Skip to content

Commit

Permalink
fix(grafana): fix consul exporter configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Bruce Becker <[email protected]>
  • Loading branch information
brucellino committed May 18, 2024
1 parent 4c5b8d9 commit 50a558e
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions grafana-agent/grafana-integrations-consul.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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__

Expand Down

0 comments on commit 50a558e

Please sign in to comment.