I suppose this is a silly question with a simple answer, but I have not found the hostname in the metrics provided by the node-exporter when launched as a docker container.
My goal is to be able to launch the node exporter as a global service in a swarm cluster and to be able to filter the collected values per host. If I cannot know from which node the data comes from I cannot filter the data correctly.
In the docs I've not seen any collector that would allow me to get this data either.
I've launched the node-exporter with this values:
```
docker \
service create --mode global \
--name node-exporter \
--network monitoring \
--publish 9100 \
prom/node-exporter \
--collectors.enabled netdev,stat,vmstat,conntrack,meminfo,time,diskstats,entropy,loadavg,mdadm,sockstat,textfile,uname,filefd,filesystem,netstat,ipvs,systemd
```
This is information that is known at the time of discovery – the preferred way to add this label is on the Prometheus server side. The specifics depend on the discovery mechanism used; if all else fails relabelling will help.
/MR
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To post to this group, send email to prometheus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/6c5c8747-e80b-4fc6-967a-b7ca7fb8ebae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
> To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
>
> To post to this group, send email to prometheus...@googlegroups.com.
>
> To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/6c5c8747-e80b-4fc6-967a-b7ca7fb8ebae%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/a81c1266-1460-4005-a05d-0917a7877550%40googlegroups.com.
A records will always resolve to IPs. Swarm will need to publish SRV for hostnames to work.
> To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsubscri...@googlegroups.com.
>
> To post to this group, send email to prometheus...@googlegroups.com.
>
> To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/6c5c8747-e80b-4fc6-967a-b7ca7fb8ebae%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsubscri...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/a81c1266-1460-4005-a05d-0917a7877550%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CA%2BT6YoxycOAkxzd3BLOY%3DFCD9xZcizaOG6ZwHP6smzbSH4oSZA%40mail.gmail.com.
I think the typical recommendation is to run the node_expoeter on host networking, so that if can correctly monitor all real network interfaces.
> > To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
>
> >
>
> > To post to this group, send email to prometheus...@googlegroups.com.
>
> >
>
> > To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/6c5c8747-e80b-4fc6-967a-b7ca7fb8ebae%40googlegroups.com.
>
> >
>
> > For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
>
> To post to this group, send email to prometheus...@googlegroups.com.
>
> To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/a81c1266-1460-4005-a05d-0917a7877550%40googlegroups.com.
>
>
>
> For more options, visit https://groups.google.com/d/optout.
Hi Julius,
As far as I've seen this IP is the "node-exporter" task (container) IP:port in the Prometheus network, then it's something that allows me to split the values per node-exporter, and it's the value that I'm currently using in my Grafana Dashboard (https://grafana.net/dashboards/609).
But as it's not the node IP or hostname it's something that does not allow me to identify the node automatically, I need to manually check where's running the specific node-exporter container to realise it.
And I cannot use a global filter in my dashboard to filter by node, because the "same data" from the cAdvisor exporter is provided by a swarm container label that identifies the node in the swarm (container_label_com_docker_swarm_node_id).
Do you know when it's planned to support swarm service discovery natively in Prometheus?
Ah, and thanks for your help, it is very appreciated. ;)
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/49e7b5c5-1054-466a-87d5-eb9a8402751f%40googlegroups.com.
Do you know when it's planned to support swarm service discovery natively in Prometheus?
Here is what I found. You can get the nodename(hostname) from the uname variable.
In Prometheus query node_uname_info. You can the parse the data to give you your hostname. I did the parsing using grafana.
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To post to this group, send email to prometheus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/d24f6040-ed66-4c04-b0fc-0ae61bea29f2%40googlegroups.com.
We recommend to run the node-exporter directly on the host, not containerized or use host-networking which should make it return the right hostname. This will also cause the metric to has the host's IP in the instance label.
On Tue, Dec 19, 2017 at 10:58 AM <ntel...@gmail.com> wrote:
Τη Πέμπτη, 13 Οκτωβρίου 2016 - 12:33:42 μ.μ. UTC+2, ο χρήστης Julius Volz έγραψε:
> On Thu, Oct 13, 2016 at 11:18 AM, <basili...@softonic.com> wrote:
> Do you know when it's planned to support swarm service discovery natively in Prometheus?
>
>
>
> No, but at the Docker Summit last weekend, there were some people interested in working on it. No concrete plans yet though, but I think everyone agrees that it makes sense for Prometheus to support native Docker Swarm discovery somehow. It's just very new.
Are there any news on this?
It would be great to have at least the IP (or hostname) of the 'base' host in which the containers are running.
Is there any work-around? e.g. some kind of relabeling?
Thank you!
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-devel...@googlegroups.com.
To post to this group, send email to prometheus...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsubscri...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/d24f6040-ed66-4c04-b0fc-0ae61bea29f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Prometheus Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-developers/CAKSCP52z1OdAmDsb1%3Dax_nfSrO7SKcf1O%2BumkGUXiqpfJNyTjg%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-developers+unsub...@googlegroups.com.
To post to this group, send email to prometheus-developers@googlegroups.com.