entur / lamassu

Mobility hub
European Union Public License 1.2
5 stars 7 forks source link

FeatureRequest: Metrics should report outdated feeds #341

Open hbruch opened 8 months ago

hbruch commented 8 months ago

Is your feature request related to a problem? Please describe. Currently, outdated feeds (lastUpdated + ttl is more than a few update cycles ago) are not reported via metrics.

Goal / high level use-case We'd to be able to issue monitoring alerts in case a feed has not been updated for a while.

Describe the solution you'd like Periodically, for every provider and feed, the feed should be checked if it's overdue or not and this metric registered with the metrics service.

Describe alternatives you've considered None

Additional context I'm working on a PR which adds a MetricsUpdater(I'm open for better naming suggestions) which every n seconds iterates over all cached feeds and registers the overdue metric (0 (not overdue) / 1 (overdue)). Another option might be the number of seconds overdue (lastUpdated+ ttl - now), which would allow triggering different actions depending on the number of seconds a feed is overdue...