PoC: Implement span suppression strategies
Alternative to #1583
Span suppression is implemented in the SDK -> instrumentation does not need to handle suppression.
(Everything besides SemanticConvention and SemanticConventionResolver could be moved to the SDK.)
Provides three span suppression strategies: Noop: does not suppress anything SpanKind: suppresses nested spans with the same span kind (except for internal) SemConv: attempts to resolve the semantic convention based on span attributes, otherwise falls back to span kind suppression
I'm happy to accept this as-is and complete it incrementally, if you don't have much time. If you're happy with that, can you add @experimental tags everywhere, and fix the (hopefully minor) CI issues. I've documented some steps to get this towards readiness in #1579
Codecov Report
:x: Patch coverage is 77.27273% with 30 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 68.36%. Comparing base (00417cf) to head (f05250b).
:warning: Report is 2 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #1599 +/- ##
============================================
+ Coverage 68.24% 68.36% +0.12%
- Complexity 2919 2978 +59
============================================
Files 435 447 +12
Lines 8876 9008 +132
============================================
+ Hits 6057 6158 +101
- Misses 2819 2850 +31
| Flag | Coverage Δ | |
|---|---|---|
| 8.1 | 68.01% <77.27%> (+0.18%) |
:arrow_up: |
| 8.2 | 68.15% <77.27%> (+0.02%) |
:arrow_up: |
| 8.3 | 68.25% <77.27%> (+0.20%) |
:arrow_up: |
| 8.4 | 68.22% <77.27%> (+0.14%) |
:arrow_up: |
| 8.5 | 68.21% <77.27%> (+0.17%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Files with missing lines | Coverage Δ | |
|---|---|---|
| src/API/Trace/Span.php | 94.44% <ø> (ø) |
|
| ...ession/NoopSuppressionStrategy/NoopSuppression.php | 100.00% <100.00%> (ø) |
|
| ...oopSuppressionStrategy/NoopSuppressionStrategy.php | 100.00% <100.00%> (ø) |
|
| ...ression/NoopSuppressionStrategy/NoopSuppressor.php | 100.00% <100.00%> (ø) |
|
| ...pressionStrategy/SemanticConventionSuppression.php | 100.00% <100.00%> (ø) |
|
| ...Strategy/SemanticConventionSuppressionStrategy.php | 100.00% <100.00%> (ø) |
|
| ...panKindSuppressionStrategy/SpanKindSuppression.php | 100.00% <100.00%> (ø) |
|
| ...uppressionStrategy/SpanKindSuppressionStrategy.php | 100.00% <100.00%> (ø) |
|
| src/SDK/Trace/Tracer.php | 89.47% <100.00%> (+0.58%) |
:arrow_up: |
| src/SDK/Trace/TracerProvider.php | 100.00% <100.00%> (ø) |
|
| ... and 8 more |
... and 4 files with indirect coverage changes
Continue to review full report in Codecov by Sentry.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 00417cf...f05250b. Read the comment docs.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Is there any movement in this at all?
Currently have a lot of pain when using some of the symfony / psr auto instrumentation bundles for HTTP requests, hope this will alleviate the problem.
See a lot of nested spans that are identical in name that are sometimes 5/6 levels deep.
Does this PR expose any way to configure which suppression strategy is used by the SDK when used via autoinstrumentation bundles?
Was expecting to see some environment variable configuration, but haven't seen any.
Does this PR expose any way to configure which suppression strategy is used by the SDK when used via autoinstrumentation bundles? Was expecting to see some environment variable configuration, but haven't seen any.
No. I think that will be a follow-up, which is called out in #1579. I think it's too complicated to work with env vars, and so would require YAML-based declarative config (happy to be proven wrong, though). So step 1, let's get it in, then do some field testing that it works, then make it more useful/accessible.