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.
This is a proposed refactoring of the distro mechanism. This PR is being opened so that the general approach can be reviewed, formal tests are still pending.
It implements solution B.
I found a few issues with the current distro mechanism:
Distro
s andConfigurator
s. Both perform configuration.Distro
to be installed foropentelemtetry-instrumentation
to work. I disagree with this becauseopentelemetry-instrumentation
is something that is (at least partially) defined in the spec,Distro
is not.opentelemetry-instrumentation
is directly coupled withDistro
.Distro
is a configuration mechanism that may not be preferred by the end user who may prefer to configure instead with a configuration file or a bash script, etc.To solve these issues, this PR does the following, respectively:
Configurator
to have the most representative name, so this PR removesDistro
and refactorsConfigurator
.Configurator
is no longer required foropentelemetry-instrumentation
to work.opentelemetry-instrumentation
now provides 2 entry points, one for plugins that are called before instrumentation and other for plugins that are called after instrumentation.Configurator
is decoupled fromopentelemetry-instrumentation
by making it a plugin that is called before instrumentation.opentelemetry-configurator
provides an entry point by itself. In this way severalConfigurator
s can be registered and several can be called in the order defined by the environment variableOTEL_PYTHON_CONFIGURATORS
if there is more than oneConfigurator
installed.Configurator
s are classes. This approach makes it possible to share common configuration by just inheriting from another one and callingsuper
.