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

api: rename Span::record_exception to Span::record_error #756

Merged
merged 1 commit into from Mar 13, 2022

Conversation

jtescher
Copy link
Member

This change aligns the error recording methods with Rust's naming conventions which prefer the term Error over Exception.

This also removes Span::record_exception_with_stacktrace as Rust's backtrace functionality is not yet stable. Users who wish to record this data can use Span::add_event directly.

This change aligns the error recording methods with Rust's naming
conventions which prefer the term `Error` over `Exception`.

This also removes `Span::record_exception_with_stacktrace` as Rust's
backtrace functionality is not yet stable. Users who wish to record
this data can use `Span::add_event` directly.
@jtescher jtescher requested a review from a team as a code owner March 12, 2022 17:54
@codecov
Copy link

codecov bot commented Mar 12, 2022

Codecov Report

Merging #756 (adb15ce) into main (027c1f8) will decrease coverage by 0.04%.
The diff coverage is 77.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #756      +/-   ##
==========================================
- Coverage   70.22%   70.18%   -0.05%     
==========================================
  Files         108      108              
  Lines        8804     8783      -21     
==========================================
- Hits         6183     6164      -19     
+ Misses       2621     2619       -2     
Impacted Files Coverage Δ
opentelemetry-api/src/trace/context.rs 49.05% <0.00%> (ø)
opentelemetry-api/src/trace/span.rs 80.95% <100.00%> (-3.67%) ⬇️
opentelemetry-sdk/src/trace/span.rs 93.65% <100.00%> (-0.01%) ⬇️
opentelemetry-sdk/src/metrics/controllers/push.rs 83.33% <0.00%> (+3.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 027c1f8...adb15ce. Read the comment docs.

self.with_inner_mut(|inner| inner.record_exception_with_stacktrace(err, stacktrace))
/// Record an error as an event for this span.
///
/// An additional call to [Span::set_status] is required if the status of the
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of calling this out in the docs, why don't we just fix it?

Copy link
Member Author

Choose a reason for hiding this comment

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

It appears they are intended to be able to be called independently, I'd guess to support recording errors that are caught or otherwise not resulting in an error state for the trace. See the Java impl and the go impl.

@jtescher jtescher merged commit 7c4545a into open-telemetry:main Mar 13, 2022
@jtescher jtescher deleted the update-record-error branch March 13, 2022 00:29
vibhavp pushed a commit to vibhavp/opentelemetry-rust that referenced this pull request Mar 14, 2022
…lemetry#756)

This change aligns the error recording methods with Rust's naming
conventions which prefer the term `Error` over `Exception`.

This also removes `Span::record_exception_with_stacktrace` as Rust's
backtrace functionality is not yet stable. Users who wish to record
this data can use `Span::add_event` directly.
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.

None yet

2 participants