Skip to content

Conversation

@jamala0309
Copy link

Declaring and registering the probeFailedDueToRegex gauge.

Passing it into validRRs and setting it to 1 whenever a regex validation fails.

Signed-off-by: jamala0309 <[email protected]>
Name: "probe_dns_query_succeeded",
Help: "Displays whether or not the query was executed successfully",
})
// NEW METRIC
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// NEW METRIC

Comment on lines -266 to -269
// The rtt value returned from client.Exchange includes only the time to
// exchange messages with the server _after_ the connection is created.
// We compute the connection time as the total time for the operation
// minus the time for the actual request rtt.
Copy link
Member

Choose a reason for hiding this comment

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

Why are you removing existing comments?

Comment on lines +36 to +38
) bool {
// reset metric at the start of each validation
probeFailedDueToRegex.Set(0)
Copy link
Member

Choose a reason for hiding this comment

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

This would be a lot less fragile as a defer.

Something like:

Suggested change
) bool {
// reset metric at the start of each validation
probeFailedDueToRegex.Set(0)
) (valid bool) {
defer func() {
if valid {
probeFailedDueToRegex.Set(0)
} else {
probeFailedDueToRegex.Set(1)
}
}()

@github-actions github-actions bot added the stale label Jan 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants