-
Notifications
You must be signed in to change notification settings - Fork 975
Change Processor and Exporter interface to pass resource #508
Copy link
Copy link
Open
Labels
area:sdkRelated to the SDKRelated to the SDKrelease:after-gaNot required before GA release, and not going to work on before GANot required before GA release, and not going to work on before GAspec:resourceRelated to the specification/resource directoryRelated to the specification/resource directoryspec:traceRelated to the specification/trace directoryRelated to the specification/trace directory
Metadata
Metadata
Assignees
Labels
area:sdkRelated to the SDKRelated to the SDKrelease:after-gaNot required before GA release, and not going to work on before GANot required before GA release, and not going to work on before GAspec:resourceRelated to the specification/resource directoryRelated to the specification/resource directoryspec:traceRelated to the specification/trace directoryRelated to the specification/trace directory
In current resources specification, resource is associated with a Trace Provider. Semantically, that makes sense as well. However, there is problem retrieving resource in a SpanProcessor. SpanProcessor has no reference to TraceProvider to which it is registered. The problem is only in async path.
In Go (and most likely other languages as well), when span ends, the data flow is as follows.
Sync Path: Tracer (ctx1) -->Simple Span Processor (ctx1, SpanData) --> Exporter (ctx1, SpanData).
Async Path: Tracer (ctx1)-->Batched Span Processor (ctx1, SpanData) --> Exporter (ctx2, []SpanData)
In sync path, there are no issues. Resources can be added to SpanData and Exporter can send the resource to its backend after remapping the resource if necessary.
In async path, however, it is not efficient to duplicate the same resource with all the SpanData. After all we have common resource for a batch of spans in proto for a reason. How do we achieve the efficiency?
Alternatively,