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

metrics not collected when server is down #19

Open
mentadev opened this issue Dec 19, 2023 · 1 comment
Open

metrics not collected when server is down #19

mentadev opened this issue Dec 19, 2023 · 1 comment

Comments

@mentadev
Copy link

mentadev commented Dec 19, 2023

  • build user: "ecastro"
  • build date: "2020-02-25T18:49:45Z"
  • go version: go1.13.8

When collecting data from a server, the iperf3_received_bytes & iperf3_received_seconds are stored in prometheus but if the server is stopped or goes down (or connectivity issues) these metrics are no longer stored in prometheus, only the "e.success" metric is stored with a 0 value.

The problem with this behaviour is that it creates gaps with no measure at all. I believe it would be better to include the
iperf3_received_bytes, iperf3_received_seconds both with 0 value.

if err != nil {
     ch <- prometheus.MustNewConstMetric(e.success, prometheus.GaugeValue, 0)
     ch <- prometheus.MustNewConstMetric(e.receivedSeconds, prometheus.GaugeValue, 0) //iperf3_received_bytes = 0
     ch <- prometheus.MustNewConstMetric(e.receivedBytes, prometheus.GaugeValue, 1)//iperf3_received_seconds = 1
     iperfErrors.Inc()
     log.Errorf("Failed to run iperf3: %s", err)
     return
}

Check the image attached, in red the resulting measure if the iperf3_received_bytes, iperf3_received_seconds are always stored
image

@Benedict1033
Copy link

Have you solved the problem? I have the same problem

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

No branches or pull requests

2 participants