Skip to main content
net10.0net8.0.NETStandard2.0

dotnet process instrumentation for OpenTelemetry .NET.

Published
Oct 15, 2026
18d ago
Total Downloads
74.5M
74,458,713

Install

dotnet add package OpenTelemetry.Instrumentation.Process --version 1.20.0-rc.1
ProductVersions
.NET
net10.0net8.0
.NET Standard
netstandard2.0

README

Process Instrumentation for OpenTelemetry .NET

Status
Stability Release candidate
Code Owners @Yun-Ting

NuGet version badge NuGet download count badge codecov.io

This is an Instrumentation Library, which instruments .NET and collects telemetry about process behavior.

The process metric instruments being implemented are following OpenTelemetry metrics semantic conventions.

Steps to enable OpenTelemetry.Instrumentation.Process

Step 1: Install package

Add a reference to OpenTelemetry.Instrumentation.Process package.

dotnet add package --prerelease OpenTelemetry.Instrumentation.Process

Add a reference to OpenTelemetry.Exporter.Prometheus.HttpListener package.

dotnet add package --prerelease OpenTelemetry.Exporter.Prometheus.HttpListener

Step 2: Enable Process instrumentation

Process instrumentation should be enabled at application startup using the AddProcessInstrumentation extension on MeterProviderBuilder:

using var meterProvider = Sdk.CreateMeterProviderBuilder()
    .AddProcessInstrumentation()
    .AddPrometheusHttpListener()
    .Build();

Refer to Program.cs for a complete demo. This examples sets up the OpenTelemetry Prometheus exporter, which requires adding the package OpenTelemetry.Exporter.Prometheus.HttpListener to the application.

Additionally, this document shows how to use Prometheus and Grafana to build a dashboard for your application. This is the Grafana dashboard template which has all the metrics currently supported by this package; plus an additional aggregated metric CPU utilization calculated with the raw metrics, CPU time and CPU count.

Please follow the instructions in this document to import a Grafana dashboard by uploading the JSON template file.

Metrics

process.memory.usage

The amount of physical memory allocated for this process.

Units Instrument Type Value Type
By ObservableUpDownCounter Double

The API used to retrieve the value is:

  • Process.WorkingSet64: Gets the amount of physical memory, in bytes, allocated for the associated process.

process.memory.virtual

The amount of committed virtual memory for this process. One way to think of this is all the address space this process can read from without triggering an access violation; this includes memory backed solely by RAM, by a swapfile/pagefile and by other mapped files on disk.

Units Instrument Type Value Type
By ObservableUpDownCounter Double

The API used to retrieve the value is:

process.cpu.time

Total CPU seconds broken down by CPU modes.

Units Instrument Type Value Type Attribute Key Attribute Values
s ObservableCounter Double cpu.mode user, system

The APIs used to retrieve the values are:

process.thread.count

Process threads count.

Units Instrument Type Value Type
{thread} ObservableUpDownCounter Int32

The API used to retrieve the value is:

  • Process.Threads: Gets the set of threads that are running in the associated process.

process.uptime

The time the process has been running.

Units Instrument Type Value Type
s ObservableGauge Double

The API used to retrieve the value is:

process.windows.handle.count

Number of handles held by the process. Only emitted on Windows.

Units Instrument Type Value Type
{handle} ObservableUpDownCounter Int32

The API used to retrieve the value is:

process.unix.file_descriptor.count

Number of unix file descriptors in use by the process. Only emitted on Linux.

Units Instrument Type Value Type
{file_descriptor} ObservableUpDownCounter Int32

The API used to retrieve the value is:

References

Changes from Previous Version

No structural changes between v1.19.0-rc.1 and v1.20.0-rc.1.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.