hipages / php-fpm_exporter

A prometheus exporter for PHP-FPM.
Apache License 2.0
592 stars 119 forks source link

feature: add option to control whether scraping go_collector mertics is disabled #84

Closed stanxing closed 4 years ago

stanxing commented 4 years ago

When I run the program and visit /metrics, I found they includes many go_collector metrics. This has nothing to do with php_fpm and can not be disabled. Mybe someone think it is helpful to debug exporter self. But I feel they are noise and take up a lot of space. So may be should have a flag to control whether this behavior is enabled.

➜ curl http://localhost:9253/metrics                   
# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.
# TYPE go_gc_duration_seconds summary
go_gc_duration_seconds{quantile="0"} 0
go_gc_duration_seconds{quantile="0.25"} 0
go_gc_duration_seconds{quantile="0.5"} 0
go_gc_duration_seconds{quantile="0.75"} 0
go_gc_duration_seconds{quantile="1"} 0
go_gc_duration_seconds_sum 0
go_gc_duration_seconds_count 0
# HELP go_goroutines Number of goroutines that currently exist.
# TYPE go_goroutines gauge

...
estahn commented 4 years ago

After some research, there seems to be a consensus that this is useful. I would accept a PR for this.

I suggest naming the parameter web.disable-exporter-metrics to keep the same standard used in node-exporter.

                disableExporterMetrics = kingpin.Flag(
                        "web.disable-exporter-metrics",
                        "Exclude metrics about the exporter itself (promhttp_*, process_*, go_*).",
                ).Bool()

References:

stanxing commented 4 years ago

@estahn PR linked

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

mingalevme commented 3 years ago

@estahn Why PR hasn't been merged?

mingalevme commented 3 years ago

If someone needs the original repo with the PR:

https://gist.github.com/mingalevme/28642bf1160a760f024d5155259d32a4