prometheus / node_exporter

Exporter for machine metrics
https://prometheus.io/
Apache License 2.0
10.93k stars 2.33k forks source link

Feature Request to resolve Virtual-IPs to Hostnames in ipvs collector #1141

Open m8t opened 5 years ago

m8t commented 5 years ago

node_exporter version: 0.15.2

Feature request for the collector ipvs:

Currently the ipvs collector provides Virtual IPs associated to Real-server IPs, and I set up a dashboard in Grafana with a multitude of label_replace to show off the Virtual IPs as hostnames. What about a flag for ipvs to resolve the IPs?

For example:

# curl -s <SERVER>:9100/metrics
# HELP node_ipvs_backend_connections_active The current active connections by local and remote address.
# TYPE node_ipvs_backend_connections_active gauge
node_ipvs_backend_connections_active{local_address="<VIRTUAL-IP>",local_port="443",proto="TCP",remote_address="<IP-REAL-SERVER>",remote_port="443"} 0
[...]

The collector could have an option to provide both fields local_address and local_fqdn:

node_ipvs_backend_connections_active{local_address="<VIRTUAL-IP>",local_fqdn="<FQDN>",local_port="443",proto="TCP",remote_address="<IP-REAL-SERVER>",remote_port="443"} 0
SuperQ commented 5 years ago

That sounds like a reasonable idea. I think we would want to leave it off by default, just because you need to be very careful about not stalling the exporter waiting for resolver responses. A production setup should probably have a local resolver cache of some kind. That part I wouldn't want to implement in the exporter.

Care to try adding this feature?

discordianfish commented 5 years ago

I'm not sure this is the right approach. We'd need to disable it by default and it would be a first, so we should think about the implications some more.

I think a better solution would be having a dns-exporter/bridge (or maybe add it to the blackbox-exporter) to resolve IPs and then use vector matching to get the hostname where needed.