prometheus-rancher-exporter icon indicating copy to clipboard operation
prometheus-rancher-exporter copied to clipboard

add hostname metadata

Open strowi opened this issue 7 years ago • 2 comments

Hi,

first of all thx for the work you're putting into this! It helped me a lot.;)

Would it be possible to add the nodes 'real' hostname to the available metadata? E.g. for the node-exporter it would be quite useful to export the hostname used in rancher, instead of the IP (just like it is possible in kubernetes). That way it would be easy to relabel instance to the hostname..

regards, Roman

strowi avatar Jan 28 '18 10:01 strowi

Same problem here. The node instance ID is set by default to the container IP of the exporter, not the hostname of the actual host. It's confusing and weird.

dbsanfte avatar Jun 21 '18 12:06 dbsanfte

Same problem here. The node instance ID is set by default to the container IP of the exporter, not the hostname of the actual host. It's confusing and weird.

I had the same issue, I'm now overwriting all the instance labels with the actual hostnames. This is quite easily doable in the prometheus config by setting it onto the labels attribute:

      - targets: ['rancher-specific-service-name']
        labels:
          instance: 'actual-hostname'

Btw, check that out 😁 https://github.com/marcbachmann/rancher-prometheus-config

marcbachmann avatar Jul 07 '18 00:07 marcbachmann