fix: stop double recording exceptions on spans#1069
Closed
robertlaurin wants to merge 1 commit into
Closed
Conversation
petergoldstein
added a commit
that referenced
this pull request
Feb 5, 2026
OpenTelemetry's in_span method already records exceptions and sets error status, so Dalli's explicit recording was redundant and caused duplicate exception events. Also applied rubocop fixes and removed tests that were testing OpenTelemetry's internal behavior rather than Dalli's code. Co-Authored-By: Robert Laurin <robert.laurin@shopify.com> Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
petergoldstein
added a commit
that referenced
this pull request
Feb 5, 2026
3 tasks
Owner
|
Thanks @robertlaurin . Cherry picked into 4.3.1 |
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.
The in_span method already records exceptions. So the explicit recording of exceptions here could result in doubling the exception event count.
On a high volume traced service an error with memcached could result in a lot of stacktraces, doubling them can compound the issue.
Lightly formatted the output
The tests are currently mocking out OpenTelemetry entirely which means they would not catch this issue. Is it ok to bring in Otel as a test dependency, if so then I can add some proper regression tests here, or we can just remove the tests that assert the recording of exceptions as its a feature of the otel library itself and doesn't really need to be retested.