grafana-agent: set hostname label on all metrics

This is handy to quickly see all metrics exported by a node, without
having to mangle with the already existing `instance` label.

`hostname` is essentially a variant of `instance` but without ports.
This commit is contained in:
emily 2024-07-08 00:30:17 +02:00 committed by K900
parent ba0d50624d
commit db8c831c2f

View file

@ -41,6 +41,7 @@ in
};
}
];
global.external_labels.hostname = config.networking.hostName;
configs = [
{
name = config.networking.hostName;