Repository navigation
Conversation
received_messages_spans, current_span_related_to_token and current_context_token are declared in the Boto3SQSInstrumentor class body, and _uninstrument never touched them. Every processing span whose message was not deleted stayed in the dictionary after instrumentation was turned off, and the context token that ContextableList.__getitem__ attached stayed attached, so a span started afterwards was parented to a retained span that is never exported. Detach the outstanding token and clear the three in _uninstrument. The tests already worked around this by resetting the three attributes by hand between cases. Refs open-telemetry#1704
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
received_messages_spans,current_span_related_to_tokenandcurrent_context_tokenare declaredin the
Boto3SQSInstrumentorclass body, and_uninstrumentnever touched them. Two consequences:is turned off.
ContextableList.__getitem__attached stays attached, so a span startedafter
uninstrument()is parented to a retained span that is never exported._uninstrumentnow detaches the outstanding token and clears the three attributes. The existingtests already worked around this by resetting those attributes by hand between cases
(
_reset_instrumentor).This covers the
uninstrumentpart of open-telemetry#1704. It does not address the main report in that issue,that entries accumulate while instrumentation is active because SQS issues a new receipt handle on
every receive, so the removal attempt in the
receive_messagewrapper never matches an earliercopy of the same message. That needs a decision on an eviction policy and belongs in its own
change.
Type of change
Checklist: