[DO NOT MERGE - PLEASE REVIEW DESIGN] Feed Resource to Exporter#575
[DO NOT MERGE - PLEASE REVIEW DESIGN] Feed Resource to Exporter#575jsuereth wants to merge 4 commits into
Conversation
|
Should the "[WIP]" in the title be removed? |
|
@ThomsonTan I'll add more tests if we think this is the direction we want to go WRT to Resource, but I'd like to hear from the other contributors (and yourself) if you like what you see here first :) It has the caveat I mentioned and I want to make sure those are acceptable. |
|
@jsuereth Thanks for the design proposal. I can see the benefits arising from this proposal. Couple of points.
Are we going to loose this functionality with the approach.
|
Theoretically, a |
|
I'm torn about what approach to take.
I have a slight preference for (1). Some reasons for that:
|
|
@jsuereth this is exactly what folks did in OpenTelemetry .NET! 😄 @CodeBlanch made it happen with open-telemetry/opentelemetry-dotnet#1463. |
|
Not blocking this PR - I think we want to enforce the exporter and processor ownership - e.g. an exporter should be owned by one processor, and a processor should be owned by the provider (we probably need to discuss this in the spec SIG). Since both exporter and processor have @utpilla FYI since you're doing some investigation on OpenTelemetry .NET object lifecycle management. (cc @cijothomas) |
Thanks Reiley for providing .Net apporach. Proposal looks good to me with below assumptions:
And with below changes:
I can see performance benefit of this approach for languages which doesn't support references to shared data, and so |
|
For the scenario TracerProvider updates Resource after Span creation, if Resource is owned by TracerProvider which belongs to Span logically, this means Spans will always refer to last set Resource which seems different than the current spec requires. |
|
let me collate concerns and answer questions here:
SO next step proposals. I"m going to make several next step comments, please +1 to vote for your choice. |
|
Proposal #1: Finish the CL as-is
|
|
Proposal #2: Change Recordable to take a
Note: If i understand correctly THIS is what @lalitb suggests. I'll start working a PR for this, but just wanted to check sentiment against the other comments. |
|
#2 sounds good to me. |
Thanks @jsuereth for summarizing the discussions, and both the alternatives. Yes, I was suggesting close to approach #2, |
|
I'm taking 3 votes as sufficient. You can watch progress on #580 (or help :) ). |
[API] fix sign-conversion warnings in span & trace id (open-telemetry#3761)
This PR is for discussion purposes against #570. It represents one option for how we integrate Resource through the SDK.
Basic outline:
Exportthey must pass the associatedResourceor the default.Implications:
shared_ptrto a TracerProvider. I think we'd need to turn that into aunique_ptrto guarantee ownership rules around passingResource *downstream.Other Alternatives:
Resourcedownstream, we actually haveRecordableremember itsTracerat the time of creation (andTracerremember itsTracerProvider) which should give us access to bothInstrumentationLibraryandResource. This has the same limitation where we'd need to enforce lifecycles of Exporters (the owners of Recordable) and no longer allow sharing.Given the nuance and tracking information required from TracerProvider/Tracer for Resource/InstrumentationLibrary I actually think we should abandon the idea of sharing physical instances of Exporters/Processors and instead share configuration/setup (with duplicate classes) to keep this integration simple and easy to maintain.
Wanted to elicit feedback first:
@lalitb @pyohannes @maxgolov @ThomsonTan