Skip to content

Commit f0e3ae4

Browse files
committed
Add opt-in go.memory.gc.pause.duration histogram metric
1 parent a21f24e commit f0e3ae4

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

.chloggen/go-gc-duration.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Use this changelog template to create an entry for release notes.
2+
#
3+
# If your change doesn't affect end users you should instead start
4+
# your pull request title with [chore] or use the "Skip Changelog" label.
5+
6+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
7+
change_type: enhancement
8+
9+
# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
10+
component: Go
11+
12+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
13+
note: Add opt-in go.memory.gc.pause.duration histogram metric.
14+
15+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
16+
# The values here must be integers.
17+
issues: [3353]
18+
19+
# (Optional) One or more lines of additional information to render under the primary note.
20+
# These lines will be padded with 2 spaces and then inserted directly into the document.
21+
# Use pipe (|) for multiline entries.
22+
subtext:

docs/runtime/go-metrics.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ These metrics are obtained from Go's [`runtime/metrics`][RuntimeMetrics] package
1818
- [Metric: `go.memory.allocations`](#metric-gomemoryallocations)
1919
- [Go garbage collection](#go-garbage-collection)
2020
- [Metric: `go.memory.gc.goal`](#metric-gomemorygcgoal)
21+
- [Metric: `go.memory.gc.pause.duration`](#metric-gomemorygcpauseduration)
2122
- [Go goroutines](#go-goroutines)
2223
- [Metric: `go.goroutine.count`](#metric-gogoroutinecount)
2324
- [Go processor](#go-processor)
@@ -149,6 +150,25 @@ This metric is [recommended][MetricRecommended].
149150
<!-- END AUTOGENERATED TEXT -->
150151
<!-- endsemconv -->
151152

153+
### Metric: `go.memory.gc.pause.duration`
154+
155+
This metric is [opt-in][MetricOptIn].
156+
157+
<!-- semconv metric.go.memory.gc.pause.duration -->
158+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
159+
<!-- see templates/registry/markdown/snippet.md.j2 -->
160+
<!-- prettier-ignore-start -->
161+
162+
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
163+
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
164+
| `go.memory.gc.pause.duration` | Histogram | `s` | Distribution of individual GC-related stop-the-world pause latencies. This is the time from deciding to stop the world until the world is started again. [1] | ![Development](https://img.shields.io/badge/-development-blue) | |
165+
166+
**[1]:** Computed from `/sched/pauses/total/gc:seconds`. Bucket boundaries are provided by the runtime, and are subject to change.
167+
168+
<!-- prettier-ignore-end -->
169+
<!-- END AUTOGENERATED TEXT -->
170+
<!-- endsemconv -->
171+
152172
## Go goroutines
153173

154174
**Description:** Go metrics captured under the namespace `go.goroutine.*`
@@ -244,3 +264,4 @@ This metric is [recommended][MetricRecommended].
244264
[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status
245265
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended
246266
[RuntimeMetrics]: https://pkg.go.dev/runtime/metrics
267+
[MetricOptIn]: /docs/general/metric-requirement-level.md#opt-in

model/go/metrics.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,20 @@ groups:
6868
unit: "By"
6969
stability: development
7070

71+
- id: metric.go.memory.gc.pause.duration
72+
type: metric
73+
metric_name: go.memory.gc.pause.duration
74+
annotations:
75+
code_generation:
76+
metric_value_type: double
77+
brief: "Distribution of individual GC-related stop-the-world pause latencies. This is the time from deciding to stop the world until the world is started again."
78+
note: >
79+
Computed from `/sched/pauses/total/gc:seconds`.
80+
Bucket boundaries are provided by the runtime, and are subject to change.
81+
instrument: histogram
82+
unit: "s"
83+
stability: development
84+
7185
- id: metric.go.goroutine.count
7286
type: metric
7387
metric_name: go.goroutine.count

0 commit comments

Comments
 (0)