Open dsnet opened 1 week ago
This would also be useful for alerting when a camera is offline. Right now I don't see a way from /api/stats
to see if a camera stream isn't working. If the frame count was available and weren't increasing that would be one way to know.
You can use camera_fps = 0 which is deliberately set if a camera goes offline. This is what the integration and webui already use
Hi, thank you for your hard work on Frigate.
The
/api/stats
API currently exposes fields like:In particular, fields like
camera_fps
(and related fields) report a metric that's a rate (some quantity per time). This is fundamentally hard to scrape since the consumer now needs to know the sampling rate at which this metric is updated. If the field is scraped too slowly, then the consumer may miss sudden dips or spikes in the rate.Instead of (or in addition to) reporting a rate, I propose that we provide a monotonically increasing counter. So instead of
camera_fps
, it would becamera_frames
, which is the total number of camera frames seen. If this data is being dumped intoprometheus
orinfluxdb
, it's trivial to take the derivative to produce a more accurate rate (one that cannot miss dips and peaks).