---
title: .NET Runtime Metrics
description: Collect metrics, traces, and logs from your .NET applications.
breadcrumbs: Docs > Integrations > .NET Runtime Metrics
---

# .NET Runtime Metrics

## Overview{% #overview %}

The .NET integration allows you to collect and monitor your .NET application logs, traces, and custom metrics.

## Setup{% #setup %}

### Metric collection{% #metric-collection %}

See the dedicated documentation for [collecting .NET custom metrics with DogStatsD](https://docs.datadoghq.com/developers/dogstatsd/?tab=net).

### Trace collection{% #trace-collection %}

See the dedicated documentation for [instrumenting your .NET application](https://docs.datadoghq.com/tracing/setup/dotnet/) to send its traces to Datadog.

### Log collection{% #log-collection %}

*Available for Agent v6.0+*

See the dedicated documentation on how to [setup .NET log collection](https://docs.datadoghq.com/logs/log_collection/csharp/) to forward your logs to Datadog.

### Profile collection{% #profile-collection %}

See the dedicated documentation for [enabling the .NET profiler](https://docs.datadoghq.com/profiler/enabling/dotnet/).

### Code Security{% #code-security %}

See the dedicated documentation for [enabling Code Security for your Python application](https://docs.datadoghq.com/security/code_security/).

### App & API Protection (AAP){% #app--api-protection-aap %}

See the dedicated documentation for [securing your .NET application](https://docs.datadoghq.com/security/application_security/setup/dotnet/) to enable App & API Protection (AAP).

## Data Collected{% #data-collected %}

### Metrics{% #metrics %}

|  |
|  |
| **runtime.dotnet.cpu.system**(gauge)                           | The number of milliseconds executing in the kernel*Shown as millisecond*                                                                                   |
| **runtime.dotnet.cpu.user**(gauge)                             | The number of milliseconds executing outside the kernel*Shown as millisecond*                                                                              |
| **runtime.dotnet.cpu.percent**(gauge)                          | The percentage of total CPU used by the application*Shown as percent*                                                                                      |
| **runtime.dotnet.mem.committed**(gauge)                        | Memory usage*Shown as byte*                                                                                                                                |
| **runtime.dotnet.threads.count**(gauge)                        | The number of threads*Shown as thread*                                                                                                                     |
| **runtime.dotnet.threads.workers\_count**(gauge)               | The number of workers in the threadpool (.NET Core 3.1+ only)*Shown as thread*                                                                             |
| **runtime.dotnet.threads.contention\_time**(gauge)             | The cumulated time spent by threads waiting on a lock (.NET Core 3.1+ only)*Shown as millisecond*                                                          |
| **runtime.dotnet.threads.contention\_count**(count)            | The number of times a thread stopped to wait on a lock                                                                                                     |
| **runtime.dotnet.exceptions.count**(count)                     | The number of first-chance exceptions*Shown as exception*                                                                                                  |
| **runtime.dotnet.gc.size.gen0**(gauge)                         | The size of the gen 0 heap*Shown as byte*                                                                                                                  |
| **runtime.dotnet.gc.size.gen1**(gauge)                         | The size of the gen 1 heap*Shown as byte*                                                                                                                  |
| **runtime.dotnet.gc.size.gen2**(gauge)                         | The size of the gen 2 heap*Shown as byte*                                                                                                                  |
| **runtime.dotnet.gc.size.loh**(gauge)                          | The size of the large object heap*Shown as byte*                                                                                                           |
| **runtime.dotnet.gc.memory\_load**(gauge)                      | The percentage of the total memory used by the process. The GC changes its behavior when this value gets above 85. (.NET Core 3.1+ only)*Shown as percent* |
| **runtime.dotnet.gc.pause\_time**(gauge)                       | The amount of time the GC paused the application threads (.NET Core 3.1+ only)*Shown as millisecond*                                                       |
| **runtime.dotnet.gc.count.gen0**(count)                        | The number of gen 0 garbage collections*Shown as garbage collection*                                                                                       |
| **runtime.dotnet.gc.count.gen1**(count)                        | The number of gen 1 garbage collections*Shown as garbage collection*                                                                                       |
| **runtime.dotnet.gc.count.gen2**(count)                        | The number of gen 2 garbage collections*Shown as garbage collection*                                                                                       |
| **runtime.dotnet.aspnetcore.requests.total**(gauge)            | The total number of HTTP requests received by the server (.NET Core 3.1+ only)*Shown as request*                                                           |
| **runtime.dotnet.aspnetcore.requests.failed**(gauge)           | The number of failed HTTP requests received by the server (.NET Core 3.1+ only)*Shown as request*                                                          |
| **runtime.dotnet.aspnetcore.requests.current**(gauge)          | The total number of HTTP requests that have started but not yet stopped (.NET Core 3.1+ only)*Shown as request*                                            |
| **runtime.dotnet.aspnetcore.requests.queue\_length**(gauge)    | The current length of the server HTTP request queue (.NET 5+ only)*Shown as request*                                                                       |
| **runtime.dotnet.aspnetcore.connections.total**(gauge)         | The total number of HTTP connections established to the server (.NET 5+ only)*Shown as connection*                                                         |
| **runtime.dotnet.aspnetcore.connections.current**(gauge)       | The current number of active HTTP connections to the server (.NET 5+ only)*Shown as connection*                                                            |
| **runtime.dotnet.aspnetcore.connections.queue\_length**(gauge) | The current length of the HTTP server connection queue (.NET 5+ only)*Shown as connection*                                                                 |

### Events{% #events %}

The .NET integration does not include any events.

### Service Checks{% #service-checks %}

The .NET integration does not include any service checks.

## Troubleshooting{% #troubleshooting %}

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).
