dotnet / dotnet/docs

Missing some documentation for adding arguments to EventPipe using environment variables

Open
#37,864 3 comments 0 reactions 1 assignee Claimed by @tommcdon View on GitHub
dotnet-fundamentals/svc
Dominant language
No language data
Stars
4.8k
Forks
6.1k
Avg merge
15h 21m
Merged PRs (30d)
370

Description

Hello,

In this document:
`docs/core/diagnostics/eventpipe.md`
there is a section at the end on how to "Trace using environment variables". It mentions using the `DOTNET_EventPipeConfig` environment variable with the format `::`.

However, most useful traces seem to need additional arguments passed to the provider. For example:
`dotnet trace collect --name SampleApp --providers="Microsoft-Diagnostics-DiagnosticSource:::FilterAndPayloadSpecs=[AS]*"`
`dotnet trace collect --name SampleApp --providers="System.Diagnostics.Metrics:::Metrics=SampleMeter"`
`dotnet trace collect --name SampleApp --providers="Microsoft-Extensions-Logging:2::FilterSpecs=SampleApp*:Information;Microsoft*:Warning"`

In other words, there are four values being passed to the provider argument, not three.

If you run any of these from the command line, the resulting trace is as expected. However, if you take that exact `provider` value and put it into the `DOTNET_EventPipeConfig` environment variable (along with the `DOTNET_EnableEventPipe=1` to enable the tracing) and run any app, tracing does not contain output from those providers.

I believe this is because the arguments are not being passed to the provider.
So, either that's not supported, and the documentation should state so or else it's missing the syntax to do so.

---
#### Document Details

⚠ *Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.*

* ID: 4e390988-a423-3200-51bd-d05125683808
* Version Independent ID: 2377dbf5-249a-7966-ff50-3523118e6f1a
* Content: [EventPipe Overview - .NET](https://learn.microsoft.com/en-us/dotnet/core/diagnostics/eventpipe)
* Content Source: [docs/core/diagnostics/eventpipe.md](https://github.com/dotnet/docs/blob/main/docs/core/diagnostics/eventpipe.md)
* Product: **dotnet-fundamentals**
* GitHub Login: @tommcdon
* Microsoft Alias: **tommcdon**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.