Skip to content

feat(trace): Span::record_error: Emit exception.stacktrace#3570

Open
9999years wants to merge 1 commit into
open-telemetry:mainfrom
9999years:wiggles/olqp
Open

feat(trace): Span::record_error: Emit exception.stacktrace#3570
9999years wants to merge 1 commit into
open-telemetry:mainfrom
9999years:wiggles/olqp

Conversation

@9999years

@9999years 9999years commented Jun 25, 2026

Copy link
Copy Markdown

Changes

Rust's std::error::Errors expose a chain of sources with the Error::source method. Let's use those to emit an exception.stacktrace attribute in accordance with the OpenTelemetry Semantic Conventions.

See: https://opentelemetry.io/docs/specs/semconv/registry/attributes/exception/#exception-stacktrace

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 25, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: 9999years / name: Rebecca Turner (bce40d9)

@9999years 9999years force-pushed the wiggles/olqp branch 2 times, most recently from cfc3967 to 7284792 Compare June 25, 2026 19:12
Rust's `std::error::Error`s expose a chain of sources with the
`Error::source` method. Let's use those to emit an
`exception.stacktrace` attribute in accordance with the OpenTelemetry
Semantic Conventions.

See: <https://opentelemetry.io/docs/specs/semconv/registry/attributes/exception/#exception-stacktrace>
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.1%. Comparing base (10dde18) to head (bce40d9).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #3570   +/-   ##
=====================================
  Coverage   83.0%   83.1%           
=====================================
  Files        130     130           
  Lines      27993   28077   +84     
=====================================
+ Hits       23250   23334   +84     
  Misses      4743    4743           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@9999years 9999years marked this pull request as ready for review June 25, 2026 21:51
@9999years 9999years requested a review from a team as a code owner June 25, 2026 21:51
///
/// See: <https://opentelemetry.io/docs/specs/semconv/registry/attributes/exception/#exception-stacktrace>
///
/// Error messages are output one per line, like this:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

that can't be really considered stack chain..

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Do you mean that it's not a stack trace because it doesn't have line numbers? I agree. Do you think we should try to extract a backtrace? I'm not sure if we could get one reliably from an arbitrary Error value, though.

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