ansible-role-grafana_agent
ansible-role-grafana_agent copied to clipboard
Add Custom Labels
Add support for custom labels to uniquely identify the source of metrics if you are running multiple Grafana Agents across multiple machines
Could you provide a config example with these labels?
https://grafana.com/docs/agent/latest/configuration/metrics-config/#global_config
A list of static labels to add for all metrics.
external_labels:
{
Add a label, for example environment: dev to differentiate between different environments
Thanks. The current config looks like this:
prometheus:
wal_directory: /tmp/grafana-agent-wal
global:
scrape_interval: 15s
configs: null
Maybe we can make it something like:
prometheus:
wal_directory: /tmp/grafana-agent-wal
global:
scrape_interval: 15s
external_labels:
{ environment : {{ grafana_agent_env | default('dev') }} }
configs: null
And expose the variable grafana_agent_env
. What do you think?
We also need to be mindful of users that don't want any labels.
Yes, this config looks good to me. Can we maybe use a flag(true or false) like used to install unzip here? to enable disable external_labels.
what is required for this to be added?
Time and/or a PR. Thanks