Consul Exporter - How to get host IP or FQDN

141 views
Skip to first unread message

jain.a...@gmail.com

unread,
Nov 28, 2016, 4:21:02 AM11/28/16
to Prometheus Users
Reposting it in users mailing list

Hello,

I am running a consul exporter and currently I see the following

consul_catalog_service_node_healthy{node="consul1",service="consul"} 1
consul_catalog_service_node_healthy{node="consul4",service="gapi"} 1
consul_catalog_service_node_healthy{node="consul4",service="webserver"} 1
consul_catalog_service_node_healthy{node="testhost",service="node_name"} 1

Value for "node" key is the hostname, is it possible to get say IP or FQDN of the host?

Regards
Ashish

Reply from Ben Below
This is provided by the consul_sd_config meta labels at discovery time.


Also, please take support requests to the prometheus-users list.

jain.a...@gmail.com

unread,
Nov 28, 2016, 4:25:16 AM11/28/16
to Prometheus Users, jain.a...@gmail.com
Hi Ben,

I am using https://github.com/prometheus/consul_exporter to get the status of various services. AFAIK https://prometheus.io/docs/operating/configuration/#<consul_sd_config> is basically used to auto-discover targets. Somehow I am unable to understand how this will help me to get the following
consul_catalog_service_node_healthy{node="consul1",service="consul"} 1
consul_catalog_service_node_healthy{node="consul4",service="gapi"} 1
consul_catalog_service_node_healthy{node="consul4",service="webserver"} 1
consul_catalog_service_node_healthy{node="testhost",service="node_name"} 1

Converted into something like
consul_catalog_service_node_healthy{node="192.168.56.90",service="consul"} 1
consul_catalog_service_node_healthy{node="192.168.56.93",service="gapi"} 1
consul_catalog_service_node_healthy{node="192.168.56.93",service="webserver"} 1
consul_catalog_service_node_healthy{node="192.168.76.20",service="node_name"} 1

Please suggest

Regards
Ashish

Reply all
Reply to author
Forward
0 new messages