My Prometheus server gets its list of targets (or "services", in Consul's lingo) from Consul. I only want to monitor a subset of these targets. This should be possible via Prometheus's regex mechanism, but the correct configuration eludes me. How is this done?
相关问题
- label with regex- Prometheus
- How to set prometheus rules in stable/prometheus c
- Sending metrics from telegraf to prometheus
- prometheus rate on series by regex
- Spring Cloud Data Flow Grafana Prometheus not show
相关文章
- Prometheus - add target specific label in static_c
- How to init docker swarm with consul
- How to get overall uptime of a server with prometh
- Monitoring java native memory
- Prometheus - Aggregate and relabel by regex
- Consul Check HTTPS self signed
- Micrometer - Prometheus Gauge displays NaN
- Consul not deregistering zombie services
I've used a very similar solution to the problem using the following config. It allows to scrape only the services with a specific tag, rather than excluding services with a given tag.
Here's the
scrape_configs
section of my config:I then make sure to register all relevant services with the
metrics_method=prometheus-servlet
tag, and the rest will be ignored.The documentation for the relabeling configuration is available here: https://prometheus.io/docs/operating/configuration/#relabel_config.
The documentation for the Consul service discovery configuration is available here: https://prometheus.io/docs/operating/configuration/#consul_sd_config.
I've scoured the web and there is not a single example showing how its done, so for posterity - the following configuration will drop all consul services marked with the 'ignore-at-prometheus' tag