Skip to content

Unable to set providers using EventPipeConfig #3298

Closed
dotnet/runtime
#75248
@tmds

Description

@tmds

Probably this is not a bug, but me doing it wrong.

I'm using .NET 6.0.107.

I have an app:

var client = new HttpClient();

var response = await client.GetAsync("https://nuget.org");

Console.WriteLine(response.StatusCode);

I'd like to see a trace that includes the HTTP events.

I've set these variables:

DOTNET_EventPipeConfig=*
COMPlus_EventPipeOutputPath=/tmp/trace
COMPlus_EventPipeConfig=*
COMPlus_EnableEventPipe=1

I execute the app:

bin/Debug/net6.0/console

I now have a file at /tmp/trace.

I read it (on another shell that doesn't have the envvars set) using:

using System;
using Microsoft.Diagnostics.Tracing;
using Microsoft.Diagnostics.Tracing.Etlx;
using Microsoft.Diagnostics.Tracing.Parsers;

namespace console
{
    class Program
    {

        static void Main(string[] args)
        {
            if (args.Length < 1)
            {
                Console.WriteLine("You must specify a nettrace file.");
                return;
            }

            using (var traceLog = new TraceLog(TraceLog.CreateFromEventPipeDataFile(args[0])))
            {
                var traceSource = traceLog.Events.GetSource();

                traceSource.AllEvents += delegate (TraceEvent data) {
                    Console.WriteLine("{0}", data);
                };

                traceSource.Process();

           }
        }
    }
}

The output doesn't have any HTTP events.

cc @noahfalk @dotnet/area-system-diagnostics-tracing @adamsitnik

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions