Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create text map propagators from registry #885

Merged
merged 3 commits into from
Dec 9, 2022
Merged

create text map propagators from registry #885

merged 3 commits into from
Dec 9, 2022

Conversation

brettmc
Copy link
Collaborator

@brettmc brettmc commented Dec 6, 2022

removing undocumented dependency between sdk and extension by adding text map propagators to a registry as part of composer autoloading, similar to how exporters, transports etc are treated.

removing undocumented dependency between sdk and extension by adding text map propagators to a registry
as part of composer autoloading, similar to how exporters, transports etc are treated.
@brettmc brettmc requested a review from a team as a code owner December 6, 2022 03:55
@codecov
Copy link

codecov bot commented Dec 6, 2022

Codecov Report

Merging #885 (c49aa68) into main (587bc5a) will decrease coverage by 0.17%.
The diff coverage is 50.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #885      +/-   ##
============================================
- Coverage     81.56%   81.39%   -0.18%     
- Complexity     2008     2011       +3     
============================================
  Files           264      264              
  Lines          5219     5229      +10     
============================================
- Hits           4257     4256       -1     
- Misses          962      973      +11     
Flag Coverage Δ
7.4 80.87% <50.00%> (-0.18%) ⬇️
8.0 81.37% <50.00%> (-0.18%) ⬇️
8.1 81.51% <50.00%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Contrib/Otlp/MetricExporterFactory.php 0.00% <0.00%> (ø)
src/SDK/Registry.php 64.91% <0.00%> (ø)
.../Trace/SpanExporter/ConsoleSpanExporterFactory.php 0.00% <0.00%> (ø)
src/Contrib/Otlp/SpanExporterFactory.php 100.00% <100.00%> (ø)
src/SDK/Metrics/MeterProviderFactory.php 76.92% <100.00%> (ø)
src/SDK/Propagation/PropagatorFactory.php 94.44% <100.00%> (+9.25%) ⬆️
src/SDK/Trace/ExporterFactory.php 100.00% <100.00%> (ø)
src/Extension/Propagator/B3/B3Propagator.php 88.23% <0.00%> (-11.77%) ⬇️
src/Context/Propagation/NoopTextMapPropagator.php 88.88% <0.00%> (-11.12%) ⬇️
src/API/Baggage/Propagation/BaggagePropagator.php 96.87% <0.00%> (-3.13%) ⬇️
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 587bc5a...c49aa68. Read the comment docs.


\OpenTelemetry\SDK\FactoryRegistry::registerTextMapPropagatorFactory(
\OpenTelemetry\SDK\Common\Configuration\KnownValues::VALUE_B3,
\OpenTelemetry\Extension\Propagator\B3\B3SinglePropagatorFactory::class
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer if we add a ClosureTextMapPropagatorFactory (or allow registering closure factories directly) to avoid adding a factory class for every implementation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just removed the factories altogether, and registered the propagator instances instead. It's simpler, but also adding non-factories to a FactoryRegistry which is a little shady.

Copy link
Member

@pdelewski pdelewski Dec 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, that it's simpler, but as you written it breaks rule of storing only factories there. I don't have strong opinions for or against. Maybe, we should consider some renaming as FactoryRegistry will no longer store factories only?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've renamed it to Registry, which isn't very imaginative but seems valid.

@brettmc brettmc merged commit 0073d6d into open-telemetry:main Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants