jamespfennell / transiter

Web service for transit data
https://demo.transiter.dev
MIT License
59 stars 7 forks source link

Calculate and expose the "health" of a feed #55

Closed jamespfennell closed 1 year ago

jamespfennell commented 4 years ago

Having the API tell whether a feed is healthy or not would be really beneficial. Consumers of Transiter could rely this information to their users so that their users can make informed decisions about the data. Also, if relevant, consumers could notify the source of data that's something wrong.

The "health" may be composed of multiple metrics. Example metrics that seem reasonable:

jamespfennell commented 4 years ago

seconds_since_update num_updates_last_hour

jamespfennell commented 3 years ago
"last_successful_update": {},  // or null
"windows": [
    {
        "start_time": 123,
        "end_time": 123,
        "count": 45,
        "outcomes": [{
            "status": "SUCCESS",
            "result": "UPDATED",
            "count": 40,
        }],
        "update_periodicity": 15,  // or null if not two updates. Handle the case when two updates way in the past
    }
]
jamespfennell commented 3 years ago

Added statistics as in previous comment.

Other nice to haves:

jamespfennell commented 1 year ago

This ticket was created before I knew about monitoring best practices (i.e., using something like Prometheus).

Transiter now has Prometheus metrics for API latency and feed update latency. I think we should add the following metrics:

Then we can close this issue.