'filter' in consul_sd_config; how to use?

20 views
Skip to first unread message

M Moore

unread,
Oct 10, 2025, 1:07:44 PM (5 days ago) Oct 10
to Prometheus Users
The Prometheus configuration documentation warns that the "node_meta" parameter for consul_sd_config is going away, so I switched to using the "filter" parameter, but it doesn't seem to work at all.

From command line:
curl -s 'http://gis-consul-csg:8500/v1/catalog/nodes' -> returns 559 nodes
curl -s 'http://gis-consul-csg:8500/v1/catalog/nodes?filter=Meta.silo=="mdb"' -> returns 36 nodes

Now in Prometheus when I use:
  consul_sd_configs:
  - server: gis-consul-csg:8500
    filter: 'Meta.silo=="mdb"'

I get 559 targets, as if the "filter" is empty.  What am I doing wrong?
Message has been deleted

Brian Candler

unread,
Oct 11, 2025, 10:16:37 AM (4 days ago) Oct 11
to Prometheus Users
I don't know why my reply was deleted. It said to use tcpdump to see what actual HTTP request is being made to consul. Looking at the source, I suspect Prometheus is querying for "services" not "nodes".
Reply all
Reply to author
Forward
0 new messages