1
0
Fork 0

Enable Prometheus scraping metrics from Grafana metrics endpoint

Change-Id: Iefa86330cc9f23f7453a79979a8c34adab36a411
Related-Bug: PROD-18204
This commit is contained in:
Ildar Svetlov 2018-03-05 19:53:54 +04:00
parent 15bdc66d02
commit 627cbfddbb
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,30 @@
{%- if pillar.grafana.client is defined %}
{%- from "grafana/map.jinja" import client with context %}
{%- if client.get('enabled') %}
{%- set addresses = [] %}
{%- if not client.server.host.startswith('127') and client.server.host != '0.0.0.0' %}
{%- do addresses.append(client.server.host) %}
{%- endif %}
{%- for address in grains['fqdn_ip4'] %}
{%- if not address.startswith('127') %}
{%- do addresses.append(address) %}
{%- endif %}
{%- endfor %}
server:
target:
static:
grafana:
enabled: true
endpoint:
- address: {{ addresses[0] }}
port: {{ client.server.port }}
metric_relabel:
- source_labels: "__name__"
regex: "http_.*"
action: drop
{%- endif %}
{%- endif %}

View File

@ -11,3 +11,5 @@ parameters:
enabled: true
grafana:
enabled: true
prometheus:
enabled: true