You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

基本介绍

参考:https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/instrumentation/runtime/runtime.go

样本:golang-metrics.json

所有Golang程序都有这些公共指标。虽然标准库runtime/metrics包和promtheus SDK中也有很多Golang指标,但是核心的指标也就以下这些,后续不够的再增加即可。

指标概览

指标名称

指标类型

指标单位

Help信息

指标描述

process.runtime.go.cgo.calls

Counter



当前进程调用的cgo次数。

process.runtime.go.gc.count

Counter



已完成的  gc  周期的次数。

process.runtime.go.gc.pause_ns

Histogram

ns


GC stop-the-world 中暂停的纳秒数量。

process.runtime.go.gc.pause_total_ns

Histogram

ns


自程序启动以来,GC stop-the-world 的累计微秒计数。

process.runtime.go.goroutines

Gauge



当前运行的协程数量。

process.runtime.go.lookups

Counter



运行时执行的指针查询的数量。

process.runtime.go.mem.heap_alloc

Gauge

bytes


分配的堆对象的字节数。

process.runtime.go.mem.heap_idle

Gauge

bytes


空闲(未使用)的堆内存。

process.runtime.go.mem.heap_inuse

Gauge

bytes


已使用的堆内存。

process.runtime.go.mem.heap_objects

Gauge



已分配的堆对象数量。

process.runtime.go.mem.live_objects

Gauge



存活对象数量(Mallocs - Frees)

process.runtime.go.mem.heap_released

Gauge

bytes


已交还给操作系统的堆内存。

process.runtime.go.mem.heap_sys

Gauge

bytes


从操作系统获得的堆内存。

process.runtime.uptime

Counter

ms


自应用程序被初始化以来的毫秒数。

指标详述

Content Menu

  • No labels