ngsi-timeseries-api icon indicating copy to clipboard operation
ngsi-timeseries-api copied to clipboard

Update health endpoint

Open c0c0n3 opened this issue 4 years ago • 3 comments

Is your feature request related to a problem? Please describe.

As of PR #374 we've had a fully functional Timescale backend but the health check is hardcoded to work with Crate only. The health check should probably take into account Timescale too, since there may be cases where QL is configured to work with Timescale only.

Describe the solution you'd like

Update the health endpoint to check for Timescale too, if configured. We'll have to decide on a strategy here when two backends are used simultaneously, but one suggestion was, if my memory serves me well, to return a "yellow" state if one of the two is down. Whatever we eventually do, test_health should be updated accordingly.

Describe alternatives you've considered

Leave service health monitoring out of QL. There are plenty of solutions available to monitor services, send alerts, etc. so the services QL depends on (Crate, Timescale, Nominatim, Redis) can be monitored separately.

Additional context

See #374.

c0c0n3 avatar Oct 06 '20 08:10 c0c0n3

Stale issue message

github-actions[bot] avatar Mar 10 '21 02:03 github-actions[bot]

Hi @chicco785 @c0c0n3 I have checked for this issue, I found that code for health.py already include check for timescale db. PR #446 includes the changes where check for timescale db is included. As all the test cases passed after this code I believe the code is working fine for timescale db.

So, as per my understanding we can close this issue if we don't have any other requirement.

Please correct me if I have misunderstood the requirement or if we want any other changes to be considered through this issue.

pooja1pathak avatar Dec 01 '21 14:12 pooja1pathak

Hi @chicco785 @c0c0n3 I have checked for this issue, I found that code for health.py already include check for timescale db. PR #446 includes the changes where check for timescale db is included. As all the test cases passed after this code I believe the code is working fine for timescale db.

So, as per my understanding we can close this issue if we don't have any other requirement.

Please correct me if I have misunderstood the requirement or if we want any other changes to be considered through this issue.

hi @pooja1pathak, it is only partially tackled, ideally we should have a not critical check if a secondary db is also configured.

see note in the code https://github.com/orchestracities/ngsi-timeseries-api/blob/master/src/reporter/health.py#L91

chicco785 avatar Dec 15 '21 05:12 chicco785