blackbox_exporter icon indicating copy to clipboard operation
blackbox_exporter copied to clipboard

Option to disable exporter metrics

Open muety opened this issue 2 years ago • 4 comments

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.

muety avatar Mar 22 '23 13:03 muety

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

SuperQ avatar Mar 22 '23 13:03 SuperQ

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

dswarbrick avatar Apr 02 '23 16:04 dswarbrick

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

muety avatar Apr 02 '23 16:04 muety