3 ms·
There are multiple ways to go about this in .NET - the instrumentation for the networking stack is not missing: https://learn.microsoft.com/en-us/dotnet/fundam
by neonsunset 2y ago
There are multiple ways to go about this in .NET - the instrumentation for the networking stack is not missing:
https://learn.microsoft.com/en-us/dotnet/fundamentals/networking/telemetry/overview https://learn.microsoft.com/en-us/dotnet/fundamentals/networ...
https://learn.microsoft.com/en-us/dotnet/fundamentals/networking/telemetry/events#consume-events-from-outside-the-process https://learn.microsoft.com/en-us/dotnet/fundamentals/networ...
It is, however, not dependent on VS Code and exists standalone, so it requires integration work if there's custom tooling at play. It is what most vendor SDKs that offer observability do.
There are CLI tools which consume the EventSource events and the EventPipe itself which can be used to access them in and out of process: https://learn.microsoft.com/en-us/dotnet/core/diagnostics/eventpipe https://learn.microsoft.com/en-us/dotnet/core/diagnostics/ev...
EventPipe/EventSource and DiagnosticPort are very powerful APIs however that cover much deeper instrumentation scenarios, so they are going to require writing a connector for the product that wants to integrate with them. There is already an implementation in shared code that is used by e.g. dotnet-trace which can be found here https://github.com/dotnet/diagnostics/tree/main/src/Microsoft.Diagnostics.NETCore.Client https://github.com/dotnet/diagnostics/tree/main/src/Microsof... but it can be a bit convoluted to read through.