Add Prefect2 exporter to list of miscellaneous exporters
Please add this new exporter to exporter list. Please let me know if something missing, thanks.
Sample output:
# HELP prefect2_flows_runs_24h Prefect2 flows for 24h
# TYPE prefect2_flows_runs_24h gauge
prefect2_flows_runs_24h{state="FAILED"} 12.0
prefect2_flows_runs_24h{state="CANCELLED"} 0.0
prefect2_flows_runs_24h{state="CRASHED"} 0.0
@pathfinder177 Thanks! When it comes to counting things (the number of runs here), in Prometheus it's more common to use a continuous counter metric rather than exposing a precomputed rate (over 1h + 24h). But not sure if that might be challenging in your case if you have to define a start timestamp for the counter once, and then query over longer and longer time ranges, since there's no counter you can directly bridge, right?
@pathfinder177 Ping! :)
@pathfinder177 Ping! :)
Hi Julius! Sorry for delay, pls close the PR, I can reopen it. Only March 12th I can start to implement changes
Oh we can just leave this open until later, no worries!
@juliusv Hi! I got the point about continuous counter and agree. However there is indeed a requirement to measure such a metric for 1h and for 24h. Why? Because prefect2 is a scheduler for "jobs" and we would like to track jobs across time periods to compare it.
If there are some improvements ideas I am very glad to improve the exporter and now I would like to merge it if you do not mind
@pathfinder177 Happy to merge it for now!
However, the way to track how many events per time period have happened in Prometheus is to just expose a raw counter that always increases, and then you can still do increase(foo[24h]) or increase(foo[1h]) over it as needed.