You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 6 Next »
郭强
参考:https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/instrumentation/runtime/runtime.go
样本:golang-metrics.json
所有Golang程序都有这些公共指标。虽然标准库runtime/metrics包和promtheus SDK中也有很多Golang指标,但是核心的指标也就以下这些,后续不够的再增加即可。
Golang
runtime/metrics
promtheus SDK
指标名称
指标类型
指标单位
Help信息
指标描述
process.runtime.go.cgo.calls
Counter
Number of cgo calls made by the current process
当前进程调用的cgo次数。
cgo
process.runtime.go.gc.count
Number of completed garbage collection cycles
已完成的 gc 周期的次数。
gc
process.runtime.go.gc.pause_ns
Histogram
ns
Amount of nanoseconds in GC stop-the-world pauses
在GC stop-the-world 中暂停的纳秒数量。
GC stop-the-world
process.runtime.go.gc.pause_total_ns
Cumulative nanoseconds in GC stop-the-world pauses since the program started
自程序启动以来,GC stop-the-world 的累计微秒计数。
process.runtime.go.goroutines
Gauge
Number of goroutines that currently exist
当前运行的协程数量。
process.runtime.go.lookups
Number of pointer lookups performed by the runtime
运行时执行的指针查询的数量。
process.runtime.go.mem.heap_alloc
bytes
Bytes of allocated heap objects
分配的堆对象的字节数。
process.runtime.go.mem.heap_idle
Bytes in idle (unused) spans
空闲(未使用)的堆内存。
process.runtime.go.mem.heap_inuse
Bytes in in-use spans
已使用的堆内存。
process.runtime.go.mem.heap_objects
Number of allocated heap objects
已分配的堆对象数量。
process.runtime.go.mem.live_objects
Number of live objects is the number of cumulative Mallocs - Frees
存活对象数量(Mallocs - Frees)
Mallocs - Frees
process.runtime.go.mem.heap_released
Bytes of idle spans whose physical memory has been returned to the OS
已交还给操作系统的堆内存。
process.runtime.go.mem.heap_sys
Bytes of heap memory obtained from the OS
从操作系统获得的堆内存。
process.runtime.uptime
ms
Milliseconds since application was initialized
自应用程序被初始化以来的毫秒数。