Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .chloggen/go-gc-cycles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: go

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Add the opt-in go.memory.gc.cycles metric.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [3353]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
21 changes: 21 additions & 0 deletions docs/runtime/go-metrics.md
Comment thread
lmolkova marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ These metrics are obtained from Go's [`runtime/metrics`][RuntimeMetrics] package
- [Metric: `go.memory.allocations`](#metric-gomemoryallocations)
- [Go garbage collection](#go-garbage-collection)
- [Metric: `go.memory.gc.goal`](#metric-gomemorygcgoal)
- [Metric: `go.memory.gc.cycles`](#metric-gomemorygccycles)
- [Go goroutines](#go-goroutines)
- [Metric: `go.goroutine.count`](#metric-gogoroutinecount)
- [Go processor](#go-processor)
Expand Down Expand Up @@ -149,6 +150,25 @@ This metric is [recommended][MetricRecommended].
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### Metric: `go.memory.gc.cycles`

This metric is [opt-in][MetricOptIn].

<!-- semconv metric.go.memory.gc.cycles -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `go.memory.gc.cycles` | Counter | `{gc_cycle}` | Number of completed GC cycles. [1] | ![Development](https://img.shields.io/badge/-development-blue) | |

**[1]:** Computed from `/gc/cycles/total:gc-cycles`.

Comment thread
dashpole marked this conversation as resolved.
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

## Go goroutines

**Description:** Go metrics captured under the namespace `go.goroutine.*`
Expand Down Expand Up @@ -244,3 +264,4 @@ This metric is [recommended][MetricRecommended].
[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended
[RuntimeMetrics]: https://pkg.go.dev/runtime/metrics
[MetricOptIn]: /docs/general/metric-requirement-level.md#opt-in
13 changes: 13 additions & 0 deletions model/go/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ groups:
unit: "By"
stability: development

- id: metric.go.memory.gc.cycles
type: metric
metric_name: go.memory.gc.cycles
annotations:
code_generation:
metric_value_type: int
brief: "Number of completed GC cycles."
note: >
Computed from `/gc/cycles/total:gc-cycles`.
instrument: counter
unit: "{gc_cycle}"
stability: development

- id: metric.go.goroutine.count
type: metric
metric_name: go.goroutine.count
Expand Down
Loading