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

Feat/traceroute #113

Merged
merged 21 commits into from
Mar 1, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
chore: add target to logger
niklastreml committed Feb 28, 2024
commit 7baa59da77f6e7794276132daa92c89d5fdbf47b
7 changes: 4 additions & 3 deletions pkg/checks/traceroute/traceroute.go
Original file line number Diff line number Diff line change
@@ -114,16 +114,17 @@ func (tr *Traceroute) check(ctx context.Context) map[string]result {
for _, t := range tr.config.Targets {
wg.Add(1)
go func(t Target) {
l := log.With("target", t.Addr)
defer wg.Done()
log.Debug("Running traceroute", "target", t.Addr)
l.Debug("Running traceroute")
start := time.Now()
tr, trerr := tr.traceroute(t.Addr, int(t.Port), int(tr.config.Timeout/time.Millisecond), tr.config.Retries, tr.config.MaxHops)
niklastreml marked this conversation as resolved.
Show resolved Hide resolved
duration := time.Since(start)
niklastreml marked this conversation as resolved.
Show resolved Hide resolved
if trerr != nil {
log.Error("Error running traceroute", "err", trerr, "target", t.Addr)
l.Error("Error running traceroute", "err", trerr)
}

log.Debug("Ran traceroute", "result", tr, "duration", duration)
l.Debug("Ran traceroute", "result", tr, "duration", duration)

r := result{
NumHops: len(tr.Hops),