Joe
08/23/2024, 12:17 AMChris Guidry
08/23/2024, 2:40 PMprometheus_client
as a dependency of Prefect (both client and server), so you do have that available as an option. Running a metrics server for scraping is disabled by default, but the setting PREFECT_CLIENT_ENABLE_METRICS
turns it on and PREFECT_CLIENT_METRICS_PORT
sets the port for it (defaulting to 4201).
With that combo enabled, your flows would start a metrics server while they're running, which Prometheus can scrape. You'll get a combination of whatever metrics we emit from Prefect itself (currently just a few, but we want to grow that over time) as well as any metrics your flows emit.
You'll need a service discovery mechanism in place for Prometheus to identify where the flows are running, but if you're on Kubernetes using the Kubernetes Prefect worker, that should be relatively easy to set up with a PodMonitor
(https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#podmonitor)Joe
08/23/2024, 2:45 PMJoe
08/23/2024, 2:46 PMChris Guidry
08/23/2024, 2:47 PM<hostname>:4201/metrics
that Prometheus will scrape if it's configured to monitor that type of PodChris Guidry
08/23/2024, 2:47 PMChris Guidry
08/23/2024, 2:49 PMJoe
08/23/2024, 2:51 PMChris Guidry
08/23/2024, 2:51 PMNas Denkov
10/09/2024, 8:55 AMCRASHED
flow runs are not reported. Adding this would be extremely valuable to me, as I am rolling out Prefect in our company at the moment on on-premise infrastructure. Our alerting system integrates natively with Prometheus metrics.Chris Guidry
10/09/2024, 2:32 PM@chrisguidry
) on itChris Guidry
10/09/2024, 2:33 PMNas Denkov
10/10/2024, 7:24 AM