Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce 'status' label into metrics #13

Merged
merged 2 commits into from
May 7, 2024

Conversation

jochbru
Copy link
Contributor

@jochbru jochbru commented Aug 2, 2023

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:

var status float64
paused := "false"
if check.Status == "paused" {
paused = "true"
} else if check.Status == "up" {
status = 1
}

In response, this Pull Request (PR) introduces a 'status' label into the following metrics:

  • pingdom_uptime_status
  • pingdom_uptime_response_time_seconds

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.

…response_time_seconds to reflect other status from pingdom API
@jochbru
Copy link
Contributor Author

jochbru commented Aug 11, 2023

@danielfm did you have a chance to review this PR?

@danielfm
Copy link
Collaborator

danielfm commented May 5, 2024

This is a good contribution, thanks. Sorry for the delay.

@danielfm danielfm self-assigned this May 5, 2024
@danielfm danielfm merged commit eefd2cc into jusbrasil:master May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants