Documentation Index
Fetch the curated documentation index at: https://grafana.com/llms.txt
Fetch the complete documentation index at: https://grafana.com/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: https://grafana.com/docs/grafana-cloud/knowledge-graph/advanced-configuration/enable-prom-metrics-collection/runtimes/golang.md (append .md) or send Accept: text/markdown to https://grafana.com/docs/grafana-cloud/knowledge-graph/advanced-configuration/enable-prom-metrics-collection/runtimes/golang/. For the curated documentation index, use https://grafana.com/llms.txt. For the complete documentation index, use https://grafana.com/llms-full.txt.
Configure golang to generate Prometheus metrics
For instructions on how to instrument a Go application with Prometheus exporter, refer to Instrumenting a Go application for Prometheus.
Metrics and KPIs
| Metric | KPI |
|---|---|
| Metric | KPI |
Memory process_resident_memory_bytes | Utilization in k8s
Utilization in non k8s
|
CPU
| Utilization in k8s
Utilization in non k8s
|
Dashboard
The following Go KPI dashboard shows KPIs listed in the table, and the following Go runtime metrics.
Memory metrics
- Heap Memory
go_memstats_heap_alloc_bytes - Off-Heap Memory
go_memstats_mspan_inuse_bytes - Stack Memory
go_memstats_stack_inuse_bytes - Total Memory
go_memstats_sys_bytes
Objects, allocation, and GC metrics
- Live Object Count
go_memstats_mallocs_total-go_memstats_frees_total - Object Allocation Rate
rate(go_memstats_mallocs_total) - Memory Allocation Rate
rate(go_memstats_alloc_bytes_total) - GC Duration Quantiles
go_gc_duration_seconds
Go routines and pointers metrics
- Number of routines
go_goroutines - Number of pointer dereferences
rate(go_memstats_lookups_total)

Was this page helpful?
Related resources from Grafana Labs


