-
Notifications
You must be signed in to change notification settings - Fork 438
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
Create SDK TRACE context, a shared reference to tracer pipelines between Tracer/TracerProvider. Update tests. #590
Conversation
Codecov Report
@@ Coverage Diff @@
## main #590 +/- ##
==========================================
- Coverage 94.40% 94.38% -0.02%
==========================================
Files 191 192 +1
Lines 9023 9036 +13
==========================================
+ Hits 8518 8529 +11
- Misses 505 507 +2
|
*/ | ||
const opentelemetry::sdk::resource::Resource &GetResource() const noexcept; | ||
|
||
void ForceFlushWithMicroseconds(uint64_t timeout) noexcept; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need a way to force-flush spans in some ephemeral compute environments. There's been SOME additions to the spec around ForceFlush. I think we need this to support that version of the spec.
…ce API in tests rather than recordable.
Does this mean in the case of multiple tracer providers there will be multiple span processors and thus multiple exporters, each processor having it's own queue to flush? In the case of nginx I'll most likely need several |
* | ||
* TODO(jsuereth): This method will be reworked once multi-processor span support is added. | ||
*/ | ||
std::unique_ptr<Recordable> ConsumeRecordable() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsuereth - This is something I am not able to understand. How will this method modified/replaced to get the correct Recordable to use from span object once we have multi-processor span support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for long delay. I'm ~60% through adding multi-processor support to show this (and prove it works). You're right I had to remove this method.
Have observed typical web-hosting companies creating tens of thousands of (dynamic/static) vhost configurations to be handled by single nginx/apache servers :) |
@seemk From a Additionally, regarding thread pool and resource constraints, I agree that batch-span-processor consuming a thread could be an issue. I think that's worth opening a bug against. We might need to adapt BatchProcessor to use some kind of shared-thread / event-queue model where you can limit # of threads used by the entire SDK. I don't think we should try to limit # of TracerProviders or force 1-batch-span-processor today as that's antithetical to some of the design ideas. I do agree current incarnation of BSP needs some work. Again apologies for my slow progress :) Looking forward to chatting over things more in our next SiG. I should have a working multi-processor implementation by then, and we can figure out where to go next, given current state + spec. |
There was some work done initially to support async-io using event-loop (#63) - not sure if we can use this to get rid of thread-model for batchprocessor. |
Thanks! Yeah, I wasn't sure myself how the virtual domain handling should happen inside nginx and whether creating multiple resources would be the way to go. I do like your idea of a single resource with custom attributes. In any case I guess the multiple threads won't be an issue for now 🙂 |
- Migrate SpanProcessor to use `ExportableSpan` - `ExportableSpan` has a registry of `Recordable`s denoated from processors - `ExportableSpan` replaces `Recordable` in `Span` implementation for now - Do some gymnastics around unique_ptr + ownership - Update SDK tests (exporters/ext tests still borked) - For now, `ExportableSpan` has shared ptr reference to originating Tracer. TBD on whether this stays.
It would be great to split this PR up, that would make reviewing much easier. Regarding the
I don't see many big benefits in having a separate |
@pyohannes I tried to take an approach just like that. In fact I even called it "MultiRecordable". TL;DR; OnStart broke it for me. Primary issue is you need to support these things:
#2 and #5 caused issues in MultiRecordable design so I went this direction. I've started fragmenting out the PR, so I'll send a multi-processor focused PR where we can hash out ideas. |
@jsuereth - Hope it is good to hold the review comment for this PR as you would be splitting this into separate PRs - TracerContext and multi-processor. Just want to be sure that you are not waiting for review comments here :) |
@lalitb No, I'm still splitting this up. Ran into some illness that ruined my whole week, should see something from me this weekend/early next week. |
Precursor to #502
Changes
TracerContext
for storingSampler
,Resource
andSpanProcessor
.Tracer
,TracerProvider
to use shared reference toTracerContext
Span
to no longer store two shared pointers to the same content (Tracer
+Processor
). InsteadSpan
now pullsProcessor
fromTracer
. This is preparation for pullingInsturmentationLibrary
TracerProvider
now uniquely owns aSpanProcessor
(to ensure appropriate lifecycle of flush/shutdown)zpages
extension to share data through a specific object + shared_ptr rather than directly sharing aSpanProcessor
instance.SpanProcessor
to take in asdk::trace::Span
reference instead ofRecordable
directly. Note:Span
already remembers theTracer
it came from, which (will) includeInstrumentationLibrary
andTracerContext