Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

基本介绍

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

samples: 

样本:golang-metrics.json

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

指标概览

指标名称

指标类型

指标单位

Help信息

指标描述

process.runtime.go.cgo.calls

Counter


Number of cgo calls made by the current process

当前进程调用的cgo次数。

process.runtime.go.gc.count

Counter


Number of completed garbage collection cycles

已完成的  gc  周期的次数。

process.runtime.go.gc.pause_ns

Histogram

ns

Amount of nanoseconds in GC stop-the-world pauses

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

process.runtime.go.gc.pause_total_ns

Histogram

Counter

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

Counter


Number of pointer lookups performed by the runtime

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

process.runtime.go.mem.heap_alloc

Gauge

bytes

Bytes of allocated heap objects

分配的堆对象的字节数。

process.runtime.go.mem.heap_idle

Gauge

bytes

Bytes in idle (unused) spans

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

process.runtime.go.mem.heap_inuse

Gauge

bytes

Bytes in in-use spans

已使用的堆内存。

process.runtime.go.mem.heap_objects

Gauge


Number of allocated heap objects

已分配的堆对象数量。

process.runtime.go.mem.live_objects

Gauge


Number of live objects is the number of cumulative Mallocs - Frees

存活对象数量(Mallocs - Frees)

process.runtime.go.mem.heap_released

Gauge

bytes

Bytes of idle spans whose physical memory has been returned to the OS

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

process.runtime.go.mem.heap_sys

Gauge

bytes

Bytes of heap memory obtained from the OS

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

process.runtime.uptime

Counter

ms

Milliseconds since application was initialized

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

指标详述









Panel
titleContent Menu

Table of Contents
maxLevel10