refactor(sdk-trace-base): make resource private and remove getActiveSpanProcessor API #5192
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Which problem is this PR solving?
Resource and active span processor should not be accessible once the tracer provider is constructed. This PR makes the necessary changes to have both as private properties and inject them into any tracer created via
getTracer
API.Fixes #4791
Fixes #4792
Short description of the changes
resource
private inBasicTracerProvider
getActiveSpanProcessor
inBasicTracerProvider
SpanImpl
constructorTracer.startSpan
to use the new constructorTracer
constructor to get only necessary deps (processor & resource) instead of the providerChanges in
SpanImpl
constructorI've decided to change the constructor method signature for
SpanImpl
. This way we inject the necessary dependencies that are held in theTracer
class making unnecessary to have public properties or getters for span processor and resource. The class was made private (not exported) in #5048Type of change
How Has This Been Tested?
Checklist: