Prerequisites

OpenTelemetry SDK configuration

If you have instrumented your .NET applications with OpenTelemetry automatic instrumentation, runtime metrics are automatically enabled.

If you have instrumented your .NET application with OpenTelemetry manual instrumentation, see the documentation for the OpenTelemetry.Instrumentation.Runtime library.

The default metric export interval for the .NET OTel SDK is different from the default for the Datadog .NET SDK. Datadog recommends setting the OTEL_METRIC_EXPORT_INTERVAL environment variable on your .NET service to match the default Datadog metric export interval for viewing integration metric graphs:

  • OTEL_METRIC_EXPORT_INTERVAL=10000

Runtime metric mappings

The following table lists the Datadog runtime metrics that are supported by mapping OpenTelemetry runtime metrics, with “N/A” indicating that there is no OpenTelemetry counterpart.

Datadog metricDescriptionOpenTelemetry counterpart
runtime.dotnet.threads.contention_countThe number of times a thread stopped to wait on a lock.process.runtime.dotnet.
monitor.lock_contention.count
runtime.dotnet.exceptions.countThe number of first-chance exceptions.process.runtime.dotnet.
exceptions.count
runtime.dotnet.gc.size.gen0The size of the gen 0 heap.process.runtime.dotnet.
gc.heap.size
runtime.dotnet.gc.size.gen1The size of the gen 1 heap.process.runtime.dotnet.
gc.heap.size
runtime.dotnet.gc.size.gen2The size of the gen 2 heap.process.runtime.dotnet.
gc.heap.size
runtime.dotnet.gc.size.lohThe size of the large object heap.process.runtime.dotnet.
gc.heap.size
runtime.dotnet.gc.count.gen0The number of gen 0 garbage collections.process.runtime.dotnet.
gc.collections.count
runtime.dotnet.gc.count.gen1The number of gen 1 garbage collections.process.runtime.dotnet.
gc.collections.count
runtime.dotnet.gc.count.gen2The number of gen 2 garbage collections.process.runtime.dotnet.
gc.collections.count
runtime.dotnet.cpu.systemThe number of milliseconds executing in the kernel.N/A
runtime.dotnet.cpu.userThe number of milliseconds executing outside the kernel.N/A
runtime.dotnet.cpu.percentThe percentage of total CPU used by the application.N/A
runtime.dotnet.mem.committedMemory usage.N/A
runtime.dotnet.threads.countThe number of threads.N/A
runtime.dotnet.threads.workers_countThe number of workers in the threadpool. (.NET Core only)N/A
runtime.dotnet.threads.contention_timeThe cumulated time spent by threads waiting on a lock. (.NET Core only)N/A
runtime.dotnet.gc.memory_loadThe percentage of the total memory used by the process. The garbage collection (GC) changes its behavior when this value gets above 85. (.NET Core only)N/A
runtime.dotnet.gc.pause_timeThe amount of time the GC paused the application threads. (.NET Core only)N/A
runtime.dotnet.aspnetcore.
requests.total
The total number of HTTP requests received by the server. (.NET Core only)N/A
runtime.dotnet.aspnetcore.
requests.failed
The number of failed HTTP requests received by the server. (.NET Core only)N/A
runtime.dotnet.aspnetcore.
requests.current
The total number of HTTP requests that have started but not yet stopped. (.NET Core only)N/A
runtime.dotnet.aspnetcore.
requests.queue_length
The current length of the server HTTP request queue. (.NET Core only)N/A
runtime.dotnet.aspnetcore.
connections.total
The total number of HTTP connections established to the server. (.NET Core only)N/A
runtime.dotnet.aspnetcore.
connections.current
The current number of active HTTP connections to the server. (.NET Core only)N/A
runtime.dotnet.aspnetcore.
connections.queue_length
The current length of the HTTP server connection queue. (.NET Core only)N/A