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

# Go Legacy Runtime Metrics v1

## Overview{% #overview %}

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

## Setup{% #setup %}

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

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

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

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

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

*Available for Agent v6.0+*

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

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

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

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

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

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

### Metrics{% #metrics %}

|  |
|  |
| **runtime.go.num\_cpu**(gauge)                       | CPUs detected by the runtime.*Shown as resource*                                                                                |
| **runtime.go.num\_goroutine**(gauge)                 | goroutines spawned.*Shown as invocation*                                                                                        |
| **runtime.go.num\_cgo\_call**(gauge)                 | CGO calls made.*Shown as invocation*                                                                                            |
| **runtime.go.mem\_stats.alloc**(gauge)               | Alloc is bytes of allocated heap objects.*Shown as byte*                                                                        |
| **runtime.go.mem\_stats.total\_alloc**(gauge)        | TotalAlloc is cumulative bytes allocated for heap objects.*Shown as byte*                                                       |
| **runtime.go.mem\_stats.sys**(gauge)                 | Sys is the total bytes of memory obtained from the OS.*Shown as byte*                                                           |
| **runtime.go.mem\_stats.lookups**(gauge)             | Lookups is the number of pointer lookups performed by the*Shown as unit*                                                        |
| **runtime.go.mem\_stats.mallocs**(gauge)             | Mallocs is the cumulative count of heap objects allocated.*Shown as unit*                                                       |
| **runtime.go.mem\_stats.frees**(gauge)               | Frees is the cumulative count of heap objects freed.*Shown as unit*                                                             |
| **runtime.go.mem\_stats.heap\_alloc**(gauge)         | HeapAlloc is bytes of allocated heap objects.*Shown as byte*                                                                    |
| **runtime.go.mem\_stats.heap\_sys**(gauge)           | HeapSys is bytes of heap memory obtained from the OS.*Shown as byte*                                                            |
| **runtime.go.mem\_stats.heap\_idle**(gauge)          | HeapIdle is bytes in idle (unused) spans.*Shown as byte*                                                                        |
| **runtime.go.mem\_stats.heap\_inuse**(gauge)         | HeapInuse is bytes in in-use spans.*Shown as byte*                                                                              |
| **runtime.go.mem\_stats.heap\_released**(gauge)      | HeapReleased is bytes of physical memory returned to the OS.*Shown as byte*                                                     |
| **runtime.go.mem\_stats.heap\_objects**(gauge)       | HeapObjects is the number of allocated heap objects.*Shown as unit*                                                             |
| **runtime.go.mem\_stats.stack\_inuse**(gauge)        | StackInuse is bytes in stack spans.*Shown as byte*                                                                              |
| **runtime.go.mem\_stats.stack\_sys**(gauge)          | StackSys is bytes of stack memory obtained from the OS.*Shown as byte*                                                          |
| **runtime.go.mem\_stats.m\_span\_inuse**(gauge)      | MSpanInuse is bytes of allocated mspan structures.*Shown as byte*                                                               |
| **runtime.go.mem\_stats.m\_span\_sys**(gauge)        | MSpanSys is bytes of memory obtained from the OS for mspan structures.*Shown as byte*                                           |
| **runtime.go.mem\_stats.m\_cache\_inuse**(gauge)     | MCacheInuse is bytes of allocated mcache structures.*Shown as byte*                                                             |
| **runtime.go.mem\_stats.m\_cache\_sys**(gauge)       | MCacheSys is bytes of memory obtained from the OS for*Shown as byte*                                                            |
| **runtime.go.mem\_stats.buck\_hash\_sys**(gauge)     | BuckHashSys is bytes of memory in profiling bucket hash tables.*Shown as byte*                                                  |
| **runtime.go.mem\_stats.gc\_sys**(gauge)             | GCSys is bytes of memory in garbage collection metadata.*Shown as byte*                                                         |
| **runtime.go.mem\_stats.other\_sys**(gauge)          | OtherSys is bytes of memory in miscellaneous off-heap*Shown as byte*                                                            |
| **runtime.go.mem\_stats.next\_gc**(gauge)            | NextGC is the target heap size of the next GC cycle.*Shown as byte*                                                             |
| **runtime.go.mem\_stats.last\_gc**(gauge)            | LastGC is the time the last garbage collection finished, as nanoseconds since 1970 (the UNIX epoch).*Shown as nanosecond*       |
| **runtime.go.mem\_stats.pause\_total\_ns**(gauge)    | PauseTotalNs is the cumulative nanoseconds in GC*Shown as nanosecond*                                                           |
| **runtime.go.mem\_stats.num\_gc**(gauge)             | NumGC is the number of completed GC cycles.*Shown as unit*                                                                      |
| **runtime.go.mem\_stats.num\_forced\_gc**(gauge)     | NumForcedGC is the number of GC cycles that were forced by the application calling the GC function.*Shown as unit*              |
| **runtime.go.mem\_stats.gc\_cpu\_fraction**(gauge)   | GCCPUFraction is the fraction of this program's available CPU time used by the GC since the program started.*Shown as fraction* |
| **runtime.go.gc\_stats.pause\_quantiles.min**(gauge) | Distribution of GC pause times: minimum values*Shown as nanosecond*                                                             |
| **runtime.go.gc\_stats.pause\_quantiles.25p**(gauge) | Distribution of GC pause times: 25th percentile*Shown as nanosecond*                                                            |
| **runtime.go.gc\_stats.pause\_quantiles.75p**(gauge) | Distribution of GC pause times: 50th percentile*Shown as nanosecond*                                                            |
| **runtime.go.gc\_stats.pause\_quantiles.95p**(gauge) | Distribution of GC pause times: 75th percentile*Shown as nanosecond*                                                            |
| **runtime.go.gc\_stats.pause\_quantiles.max**(gauge) | Distribution of GC pause times: maximum values*Shown as nanosecond*                                                             |

### Events{% #events %}

The Go integration does not include any events.

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

The Go integration does not include any service checks.

## Troubleshooting{% #troubleshooting %}

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

## Further Reading{% #further-reading %}

- [How to collect, standardize, and centralize Golang logs](https://www.datadoghq.com/blog/go-logging/)
- [Go memory metrics demystified](https://www.datadoghq.com/blog/go-memory-metrics/)
