Skip to content

Commit 7360346

Browse files
committed
add opt-in go.memory.gc.cycles metric
1 parent a21f24e commit 7360346

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

.chloggen/go-gc-cycles.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 the opt-in go.memory.gc.cycles 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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,25 @@ This metric is [recommended][MetricRecommended].
149149
<!-- END AUTOGENERATED TEXT -->
150150
<!-- endsemconv -->
151151

152+
### Metric: `go.memory.gc.cycles`
153+
154+
This metric is [opt-in][MetricOptIn].
155+
156+
<!-- semconv metric.go.memory.gc.cycles -->
157+
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
158+
<!-- see templates/registry/markdown/snippet.md.j2 -->
159+
<!-- prettier-ignore-start -->
160+
161+
| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
162+
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
163+
| `go.memory.gc.cycles` | Counter | `{gc_cycle}` | Number of completed GC cycles. [1] | ![Development](https://img.shields.io/badge/-development-blue) | |
164+
165+
**[1]:** Computed from `/gc/cycles/total:gc-cycles`.
166+
167+
<!-- prettier-ignore-end -->
168+
<!-- END AUTOGENERATED TEXT -->
169+
<!-- endsemconv -->
170+
152171
## Go goroutines
153172

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

model/go/metrics.yaml

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

71+
- id: metric.go.memory.gc.cycles
72+
type: metric
73+
metric_name: go.memory.gc.cycles
74+
annotations:
75+
code_generation:
76+
metric_value_type: int
77+
brief: "Number of completed GC cycles."
78+
note: >
79+
Computed from `/gc/cycles/total:gc-cycles`.
80+
instrument: counter
81+
unit: "{gc_cycle}"
82+
stability: development
83+
7184
- id: metric.go.goroutine.count
7285
type: metric
7386
metric_name: go.goroutine.count

0 commit comments

Comments
 (0)