Dotnetdiagnostics Receiver
Overview
Dotnet Diagnostics Receiver
| Status | |
|---|---|
| Stability | unmaintained |
| Supported pipeline types | metrics |
| Distributions | contrib |
.NET Counters Overview
The .NET runtime makes available metrics to interested clients over an IPC connection, listening for requests and responding with metrics sent at a specified interval. All .NET processes newer than 3.0 make available both default metrics (grouped under the nameSystem.Runtime) and any custom metrics
generated via the EventCounter
API
.
Once a .NET process is running, a client (such as this receiver) may connect to
it over IPC, which is either a Unix domain socket on Linux/macOS, or a named
pipe on Windows. After connecting, the client sends the process a request,
using a custom binary encoding, indicating both the counters it’s interested in
and the collection interval, then waits for data. If the request is successful,
the .NET process sends metrics, also using a custom binary encoding, over the
IPC connection, at the specified interval.
Operation
At startup, this recevier looks for a file inTMPDIR (or /tmp if not set)
corresponding to the given PID and a naming convention. If found, a Unix domain
socket connection is opened, using the file as the endpoint, and a request is
made to the dotnet process for metrics, with the given (in the config)
collection interval and counters.
After that, it listens for metrics arriving from the connection, and sends them
to the next consumer as soon as they arrive. If the connection fails, or an
unexpected value is read, the receiver shuts down.
Configuration
This receiver accepts three configuration fields:collection_interval,
pid, and counters.
| Field Name | Description | Example | Default |
|---|---|---|---|
collection_interval | The interval between metric collection (converted to seconds) | 1m | 1s |
pid | The process ID of the .NET process from which to collect metrics | 1001 | |
counters | A list of counter groups (sometimes referred to as providers or event sources) to request from the .NET process | ["MyCounters"] | ["System.Runtime", "Microsoft.AspNetCore.Hosting"] |
Usage With Receiver Creator
It is possible to create a config file for this receiver with a hard-coded process id, but it is expected that this receiver will often be used with a receiver creator, and a host observer, to discover .NET processes at runtime. Example receiver creator config:Supported Versions
This receiver is compatible with .NET Core 3.0 and later versions, running on Linux or macOS. Windows is not yet supported.External Resources
https://github.com/dotnet/diagnostics/blob/master/documentation/design-docs/ipc-protocol.md https://github.com/Microsoft/perfview/blob/main/src/TraceEvent/EventPipe/EventPipeFormat.mdConfiguration
Example Configuration
Last generated: 2026-04-14