docs icon indicating copy to clipboard operation
docs copied to clipboard

Missing some documentation for adding arguments to EventPipe using environment variables

Open joshmouch opened this issue 8 months ago • 3 comments

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 <provider>:<keyword>:<level>.

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.

joshmouch avatar Nov 02 '23 08:11 joshmouch