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

Remove streams from B3Propagator #5326

Merged
merged 1 commit into from
Mar 29, 2023

Conversation

BrentDouglas
Copy link
Contributor

They are expensive in this context

They are expensive in this context
@BrentDouglas BrentDouglas requested a review from a team March 24, 2023 06:36
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 24, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: BrentDouglas / name: Brent Douglas (fba3b67)

@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (c769d53) 91.01% compared to head (fba3b67) 91.01%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #5326   +/-   ##
=========================================
  Coverage     91.01%   91.01%           
+ Complexity     4902     4900    -2     
=========================================
  Files           551      551           
  Lines         14487    14482    -5     
  Branches       1369     1370    +1     
=========================================
- Hits          13185    13181    -4     
  Misses          905      905           
+ Partials        397      396    -1     
Impacted Files Coverage Δ
...etry/extension/trace/propagation/B3Propagator.java 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@jkwatson jkwatson left a comment

Choose a reason for hiding this comment

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

Thanks! We don't have benchmarks on this, but even if it's not less expensive, it's definitely clearer this way.

if (ctx.isPresent()) {
return ctx.get();
}
return multipleHeadersExtractor.extract(context, carrier, getter).orElse(context);
Copy link
Member

Choose a reason for hiding this comment

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

An example when streams result in worse readability and worse performance!

@jack-berg jack-berg merged commit aad95f8 into open-telemetry:main Mar 29, 2023
@BrentDouglas BrentDouglas deleted the no-stream branch March 30, 2023 13:51
@BrentDouglas
Copy link
Contributor Author

Thanks guys. In the context I was looking at this we were pulling a header from some AMQP headers. This stream call accounted for 97% of the extract call, and ~25% of the whole consumer. I actually think this library is not really targeted at the type of application that was being instrumented in this case and it may not survive there, but removing that stream seems an easy win.

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.

4 participants