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

Ignore network read timeout errors #115

Merged
merged 2 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
* [ENHANCEMENT]
* [BUGFIX]

## 0.7.1 / 2023-06-12
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, one comment I just noticed.
The date of the changelog entry is wrong, should be 2023-07-12.

And thanks for releasing a fix so quickly!


* [BUGFIX] Ignore network read timeout errors #115

## 0.7.0 / 2023-07-10

* [FEATURE] Make source ip configurable #83
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.0
0.7.1
8 changes: 8 additions & 0 deletions collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
package main

import (
"net"

"github.com/prometheus-community/pro-bing"

"github.com/go-kit/log/level"
Expand Down Expand Up @@ -110,6 +112,12 @@ func NewSmokepingCollector(pingers *[]*probing.Pinger, pingResponseSeconds prome
stats.AvgRtt, "max_rtt", stats.MaxRtt, "stddev_rtt", stats.StdDevRtt)
}
pinger.OnRecvError = func(err error) {
if neterr, ok := err.(*net.OpError); ok {
if neterr.Timeout() {
// Ignore read timeout errors, these are handled by the pinger.
return
}
}
pingRecvErrors.Inc()
level.Debug(logger).Log("msg", "Error receiving packet", "error", err)
}
Expand Down