hipages / php-fpm_exporter

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

Maybe it can support prometheus pushgateway #153

Open lazychanger opened 3 years ago

lazychanger commented 3 years ago

Maybe it can support prometheus pushgateway

estahn commented 3 years ago

@lazychanger Can you provide more details on this?

lazychanger commented 3 years ago

Yes. look hear https://github.com/prometheus/pushgateway

Prometheus does not work well in a cluster environment, because the IP address of the host will change at any time. Prometheus Pushgateway can receive the client's actively reported metrics and then wait for prometheus to collect

I'am sorry for my english is not good, some from Google Translate.

lazychanger commented 3 years ago

Prometheus PushGateway document AND go document

lazychanger commented 3 years ago

Prometheus PushGateway document

The Pushgateway is an intermediary service which allows you to push metrics from jobs which cannot be scraped. 
estahn commented 3 years ago

I'm aware of PushGateway. We're using PushGateway for short-lived jobs, such as CronJobs as the scrape interval is too short for Prometheus to gather metrics.

Prometheus does not work well in a cluster environment, because the IP address of the host will change at any time.

We have been operating Prometheus in a Kubernetes cluster with php-fpm_exporter for over 4 years. Prometheus is designed to deal with conditions within a cluster environment, e.g. aggregates such as rate.

If Prometheus is not able to scrape php-fpm_exporter I would assume there is some issue with your config, e.g. scrape interval too high.

I'm still not sure I understand the reason for the feature request.

lazychanger commented 3 years ago

I'm sorry I misrepresented what I meant.

Prometheus needs to actively configure the client metrics address, but if my pod is scaled up, the new node cannot be collected because it is not in the Prometheus targets.

I think I understand what you mean. The new scaling node is temporary, it will not exist for a long time so that it will not form effective metrics

thank you for your reply.

estahn commented 3 years ago

You want to look at Prometheus service discovery, or discovery of scrape targets. See https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config

I haven't looked at this for quite a while. We are using Prometheus-operator which comes with CRDs such as ServiceMonitor, abstracting the configuration away.

Hope this helps.

lazychanger commented 3 years ago

Thank you, I will read this document carefully

stale[bot] commented 2 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.