Introduce 'status' label into metrics #13
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Pingdom API has a 'status' property, enabling visibility of the current status of a check. This could include statuses such as "up", "down", "unconfirmed_down", "unknown", "paused".
We encountered a problem with the metrics wherein a check, after being paused, would transition to 'unknown' status. Because this status does not explicitly indicate that the check is 'up', the 'pingdom_uptime_status' metrics would return a 0 value, without any possibility to discern the specific reason for this value.
Please see this snippet of code for a deeper understanding:
pingdom-exporter/cmd/pingdom-exporter/main.go
Lines 153 to 159 in 24526d5
In response, this Pull Request (PR) introduces a 'status' label into the following metrics:
As this label mirrors the value from the Pingdom API, it equips us with the ability to further filter out checks in the 'unconfirmed_down' or 'unknown' states, which would otherwise return a 0 value, without affecting the default behavior of existing implementations.