dotnet / dotnet/diagnostics

dotnet-trace Chromium conversion ignores EventSource activity events

Open
#5,992 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.3k
Forks
404
Avg merge
2d 3h
Merged PRs (30d)
38

Description

### Description

`dotnet-trace convert --format Chromium` produces an empty `traceEvents` array for traces containing correlated EventSource start/stop activity events.

The events are present in the `.nettrace` file and have valid `ActivityID`/`RelatedActivityID` values when activity tracking is enabled, but none are emitted as Chromium spans.

### Reproduction

Collect an `ActivitySource` parent and child through the DiagnosticSource bridge:

```bash
dotnet-trace collect \
--providers 'Microsoft-Diagnostics-DiagnosticSource:0x3:5:FilterAndPayloadSpecs=[AS]ActivitySource.EventPipe.Repro,System.Threading.Tasks.TplEventSource:0x80:5' \
--output activity.nettrace \
-- dotnet activity-repro.dll

dotnet-trace convert --format Chromium activity.nettrace
```

Parsing the trace with TraceEvent shows:

- Parent start with a non-empty `ActivityID`
- Child start with a non-empty `ActivityID`
- Child `RelatedActivityID` matching the parent

The generated Chromium file contains:

```json
"traceEvents": []
```

### Expected behavior

Correlated EventSource start/stop events should be represented as nested Chromium spans, or the command should clearly document that Chromium conversion only exports sampled stack data.

### Implementation detail

`TraceFileFormatConverter` builds a `MutableTraceEventStackSource` and configures:

```csharp
IncludeEventSourceEvents = false
```

It then passes that stack source to `ChromiumStackSourceWriter`. Consequently, EventSource events are discarded before Chromium serialization.

https://github.com/dotnet/diagnostics/blob/main/src/Tools/dotnet-trace/TraceFileFormatConverter.cs

> [!NOTE]
> This issue was generated with GitHub Copilot.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/Tools/dotnet-trace/TraceFileFormatConverter.cs and inspect how MutableTraceEventStackSource is configured before ChromiumStackSourceWriter receives it. Reproduce with the provided dotnet-trace collect and convert commands, then verify that correlated EventSource activity events are represented in the Chromium output or that the command documents the supported export scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.