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

Default to internal_error rather than unknown_error #2473

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cyberdelia
Copy link

@cyberdelia cyberdelia commented Nov 23, 2024

When using sentry-opentelemetry to trace code that isn't related to an HTTP call, the SpanProcessor will set the status of a Transaction to be "unknown_error", which is benign, but within Sentry UI this status is not interpreted as an error at all.

The result is that all the impacted transactions appears to have 0% failure rate, etc. Changing it to "internal_error" prevents this, and also is in line with other sentry SDKs behaviour.

Sidebar: The SpanEvent metadata around exceptions seems to be dropped in the conversion process to Transaction , which is too bad.

Copy link
Collaborator

@solnic solnic left a comment

Choose a reason for hiding this comment

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

This makes sense, thanks. Could you also add a simple spec that covers this change to span_processor_spec.rb?

Copy link

codecov bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.17%. Comparing base (a9b3687) to head (26e5605).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2473   +/-   ##
=======================================
  Coverage   98.17%   98.17%           
=======================================
  Files         128      128           
  Lines        4825     4829    +4     
=======================================
+ Hits         4737     4741    +4     
  Misses         88       88           
Components Coverage Δ
sentry-ruby 98.57% <ø> (+<0.01%) ⬆️
sentry-rails 97.08% <ø> (ø)
sentry-sidekiq 96.96% <ø> (ø)
sentry-resque 92.85% <ø> (ø)
sentry-delayed_job 95.65% <ø> (ø)
sentry-opentelemetry 99.31% <100.00%> (ø)
Files with missing lines Coverage Δ
...lemetry/lib/sentry/opentelemetry/span_processor.rb 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@cyberdelia
Copy link
Author

cyberdelia commented Nov 28, 2024

@solnic Done. The new spec cover all type of errors handled by update_span_status, since it was not tested before.

@solnic solnic self-requested a review December 5, 2024 20:00
Copy link
Collaborator

@solnic solnic left a comment

Choose a reason for hiding this comment

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

Looks good, thank you! Please update the top-level CHANGELOG.md too, and I'll be able to merge it in 🙂

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.

2 participants