What source_label contains the IP address of the exporter Prometheus connected to when polling it?
On 1 September 2016 at 16:55, Lukas Lösche <lu...@mesosphere.io> wrote:What source_label contains the IP address of the exporter Prometheus connected to when polling it?This is not exposed by Prometheus, and would not be available to relabelling as scraping happens after relabelling.
I'm running node_exporter on every node of a Mesos cluster and using Mesos-DNS based DNS-SD SRV records to discover the nodes in the cluster.The config looks something like this:scrape_configs:- job_name: nodedns_sd_configs:- refresh_interval: 15snames:- '_node-exporter.prometheus._tcp.marathon.mesos'relabel_configs:- source_labels: ['__address__']target_label: 'instance'Now because of the way those SRV records work I'm ending up with instance labels likenode-exporter.prometheus-6ms1y-s1.marathon.mesos:14181node-exporter.prometheus-54eio-s0.marathon.mesos:12227node-exporter.prometheus-1e1ow-s2.marathon.mesos:31798which is rather useless for my use case.Instead I'd like the instance to contain the IP address of the host the node_exporter was running on / the SRV record resolved to.I tried source_labels: ['__ip__'] but that's not it.You likely need file_sd with a custom script here. Have you considered using the Marathon SD?
--
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.
For more options, visit https://groups.google.com/d/optout.
On Thu, Sep 1, 2016 at 2:01 PM Brian Brazil <brian.brazil@robustperception.io> wrote:On 1 September 2016 at 16:55, Lukas Lösche <lu...@mesosphere.io> wrote:What source_label contains the IP address of the exporter Prometheus connected to when polling it?This is not exposed by Prometheus, and would not be available to relabelling as scraping happens after relabelling.We could consider moving the DNS resolution from hostname to IP into DNS-sd itself though instead of doing it during each scrape.
I'm running node_exporter on every node of a Mesos cluster and using Mesos-DNS based DNS-SD SRV records to discover the nodes in the cluster.The config looks something like this:scrape_configs:- job_name: nodedns_sd_configs:- refresh_interval: 15snames:- '_node-exporter.prometheus._tcp.marathon.mesos'relabel_configs:- source_labels: ['__address__']target_label: 'instance'Now because of the way those SRV records work I'm ending up with instance labels likenode-exporter.prometheus-6ms1y-s1.marathon.mesos:14181node-exporter.prometheus-54eio-s0.marathon.mesos:12227node-exporter.prometheus-1e1ow-s2.marathon.mesos:31798which is rather useless for my use case.Instead I'd like the instance to contain the IP address of the host the node_exporter was running on / the SRV record resolved to.I tried source_labels: ['__ip__'] but that's not it.You likely need file_sd with a custom script here. Have you considered using the Marathon SD?--
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.
For more options, visit https://groups.google.com/d/optout.
You likely need file_sd with a custom script here. Have you considered using the Marathon SD?
--
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.
That's what I have suggested above by moving the hostname to IP resolution into the discovery routine. So far this resolution happens on scrape time. Feel free to create an issue for that, but as Brian noticed this might require changes to other discovery mechanisms as well.
On Thu, Sep 1, 2016 at 5:27 PM Lukas Lösche <lu...@mesosphere.io> wrote:
On Thu, Sep 1, 2016 at 8:01 PM, Brian Brazil <brian.brazil@robustperception.io> wrote:You likely need file_sd with a custom script here. Have you considered using the Marathon SD?I'm running Marathon on DC/OS EE with service account authentication which Marathon SD doesn't support.file_sd seems the way to go which is a shame because so far I was able to use the unmodified prom/prometheus Docker image. Was hoping me not being able to get the node IP in that label was pebkac :-)I saw that different SD methods have different meta labels. Would it be feasible to have a dedicated meta label with the IP just for DNS-SD? Since SRV records are the only ones that produce these rather useless hostnames it seems like a problem specific to the DNS SD discovery method.
--
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.
That's what I have suggested above by moving the hostname to IP resolution into the discovery routine. So far this resolution happens on scrape time. Feel free to create an issue for that, but as Brian noticed this might require changes to other discovery mechanisms as well.
On Thu, Sep 1, 2016 at 5:27 PM Lukas Lösche <lu...@mesosphere.io> wrote:
On Thu, Sep 1, 2016 at 8:01 PM, Brian Brazil <brian.brazil@robustperception.io> wrote:You likely need file_sd with a custom script here. Have you considered using the Marathon SD?I'm running Marathon on DC/OS EE with service account authentication which Marathon SD doesn't support.file_sd seems the way to go which is a shame because so far I was able to use the unmodified prom/prometheus Docker image. Was hoping me not being able to get the node IP in that label was pebkac :-)I saw that different SD methods have different meta labels. Would it be feasible to have a dedicated meta label with the IP just for DNS-SD? Since SRV records are the only ones that produce these rather useless hostnames it seems like a problem specific to the DNS SD discovery method.
--
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.
For more options, visit https://groups.google.com/d/optout.