Skip to content

Ability to disable creation of intermediate activities in DiagnosticsHandler #30392

Closed
@a-elsheikh

Description

@a-elsheikh

The Problem

AspNetCore services are creating intermediate activities during HTTP comms, when invoking the service from any external component that has telemetry instrumentation the traces end up as broken hierarchies as unintended child spans are being created in the aspnetcore service, especially if said service sits as a bridge between 2 components.

for example, given that services A, C and D are instrumented but not B

A -> B - parent abc span def
B -> C - parent def span ghi
C -> D - parent ghi span jkl

if I have no intention of instrumenting B then preferably it won't create a span, otherwise the exported trace ends up broken and instead of looking like this

abc / def / ghi / jkl /

it will look like this

abc / def /
jkl /

additionally, this creates what can be deemed as unnecessary noise in the tracing and is potentially a performance consideration for highly optimised high throughput systems (questionable).

Suggested Solution

I'm not sure of the implications this would have on users relying on this as a default behaviour so perhaps an opt-in may not be viable but at least the ability to opt out.

Additional Context

Personally I experienced this issue when using Dapr sidecars. For the most part, the sidecars themselves emit the desired telemetry however the traces all end up broken when invoking aspnetcore services because of the elusive spans.

Intermediate activities/spans not exported
image

Intermediate activities/spans exported
image

Metadata

Metadata

Assignees

Labels

Needs: DesignThis issue requires design work before implementating.area-networkingIncludes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions