fix: set alloy container hostname to APEX_NODE_HOST

node_exporter's uname collector reports the container's UTS hostname as
node_uname_info{nodename}, which Docker defaults to the container id. Grafana
surfaces that as the host, so every node showed a hex id instead of its name.
Setting hostname on the alloy service makes nodename the node's public host.
node/instance labels were already correct via the config.alloy relabel.
This commit is contained in:
deytenit committed 2026-07-11 16:49:56 +03:00
1 parent bd973d783d
commit 477c0eb5d1
1 file changed
+1
+1
View File
@@ -188,6 +188,7 @@ services:
alloy:
image: grafana/alloy:v1.17.1
container_name: apex-alloy
hostname: "${APEX_NODE_HOST}" # UTS hostname => node_exporter's node_uname_info `nodename` (else the container id)
profiles: [alloy]
user: "0:0" # root: required for host metrics, journal, and docker.sock
volumes: