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

Fix: allow probers to provide a duration value #898

Merged
merged 1 commit into from
Sep 19, 2024
Merged

Conversation

mem
Copy link
Contributor

@mem mem commented Sep 19, 2024

Some probers need to override the duration that is reported, mostly because we use probe_duration_seconds as the "latency" of the probe, which isn't exactly correct. probe_duration_seconds was meant to be used as the duration of the probe: how long did it take for this probe to run. Capture that value in the logs for debugging purposes, and use probe_duration_seconds as if it meant the time it takes the target to produce a response, including some setup, but not e.g. the overhead introduced by retries or the time it takes for external programs to spin up.

This is OK to change since these are all internal packages.

Some probers need to override the duration that is reported, mostly
because we use probe_duration_seconds as the "latency" of the probe,
which isn't exactly correct. `probe_duration_seconds` was meant to be
used as the duration of the probe: how long did it take for this probe
to run. Capture that value in the logs for debugging purposes, and use
`probe_duration_seconds` as if it meant the time it takes the target to
produce a response, including *some* setup, but not e.g. the overhead
introduced by retries or the time it takes for external programs to spin
up.

This is OK to change since these are all internal packages.

Signed-off-by: Marcelo E. Magallon <[email protected]>
@mem mem requested a review from a team as a code owner September 19, 2024 23:27
@mem
Copy link
Contributor Author

mem commented Sep 19, 2024

This is the second time I have needed this functionality. The first time I didn't want the big noisy change, so I hacked around it.

For the second time around, I think it's better to do it right.

This will benefit all k6-based checks, too. Maybe traceroute, too?

@@ -90,7 +91,9 @@ func probeICMP(ctx context.Context, target string, module Module, registry *prom

pinger.OnSetup = func() {
if !setupDone {
durationGaugeVec.WithLabelValues("setup").Add(time.Since(setupStart).Seconds())
setupDuration := time.Since(setupStart).Seconds()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the actual change I need. :-P

@mem mem merged commit 8cbd28a into main Sep 19, 2024
2 checks passed
@mem mem deleted the mem/add-icmp-retries branch September 19, 2024 23:29
mem added a commit that referenced this pull request Sep 19, 2024
* Feature: add retries to ICMP prober (#896)
* Fix: allow probers to provide a duration value (#898)

Signed-off-by: Marcelo E. Magallon <[email protected]>
@mem mem mentioned this pull request Sep 19, 2024
mem added a commit that referenced this pull request Sep 19, 2024
* Feature: add retries to ICMP prober (#896)
* Fix: allow probers to provide a duration value (#898)

Signed-off-by: Marcelo E. Magallon <[email protected]>
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.

1 participant