mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 15:05:49 +03:00
[GH-ISSUE #345] API: Return Check status as an integer #262
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#262
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jameskirsop on GitHub (Mar 23, 2020).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/345
As part of my work in building a Grafana integration, I've been working towards adding a linear integer representation of the
check.get_status()result in addition to the text value. Having a linear scale is important for being able to appropriately colour the panel in Grafana.Currently, I've built the following
dictfor pairing statuses on a linear scale:Do the integers I've chosen seem a logical representation - both in the pairing of paused/new, and their order along the scale? 0 being the most problematic and severity inversely decreasing as the numbers get higher.
This work is found on a branch which I'll issue a PR for if we can agree on the order!
@jameskirsop commented on GitHub (Apr 14, 2020):
@cuu508, do you have thoughts on this scale/order of status?
@cuu508 commented on GitHub (Apr 14, 2020):
The order looks logical.
I have a concern that this would be a fairly "niche" field, it would be sent in all API responses but potentially only be used in the Grafana datasource.
Would it not be possible to add the status_int field on the datasource side? Or are there problems with doing that?
@jameskirsop commented on GitHub (May 26, 2020):
Sorry to leave this hanging for so long. I agree @cuu508 that it would be a pretty niche field, but I think having an integer scale would be of usefulness to other third-party data visualisation products, not just Grafana.
My current understanding of how Grafana works (at least in my current implementation based off their sample project) is that it takes the results from the 'source' API and presents those to the end user.
There may be ways of transforming these strings to integers on the datasource plugin's backend, but I've not yet worked out how that's possible - if it is.
It's possible to do this on a per-panel basis, but this would be a real pain for end users - as they'd have to do this every time they add a panel (or clone an existing one...).