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:
1 parent
bd973d783d
commit
477c0eb5d1
1 file changed
+1
@@ -188,6 +188,7 @@ services:
|
|||||||
alloy:
|
alloy:
|
||||||
image: grafana/alloy:v1.17.1
|
image: grafana/alloy:v1.17.1
|
||||||
container_name: apex-alloy
|
container_name: apex-alloy
|
||||||
|
hostname: "${APEX_NODE_HOST}" # UTS hostname => node_exporter's node_uname_info `nodename` (else the container id)
|
||||||
profiles: [alloy]
|
profiles: [alloy]
|
||||||
user: "0:0" # root: required for host metrics, journal, and docker.sock
|
user: "0:0" # root: required for host metrics, journal, and docker.sock
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
Reference in new issue
Block a user