hipages / php-fpm_exporter

A prometheus exporter for PHP-FPM.
Apache License 2.0
587 stars 117 forks source link

Custom labels #296

Open SrDayne opened 1 year ago

SrDayne commented 1 year ago

Is there a way to pass environmental variables as custom labels of metrics?

How metric looks now: php_fpm_up{instance="example", socket_path="example"} 1

How I expect it to see: php_fpm_up{instance="example", socket_path="example", custom_label_1="example_1",custom_label_2="example_2"} 1, where custom labels passed as env vars, like: custom_label_1=$env_var_1, custom_label_2=$env_var_2

For reference, see: https://github.com/nginxinc/nginx-prometheus-exporter, command line argument -prometheus.const-labels value