Skip to content

EventSourceLogger does not propagate SpanId and TraceId #76718

@wiktork

Description

@wiktork

Description

Asp.net log scope data collected from an out of process collector such as dotnet-monitor no longer contains Activity information such as TraceId and SpanId. These properties are no longer added as part of the Request scope data (see dotnet/aspnetcore#22376). These properties are no added to loggers using IExternalScopeProvider/ISupportExternalScope, which EventSourceLogger does not support.

Related dotnet-monitor issue dotnet/dotnet-monitor#2545

Reproduction Steps

Create a new asp.net core 6.0 web application.
Install dotnet-monitor tool
Run dotnet-monitor collect --no-auth
Run curl https://localhost:52323/logs?level=Information&pid=<pid of web app>
Issue a request to the web app.

Expected behavior

Log from dotnet-monitor should contain SpanId and TraceId information

Actual behavior

Log entry contains RequestId and RequestPath, but no activity information is displayed.

Regression?

Yes; this behavior worked in 3.1

Known Workarounds

No response

Configuration

Windows .Net 6 x64

The issue is specific to net 6+.

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-Extensions-Loggingin-prThere is an active PR which will close this issue when it is merged

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions