NH-12018 oboe Reporter init moved to Configurator #17
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 update moves oboe
Reporter()
from the SW Exporter to the SW Configurator so thatoboe_init
is called at custom-distro setup when using the SW Exporter or with a different exporter set byOTEL_TRACES_EXPORTER
env var. There doesn't seem to be any other way to triggeroboe_init
in the SWIG'doboe_api
, which makes sense as it looks like the only responsibilities ofReporter()
are to assemble options then use them tooboe_init
.This also reverts a change made in #14 so that instead of
load_entry_point
for a non-SW exporter, we go back to:I've done this because in my mind it's the cleanest way for custom-distro to find something like
otlp_proto_grpc
in the Python Distribution at runtime. It's too brittle to map requireddist
names forload_entry_point
, and it's too complex and a waste to implement a search throughsys.path
wheniter_entry_points
already does it. Even though there is a small chance a customer might have multiples of the sameenviron_exporter_name
in their path (see this comment), generally speaking that's for them to make sure is correct. Also, theiter_entry_points
approach is used all over OTel Python and it's cleaner to match than to mix up setup techniques.Special note: Currently OTel Python does not use entry points to configure Sampler like it does for Exporter and Propagators, so using
iter_entry_points
orload_entry_point
for a non-SW Sampler fails. OTel Python usessampling._get_from_env_or_default()
so we do too: https://github.com/open-telemetry/opentelemetry-python/blob/main/opentelemetry-sdk/src/opentelemetry/sdk/trace/sampling.py#L374-L377 I've added this piece to the NH Python Troubleshooting doc.Here is today's manual testing doc for this update: https://swicloud.atlassian.net/wiki/spaces/NIT/pages/3042050066/2022-05-04+configurator+testing
Please let me know what you think or if I've missed something 😃