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

Change Span to refer to SpanStack, rather than TracingContext. #39

Merged
merged 5 commits into from Aug 2, 2022

Conversation

jmjoy
Copy link
Member

@jmjoy jmjoy commented Aug 2, 2022

In order to improve the performance of TracingContext, reduce the usage of Arc and Lock.

@jmjoy jmjoy added the enhancement New feature or request label Aug 2, 2022
@jmjoy jmjoy added this to the 0.4.0 milestone Aug 2, 2022
@jmjoy jmjoy requested a review from wu-sheng August 2, 2022 01:37
@jmjoy jmjoy self-assigned this Aug 2, 2022
@codecov-commenter
Copy link

codecov-commenter commented Aug 2, 2022

Codecov Report

Merging #39 (508b2c7) into master (27959a5) will increase coverage by 0.50%.
The diff coverage is 20.22%.

@@            Coverage Diff             @@
##           master      #39      +/-   ##
==========================================
+ Coverage   43.11%   43.62%   +0.50%     
==========================================
  Files          14       14              
  Lines         385      392       +7     
==========================================
+ Hits          166      171       +5     
- Misses        219      221       +2     
Impacted Files Coverage Δ
src/context/span.rs 0.00% <0.00%> (ø)
src/context/tracer.rs 57.29% <ø> (ø)
tests/trace_context.rs 0.00% <ø> (ø)
src/context/trace_context.rs 23.37% <25.35%> (+2.28%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us.

@jmjoy jmjoy marked this pull request as ready for review August 2, 2022 02:03
Comment on lines 88 to 89
span_stack: Arc<SpanStack>,
segment_link: Option<PropagationContext>,
Copy link
Member

Choose a reason for hiding this comment

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

Why is a segment link? Segment reference should be inside a span, and it should be multiple references.

Copy link
Member Author

Choose a reason for hiding this comment

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

This field existed before I was involved in this project. 😂

Copy link
Member

Choose a reason for hiding this comment

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

Let's check why it exists. and try to remove 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.

Ok, actually I also think this field is not very right.

@jmjoy
Copy link
Member Author

jmjoy commented Aug 2, 2022

Remove TracingContext segment_link field, and add TracingContext create_entry_span_with_propagation method.

@wu-sheng
Copy link
Member

wu-sheng commented Aug 2, 2022

TracingContext create_entry_span_with_propagation method.

This is good.

A tip, trace ID could be generated as a new trace, and then do Inject later to override the pre generated, when injecting context happens after span creation. This is not necessary, but we do this in Java.

Copy link
Member

@wu-sheng wu-sheng left a comment

Choose a reason for hiding this comment

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

LGTM. Feel free to merge, notice, please clear the commits in the merge message.

@jmjoy
Copy link
Member Author

jmjoy commented Aug 2, 2022

TracingContext create_entry_span_with_propagation method.

This is good.

A tip, trace ID could be generated as a new trace, and then do Inject later to override the pre generated, when injecting context happens after span creation. This is not necessary, but we do this in Java.

OK, I'll take a look later.

@jmjoy jmjoy merged commit fa8ba85 into apache:master Aug 2, 2022
@jmjoy jmjoy deleted the improve_tracing branch August 2, 2022 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
3 participants