Status: Experimental
This document describes semantic conventions for Go runtime metrics in OpenTelemetry.
These metrics are obtained from Go's runtime/metrics
package.
Description: Go runtime metrics captured under the namespace go.memory.*
This metric is recommended.
Name | Instrument Type | Unit (UCUM) | Description | Stability |
---|---|---|---|---|
go.memory.used |
UpDownCounter | By |
Memory used by the Go runtime. [1] |
[1]: Computed from (/memory/classes/total:bytes - /memory/classes/heap/released:bytes)
.
Attribute | Type | Description | Examples | Requirement Level | Stability |
---|---|---|---|---|---|
go.memory.type |
string | The type of memory. | other ; stack |
Recommended |
go.memory.type
has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.
[1]: Computed from /memory/classes/heap/stacks:bytes
.
This metric is recommended.
Name | Instrument Type | Unit (UCUM) | Description | Stability |
---|---|---|---|---|
go.memory.limit |
UpDownCounter | By |
Go runtime memory limit configured by the user, if a limit exists. [1] |
[1]: Computed from /gc/gomemlimit:bytes
. This metric is excluded if the limit obtained from the Go runtime is math.MaxInt64.
This metric is recommended.
Name | Instrument Type | Unit (UCUM) | Description | Stability |
---|---|---|---|---|
go.memory.allocated |
Counter | By |
Memory allocated to the heap by the application. [1] |
[1]: Computed from /gc/heap/allocs:bytes
.
This metric is recommended.
Name | Instrument Type | Unit (UCUM) | Description | Stability |
---|---|---|---|---|
go.memory.allocations |
Counter | {allocation} |
Count of allocations to the heap by the application. [1] |
[1]: Computed from /gc/heap/allocs:objects
.
Description: Go metrics captured under the namespace go.memory.gc.*
This metric is recommended.
Name | Instrument Type | Unit (UCUM) | Description | Stability |
---|---|---|---|---|
go.memory.gc.goal |
UpDownCounter | By |
Heap size target for the end of the GC cycle. [1] |
[1]: Computed from /gc/heap/goal:bytes
.
Description: Go metrics captured under the namespace go.goroutine.*
This metric is recommended.
Name | Instrument Type | Unit (UCUM) | Description | Stability |
---|---|---|---|---|
go.goroutine.count |
UpDownCounter | {goroutine} |
Count of live goroutines. [1] |
[1]: Computed from /sched/goroutines:goroutines
.
Description: Go metrics captured under the namespace go.processor.*
This metric is recommended.
Name | Instrument Type | Unit (UCUM) | Description | Stability |
---|---|---|---|---|
go.processor.limit |
UpDownCounter | {thread} |
The number of OS threads that can execute user-level Go code simultaneously. [1] |
[1]: Computed from /sched/gomaxprocs:threads
.
Description: Go metrics captured under the namespace go.schedule.*
This metric is recommended.
Name | Instrument Type | Unit (UCUM) | Description | Stability |
---|---|---|---|---|
go.schedule.duration |
Histogram | s |
The time goroutines have spent in the scheduler in a runnable state before actually running. [1] |
[1]: Computed from /sched/latencies:seconds
. Bucket boundaries are provided by the runtime, and are subject to change.
Description: Go metrics captured under the namespace go.config.*
This metric is recommended.
Name | Instrument Type | Unit (UCUM) | Description | Stability |
---|---|---|---|---|
go.config.gogc |
UpDownCounter | % |
Heap size target percentage configured by the user, otherwise 100. [1] |
[1]: The value range is [0.0,100.0]. Computed from /gc/gogc:percent
.