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

Ensure is_recording is false and all methods are no-ops after span ends #341

Merged

Conversation

morigs
Copy link
Contributor

@morigs morigs commented Nov 3, 2020

This PR is targeting to resolve #265. It moves span processing logic from SpanInner's drop to a separate method and calling it on end. This method takes ownership of inner.data.span_data so with_data always returns None.

is_recording checks inner.data and inner.data.span_data now and returns false if some of this options is None. Because of two nested options this check looks kind of ugly 😞

@morigs morigs requested a review from a team November 3, 2020 21:42
@codecov
Copy link

codecov bot commented Nov 3, 2020

Codecov Report

Merging #341 into master will increase coverage by 0.61%.
The diff coverage is 96.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #341      +/-   ##
==========================================
+ Coverage   53.40%   54.02%   +0.61%     
==========================================
  Files          71       71              
  Lines        5861     5879      +18     
==========================================
+ Hits         3130     3176      +46     
+ Misses       2731     2703      -28     
Impacted Files Coverage Δ
opentelemetry/src/sdk/trace/span.rs 84.75% <96.42%> (+11.64%) ⬆️

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 40b8909...c2a99ce. Read the comment docs.

Copy link
Member

@jtescher jtescher left a comment

Choose a reason for hiding this comment

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

Coming along well, few small comments

@morigs morigs requested a review from jtescher November 4, 2020 12:02
Copy link
Member

@jtescher jtescher 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, thanks @morigs

@jtescher jtescher merged commit ccf4599 into open-telemetry:master Nov 5, 2020
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.

Ensure is_recording is false after span ends
2 participants