prometheus / blackbox_exporter

Blackbox prober exporter
https://prometheus.io
Apache License 2.0
4.7k stars 1.05k forks source link

Option to disable exporter metrics #1046

Open muety opened 1 year ago

muety commented 1 year ago

I'd like to have an option to enable metrics such as go_memstats_alloc_bytes, etc. Analogously to https://github.com/prometheus/node_exporter/pull/1148.

SuperQ commented 1 year ago

I'm thinking we should start to integrate this into the exporter-toolkit.

dswarbrick commented 1 year ago

I'd like to have an option to enable metrics such as go_memstats_alloc_bytes, etc. Analogously to prometheus/node_exporter#1148.

Enable, or disable?

The metrics are present by default in blackbox_exporter:

# HELP go_memstats_alloc_bytes Number of bytes allocated and still in use.
# TYPE go_memstats_alloc_bytes gauge
go_memstats_alloc_bytes 483680

If you don't want the metrics, a workaround for now is to drop them in the scrape job, e.g.

  metric_relabel_configs:
  - source_labels: [__name__]
    regex: go_\S+
    action: drop
muety commented 1 year ago

Sorry, I meant disable of course. Thank for that! Didn't know about the exclude regex, very helpful! 👍

beorn7 commented 3 weeks ago

https://github.com/prometheus/exporter-toolkit/issues/119