opentelemetry-php
opentelemetry-php copied to clipboard
Add alternative instrumentation abstraction
Adds global (context-scoped) tracer provider & co, intended to replace the current InstrumentationInterface.
$scope = InstrumentationConfigurator::create()
->withTracerProvider($tracerProvider)
->withPropagator($propagator)
->activate();
try {
// ...
} finally {
$scope->detach();
}
$instrumentation = new Instrumentation('io.opentelemetry.contrib.php');
// ...
$span = $instrumentation
->tracer() // returns a tracer for the currently active tracer provider
->spanBuilder('test')
->startSpan()
Codecov Report
Merging #822 (d7c308d) into main (f73a835) will increase coverage by
0.22%. The diff coverage is100.00%.
Additional details and impacted files
@@ Coverage Diff @@
## main #822 +/- ##
============================================
+ Coverage 81.52% 81.75% +0.22%
- Complexity 1925 1947 +22
============================================
Files 239 243 +4
Lines 5008 5069 +61
============================================
+ Hits 4083 4144 +61
Misses 925 925
| Flag | Coverage Δ | |
|---|---|---|
| 7.4 | 81.23% <90.16%> (+0.10%) |
:arrow_up: |
| 8.0 | 81.75% <95.08%> (+0.16%) |
:arrow_up: |
| 8.1 | 81.89% <95.08%> (+0.16%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| ...I/Common/Instrumentation/CachedInstrumentation.php | 100.00% <100.00%> (ø) |
|
| src/API/Common/Instrumentation/Configurator.php | 100.00% <100.00%> (ø) |
|
| src/API/Common/Instrumentation/ContextKeys.php | 100.00% <100.00%> (ø) |
|
| src/API/Common/Instrumentation/Globals.php | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update f73a835...d7c308d. Read the comment docs.
@Nevay happy for this to be merged?
Should be ready after a rebase.