open-telemetry / open-telemetry/opentelemetry-php
implement span suppression
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 912
- Forks
- 232
- Avg merge
- 7d 16h
- Merged PRs (30d)
- 4
Description
Is your feature request related to a problem?
When multiple auto-instrumentation packages are installed, we can see nested/redundant extra CLIENT spans. Ideally, and according to spec, there should only be one CLIENT span per operation, and the child of a CLIENT span should be a remote SERVER span.
Some discussion in https://github.com/open-telemetry/opentelemetry-php-contrib/pull/361#discussion_r2059679351
Describe the solution you'd like
Java has SpanSuppressionStrategy to achieve this, and that might be a good way to go.
I think that ultimately we would want an auto-instrumentation to not create a CLIENT span if one has already been created (however, it should still perform other logic such as injecting trace propagation headers).
Also consider whether we can use this to resolve #1534
A PoC has been developed in https://github.com/open-telemetry/opentelemetry-php/pull/1599 so if we go ahead with that, I think the steps should be:
- merge #1599
- action TODO from #1599 ("must suppress no-op spans too")
- include inherited attributes when generating this resolver (for example db.system.name is missing in all span.db.*.client semconvs) (see https://github.com/open-telemetry/opentelemetry-php/pull/1599#discussion_r2384103959)
- add tests
- implement declarative configuration (probably under
instrumentation.php.span_suppression - document how it works, or some common "recipes"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the PoC in opentelemetry-php#1599 and its remaining TODO about suppressing no-op spans. Then add tests, implement declarative configuration under instrumentation.php.span_suppression, and document common recipes; done means the checklist items are addressed, including inherited attributes and suppression behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100