Description
Today, the main tracer implementation accept a source argument during initialization which refers to the tracer provider instance. The tracer then stores a reference to the source (tracer provider) and uses it to access a number of different things such as sampler, resource, span processor and soon ID generator. This implicitly couples SDK tracer and tracer provider implementations. Anyone implementing a custom tracer provider must satisfy such undocumented tracer provider interface/behavior.
I propose we make all tracer dependencies explicitly to the tracer during initialization. Each dependency can be it's own argument to Tracer.__init__
or we can bundle up all such dependencies into a single object and pass that in. This will de-couple tracer and tracer provider and allow users to implement one or the other without any surprises.
discussion: #1153 (comment)