ansible-role-grafana_agent
ansible-role-grafana_agent copied to clipboard
Breaking changes in Grafana agent config
Hello everyone!
Today I was doing some investigation regarding Loki because I couldn't get logs inside of Grafana Cloud. At the end the path passed inside of promtail-config.yaml.j2
has changed from /api/prom/push
to /loki/api/v1/push
.
Before I push a PR fixing this, it would be nice if someone could confirm my findings. My Grafana stack is only a couple of days old and could have only a new version with the breaking change. Also, my Instances are in eu-west-0
which could also behave differently for now.
After reading threw the Docs it seems like a lot of things have changed for agent-config.yaml
This is what I'm using now and all my issues with Loki and Prometheus are resolved.
server:
http_listen_port: 12345
log_level: info
metrics:
wal_directory: /tmp/grafana-agent-wal
global:
scrape_interval: 15s
remote_write:
- url: https://prometheus-{{ grafana_location_prometheus }}.grafana.net/api/prom/push
basic_auth:
username: {{ prometheus_user }}
password: {{ grafana_api_key }}
configs:
- name: default
scrape_configs:
- job_name: agent
static_configs:
- targets: ['127.0.0.1:12345']
logs:
configs:
- name: default
positions:
filename: /tmp/positions.yaml
scrape_configs:
- job_name: varlogs
static_configs:
- targets: [localhost]
labels:
job: varlogs
__path__: /var/log/*log
clients:
- url: https://logs-prod-eu-west-0.grafana.net/loki/api/v1/push
basic_auth:
username: {{ loki_user }}
password: {{ grafana_api_key }}
integrations:
node_exporter:
enabled: true
Your input is highly appreciated @nleiva
Yeah, @bekriebel noticed another changed as well (https://github.com/nleiva/ansible-role-grafana_agent/commit/06306f4af136f242602c21e81ef8df4da75edac4). Feel free to submit a PR, I have not had a chance to test this myself yet.
I can confirm this change. My setup did break too and your changes seem to resolve that! Thanks for looking into it.