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

sdk autoloading #854

Merged
merged 10 commits into from
Nov 13, 2022
Merged

sdk autoloading #854

merged 10 commits into from
Nov 13, 2022

Conversation

brettmc
Copy link
Collaborator

@brettmc brettmc commented Nov 2, 2022

Enable autoloading/creating a global SDK from environment variables, which can be used by auto-instrumentation.
This should allow auto-instrumentation without any code (with env vars). Note the addition of a new env var, OTEL_PHP_AUTOLOAD_ENABLED - it must be enabled to allow autoloading.

@codecov
Copy link

codecov bot commented Nov 2, 2022

Codecov Report

Merging #854 (db1e438) into main (f083b10) will decrease coverage by 0.58%.
The diff coverage is 54.16%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #854      +/-   ##
============================================
- Coverage     81.25%   80.67%   -0.59%     
- Complexity     1971     2011      +40     
============================================
  Files           250      255       +5     
  Lines          5165     5279     +114     
============================================
+ Hits           4197     4259      +62     
- Misses          968     1020      +52     
Flag Coverage Δ
7.4 80.17% <54.16%> (-0.58%) ⬇️
8.0 80.67% <54.16%> (-0.59%) ⬇️
8.1 80.81% <54.16%> (-0.59%) ⬇️

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/Contrib/Otlp/Protocols.php 0.00% <ø> (ø)
src/SDK/Metrics/MeterProviderBuilder.php 0.00% <0.00%> (ø)
.../SDK/Metrics/MetricExporter/NoopMetricExporter.php 0.00% <0.00%> (ø)
src/SDK/SdkBuilder.php 82.14% <0.00%> (ø)
src/SDK/SdkAutoloader.php 43.47% <43.47%> (ø)
src/SDK/Metrics/MeterProviderFactory.php 81.48% <81.48%> (ø)
src/SDK/Propagation/PropagatorFactory.php 85.71% <85.71%> (ø)
src/Contrib/Zipkin/SpanConverter.php 96.29% <100.00%> (ø)
src/SDK/Common/Configuration/Configuration.php 100.00% <100.00%> (ø)
... and 3 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 f083b10...db1e438. Read the comment docs.

rector.php Show resolved Hide resolved
src/SDK/SdkAutoloader.php Outdated Show resolved Hide resolved
src/SDK/SdkAutoloader.php Outdated Show resolved Hide resolved
@brettmc
Copy link
Collaborator Author

brettmc commented Nov 7, 2022

This should wait for #859; it will need to incorporate config changes from that PR

@brettmc brettmc marked this pull request as ready for review November 7, 2022 02:23
@brettmc brettmc requested a review from a team as a code owner November 7, 2022 02:23
src/SDK/Common/Configuration/Configuration.php Outdated Show resolved Hide resolved
examples/autoload_sdk.php Outdated Show resolved Hide resolved
ensure all user-provided defaults are of the correct type
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