Referring to Prometheus documentation on dockerswarm_sd_config here they suggest using this relabel_configs configuration for collecting nodes metrics:
relabel_configs:
# Fetch metrics on port 9323.
- source_labels: [__meta_dockerswarm_node_address]
target_label: __address__
replacement: $1:9323
It looks an error to me: with this config, I think I’m leveraging swarm routing mesh, so any time Prometheus tries to scape a node, it asks to the node IP address and in turns it gets a random host from the swarm. In other words, it looks to me Prometheus believes scraping Node1 but its request is forwarded to any node the mesh decides.
Sure Prometheus documentation is fine, so, were I’m wrong?
Thanks.