hipages / php-fpm_exporter

A prometheus exporter for PHP-FPM.
Apache License 2.0
604 stars 123 forks source link

feature: should support option to disable go_collector mertics and disable phpfpm process metrics #83

Closed stanxing closed 4 years ago

stanxing commented 4 years ago

Sorry for writing a issue again...

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

...

The exporter expose phpfpm every process metrics in detail. But I think each container will produce very many processes a day. So even if this information is collected, it cannot be displayed in detail in the dashboard. I don't think these make sense. May be should have an option to disable to scrape process state. For example, this is my config for phpfpm pool:

pm = dynamic
pm.start_servers = 12
pm.max_children = 100
pm.process_idle_timeout = 10s
pm.min_spare_servers = 5
pm.max_spare_servers = 20

The number of processes will change automatically based on load. If keep this behavior, too many pid will be produced and collected.

estahn commented 4 years ago

@stanxing Can you please create 2 separate issues and I will respond individually.

stanxing commented 4 years ago

Should indeed, closing the issue...