Why don't you use the new Docker Swarm configuration?
https://prometheus.io/docs/guides/dockerswarm/
On 31 Jul 02:09, Tom Kun wrote:
> I try to use the static_configs but I encountered issues about settings
> node_id and node_name.
> Al my targets get the node_name and node_id.
>
> This is the entrypoint.sh I use to set the node_name and the node_id for
> each node_exporter hosts:
> #!/bin/sh -e
>
> NODE_CLUSTER=$(cat /etc/node_cluster)
> NODE_NAME=$(cat /etc/nodename)
>
> echo "node_meta{node_id=\"$NODE_ID\",
> container_label_com_docker_swarm_node_id=\"$NODE_ID\",
> node_name=\"$NODE_NAME\", node_cluster=\"${NODE_CLUSTER}\"} 1" >
> /etc/node-exporter/node-meta.prom
>
> set -- /bin/node_exporter "$@"
> exec "$@"
>
>
> So I don't think that static_configs is the solution at this actual issue...
>
> Do I have to install Prometheus on each of my cluster manager to retrieve
> the different metrics?
> It's not possible to give to the Prometheus metrics from different Swarm
> clusters?
>
> On Thursday, 30 July 2020 09:34:37 UTC+2, Brian Candler wrote:
> >
> > Just as an aside: it would be better use static_sd_configs or
> > file_sd_configs in the case where you list all the nodes explicitly.
> >
> > dns_sd_configs is intended for when you do a single query, and the
> > response contains a set of A or AAAA records representing all the targets.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/ba815e7c-124c-424f-9a53-51c2c1df573co%40googlegroups.com.
--
Julien Pivotto
@roidelapluie
--
You received this message because you are subscribed to the Google Groups
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/prometheus-users/20200731091801.GA206855%40oxygen.