Registry Mirror
Skip to content

Conversation

@git286

Copy link
Copy Markdown
Collaborator

The requests counter was recorded through context.WithoutCancel with a comment saying a cancelled lookup would otherwise not be reported. That is not how the SDK works. Add never checks ctx.Err(), and the only thing it reads from the context is the span, for exemplars. This passes the request context as it is and fixes the comment.

No behavior change. The existing cancelled-lookup test in metrics_test.go still passes.

Came out of the review on #1553, where the metrics guide repeated the same wrong reason.

The counter was recorded through context.WithoutCancel with a comment
implying the SDK would otherwise drop a cancelled lookup's measurement. It
would not: Add never checks the context's error, and the only thing it reads
from the context is the span, for exemplars. Pass the request context
directly and say so, so the next reader does not carry the wrong idea into a
new instrument. The existing cancelled-lookup test covers the behavior.
@bowei Bowei Du (bowei) added kind/cleanup Small fixes that are not bugs, for example a typo in a code comment area/observability area/storage labels Sep 17, 2026
@EItanya

Copy link
Copy Markdown
Collaborator

This PR has been closed due to inactivity. If you believe this to be a mistake feel free to re-open with a comment explaining why this PR is still relevant and a maintainer will revisit it, thanks so much

Comment left by Claude on behalf of Eitan Yarmush (@EItanya).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/observability area/storage kind/cleanup Small fixes that are not bugs, for example a typo in a code comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants