Opentelemetry-java: Suggest changing the SPI classes to be "*Factory" rather than "*Provider"

Created on 13 May 2020  路  8Comments  路  Source: open-telemetry/opentelemetry-java

Having both a TraceProvider and a TracerProvider is very confusing. And, the documentation on TraceProvider actually is wrong and says that its name is TracerProvider. To eliminate this confusion, I recommend changing our SPI "provider" classes to be renamed to TracerProviderFactory and MeterProviderFactory so there is no confusion in the naming.

API Feature Request

Most helpful comment

*Impl

All 8 comments

For SPI it is very common to call these Providers, I do understand that this is confusing and I raised this issue when they decided in the specs to call the Tracer/Meter providers.

Just as a data point, the auto-instrumentation project currently uses the Factory naming pattern for exporter SPI. We should probably true-up between the two projects, since we're all on the same team. :)

What about TracerProviderProvider? 馃榿

IMHO it's not a big deal as TraceProvider lives in the spi sub-package, so you know what you are getting (although we should fix the inline docs). That being said, I'm not entirely opposed to rename these components to TraceProviderFactory/MeterProviderFactory ;)

We must get more "Java", what about TraceProviderFactoryBuilder? :)

*Impl

Jokes apart, I think using Factory for that may be good.

I'm guessing we should also change the CorrelationContextManagerProvider to be CorrelationContextManagerFactory as well?

Was this page helpful?
0 / 5 - 0 ratings