feat(trace): Span::record_error: Emit exception.stacktrace#3570
Open
9999years wants to merge 1 commit into
Open
feat(trace): Span::record_error: Emit exception.stacktrace#35709999years wants to merge 1 commit into
exception.stacktrace#35709999years wants to merge 1 commit into
Conversation
|
|
cfc3967 to
7284792
Compare
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
cijothomas
reviewed
Jun 26, 2026
| /// | ||
| /// See: <https://opentelemetry.io/docs/specs/semconv/registry/attributes/exception/#exception-stacktrace> | ||
| /// | ||
| /// Error messages are output one per line, like this: |
Member
There was a problem hiding this comment.
that can't be really considered stack chain..
Author
There was a problem hiding this comment.
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.
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.
Changes
Rust's
std::error::Errors expose a chain of sources with theError::sourcemethod. Let's use those to emit anexception.stacktraceattribute in accordance with the OpenTelemetry Semantic Conventions.See: https://opentelemetry.io/docs/specs/semconv/registry/attributes/exception/#exception-stacktrace
Merge requirement checklist
CHANGELOG.mdfiles updated for non-trivial, user-facing changes