Skip to content

Commit d11eceb

Browse files
authored
runtime: add docs for go.schedule.duration (#8154)
1 parent 94d998a commit d11eceb

File tree

3 files changed

+33
-29
lines changed

3 files changed

+33
-29
lines changed

instrumentation/runtime/doc.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,4 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
// Package runtime implements the conventional runtime metrics specified by OpenTelemetry.
5-
//
6-
// The metric events produced are:
7-
//
8-
// go.memory.used By Memory used by the Go runtime.
9-
// go.memory.limit By Go runtime memory limit configured by the user, if a limit exists.
10-
// go.memory.allocated By Memory allocated to the heap by the application.
11-
// go.memory.allocations {allocation} Count of allocations to the heap by the application.
12-
// go.memory.gc.goal By Heap size target for the end of the GC cycle.
13-
// go.goroutine.count {goroutine} Count of live goroutines.
14-
// go.processor.limit {thread} The number of OS threads that can execute user-level Go code simultaneously.
15-
// go.config.gogc % Heap size target percentage configured by the user, otherwise 100.
16-
//
17-
// When the OTEL_GO_X_DEPRECATED_RUNTIME_METRICS environment variable is set to
18-
// true, the following deprecated metrics are produced:
19-
//
20-
// runtime.go.cgo.calls - Number of cgo calls made by the current process
21-
// runtime.go.gc.count - Number of completed garbage collection cycles
22-
// runtime.go.gc.pause_ns (ns) Amount of nanoseconds in GC stop-the-world pauses
23-
// runtime.go.gc.pause_total_ns (ns) Cumulative nanoseconds in GC stop-the-world pauses since the program started
24-
// runtime.go.goroutines - Number of goroutines that currently exist
25-
// runtime.go.lookups - Number of pointer lookups performed by the runtime
26-
// runtime.go.mem.heap_alloc (bytes) Bytes of allocated heap objects
27-
// runtime.go.mem.heap_idle (bytes) Bytes in idle (unused) spans
28-
// runtime.go.mem.heap_inuse (bytes) Bytes in in-use spans
29-
// runtime.go.mem.heap_objects - Number of allocated heap objects
30-
// runtime.go.mem.heap_released (bytes) Bytes of idle spans whose physical memory has been returned to the OS
31-
// runtime.go.mem.heap_sys (bytes) Bytes of heap memory obtained from the OS
32-
// runtime.go.mem.live_objects - Number of live objects is the number of cumulative Mallocs - Frees
33-
// runtime.uptime (ms) Milliseconds since application was initialized
345
package runtime // import "go.opentelemetry.io/contrib/instrumentation/runtime"

instrumentation/runtime/producer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ type Producer struct {
3434
var _ metric.Producer = (*Producer)(nil)
3535

3636
// NewProducer creates a Producer which provides precomputed histogram metrics from the go runtime.
37+
//
38+
// Metrics emitted by NewProducer include:
39+
//
40+
// go.schedule.duration s The time goroutines have spent in the scheduler in a runnable state before actually running.
3741
func NewProducer(opts ...ProducerOption) *Producer {
3842
c := newProducerConfig(opts...)
3943
return &Producer{

instrumentation/runtime/runtime.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,35 @@ const (
3737

3838
// Start initializes reporting of runtime metrics using the supplied config.
3939
// For goroutine scheduling metrics, additionally see [NewProducer].
40+
//
41+
// Metrics emitted by Start includes:
42+
//
43+
// go.memory.used By Memory used by the Go runtime.
44+
// go.memory.limit By Go runtime memory limit configured by the user, if a limit exists.
45+
// go.memory.allocated By Memory allocated to the heap by the application.
46+
// go.memory.allocations {allocation} Count of allocations to the heap by the application.
47+
// go.memory.gc.goal By Heap size target for the end of the GC cycle.
48+
// go.goroutine.count {goroutine} Count of live goroutines.
49+
// go.processor.limit {thread} The number of OS threads that can execute user-level Go code simultaneously.
50+
// go.config.gogc % Heap size target percentage configured by the user, otherwise 100.
51+
//
52+
// When the OTEL_GO_X_DEPRECATED_RUNTIME_METRICS environment variable is set to
53+
// true, the following deprecated metrics are produced:
54+
//
55+
// runtime.go.cgo.calls - Number of cgo calls made by the current process
56+
// runtime.go.gc.count - Number of completed garbage collection cycles
57+
// runtime.go.gc.pause_ns (ns) Amount of nanoseconds in GC stop-the-world pauses
58+
// runtime.go.gc.pause_total_ns (ns) Cumulative nanoseconds in GC stop-the-world pauses since the program started
59+
// runtime.go.goroutines - Number of goroutines that currently exist
60+
// runtime.go.lookups - Number of pointer lookups performed by the runtime
61+
// runtime.go.mem.heap_alloc (bytes) Bytes of allocated heap objects
62+
// runtime.go.mem.heap_idle (bytes) Bytes in idle (unused) spans
63+
// runtime.go.mem.heap_inuse (bytes) Bytes in in-use spans
64+
// runtime.go.mem.heap_objects - Number of allocated heap objects
65+
// runtime.go.mem.heap_released (bytes) Bytes of idle spans whose physical memory has been returned to the OS
66+
// runtime.go.mem.heap_sys (bytes) Bytes of heap memory obtained from the OS
67+
// runtime.go.mem.live_objects - Number of live objects is the number of cumulative Mallocs - Frees
68+
// runtime.uptime (ms) Milliseconds since application was initialized
4069
func Start(opts ...Option) error {
4170
c := newConfig(opts...)
4271
meter := c.MeterProvider.Meter(

0 commit comments

Comments
 (0)