pingdom-exporter icon indicating copy to clipboard operation
pingdom-exporter copied to clipboard

Introduce 'status' label into metrics

Open TheChef23 opened this issue 11 months ago • 1 comments

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: https://github.com/jusbrasil/pingdom-exporter/blob/24526d56c2c850f7dded150be73ecc107fa785c3/cmd/pingdom-exporter/main.go#L153-L159

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.

TheChef23 avatar Aug 02 '23 16:08 TheChef23