-
Couldn't load subscription status.
- Fork 212
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 open-telemetry/opentelemetry-php-contrib#361 (comment)
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 #1599 so if we go ahead with that, I think the steps should be:
- merge Implement span suppression strategies #1599
- action TODO from Implement span suppression strategies #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 Implement span suppression strategies #1599 (comment))
- add tests
- implement declarative configuration (probably under
instrumentation.php.span_suppression - document how it works, or some common "recipes"