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
parent d26dd9f2a6
commit 22f19ee550
Signed by: emilylange
GPG key ID: 0AD773CE46FD0F87

View file

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