Skip to content

Commit

Permalink
change user_goal to go.config.gogc
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed May 1, 2024
1 parent a98c362 commit a0a8155
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 27 deletions.
37 changes: 21 additions & 16 deletions docs/runtime/go-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ 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.user_goal`](#metric-gomemorygcuser_goal)
- [Go Goroutines](#go-goroutines)
- [Metric: `go.goroutine.count`](#metric-gogoroutinecount)
- [Go Threads](#go-threads)
- [Metric: `go.thread.limit`](#metric-gothreadlimit)
- [Go Scheduler](#go-scheduler)
- [Metric: `go.schedule.duration`](#metric-goscheduleduration)
- [Go Runtime Configuration](#go-runtime-configuration)
- [Metric: `go.config.gogc`](#metric-goconfiggogc)

<!-- tocstop -->

Expand Down Expand Up @@ -141,21 +142,6 @@ This metric is [recommended][MetricRecommended].
<!-- semconv metric.go.memory.gc.goal(full) -->
<!-- endsemconv -->

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

This metric is [recommended][MetricRecommended].

<!-- semconv metric.go.memory.gc.user_goal(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
| -------- | --------------- | ----------- | -------------- | --------- |
| `go.memory.gc.user_goal` | UpDownCounter | `1` | Heap size target ratio for the end of the GC cycle, as configured by the user. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1]:** The value range is [0.0,1.0]. Computed from `/gc/gogc:percent`.
<!-- endsemconv -->

<!-- semconv metric.go.memory.gc.user_goal(full) -->
<!-- endsemconv -->

## Go Goroutines

**Description:** Go metrics captured under the namespace `go.goroutine.*`
Expand Down Expand Up @@ -213,6 +199,25 @@ This metric is [recommended][MetricRecommended].
<!-- semconv metric.go.schedule.duration(full) -->
<!-- endsemconv -->

## Go Runtime Configuration

**Description:** Go metrics captured under the namespace `go.config.*`

### Metric: `go.config.gogc`

This metric is [recommended][MetricRecommended].

<!-- semconv metric.go.config.gogc(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
| -------- | --------------- | ----------- | -------------- | --------- |
| `go.config.gogc` | Histogram | `%` | Heap size target percentage configured by the user, otherwise 100. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1]:** The value range is [0.0,100.0]. Computed from `/gc/gogc:percent`.
<!-- endsemconv -->

<!-- semconv metric.go.config.gogc(full) -->
<!-- endsemconv -->

[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.31.0/specification/document-status.md
[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended
[RuntimeMetrics]: https://pkg.go.dev/runtime/metrics
22 changes: 11 additions & 11 deletions model/metrics/go-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,6 @@ groups:
unit: "By"
stability: experimental

- id: metric.go.memory.gc.user_goal
type: metric
metric_name: go.memory.gc.user_goal
brief: "Heap size target ratio for the end of the GC cycle, as configured by the user."
instrument: updowncounter
unit: "1"
note: >
The value range is [0.0,1.0].
Computed from `/gc/gogc:percent`.
stability: experimental

- id: metric.go.goroutine.count
type: metric
metric_name: go.goroutine.count
Expand Down Expand Up @@ -120,3 +109,14 @@ groups:
instrument: histogram
unit: "s"
stability: experimental

- id: metric.go.config.gogc
type: metric
metric_name: go.config.gogc
brief: "Heap size target percentage configured by the user, otherwise 100."
note: >
The value range is [0.0,100.0].
Computed from `/gc/gogc:percent`.
instrument: histogram
unit: "%"
stability: experimental

0 comments on commit a0a8155

Please sign in to comment.