Skip to content

Commit

Permalink
add go.goroutine.count
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed May 21, 2024
1 parent 9d185f2 commit 79493af
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/runtime/go-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,26 @@ This metric is obtained from Go's [`runtime/metrics`][RuntimeMetrics] package us
<!-- semconv metric.go.memory.gc.user_goal(full) -->
<!-- endsemconv -->

## Go Goroutines

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

### Metric: `go.goroutine.count`

This metric is [recommended][MetricRecommended].
This metric is obtained from Go's [`runtime/metrics`][RuntimeMetrics] package `/sched/gomaxprocs:threads`.

<!-- semconv metric.go.goroutine.count(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description | Stability |
| -------- | --------------- | ----------- | -------------- | --------- |
| `go.goroutine.count` | UpDownCounter | `{goroutine}` | Count of live goroutines. [1] | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1]:** Computed from `/sched/goroutines:goroutines`.
<!-- endsemconv -->

<!-- semconv metric.go.goroutine.count(full) -->
<!-- endsemconv -->

## Go Threads

**Description:** Go metrics captured under the namespace `go.thread.*`
Expand Down
10 changes: 10 additions & 0 deletions model/metrics/go-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ groups:
Computed from /gc/gogc:percent.
stability: experimental

- id: metric.go.goroutine.count
type: metric
metric_name: go.goroutine.count
brief: "Count of live goroutines."
note: >
Computed from `/sched/goroutines:goroutines`.
instrument: updowncounter
unit: "{goroutine}"
stability: experimental

- id: metric.go.thread.limit
type: metric
metric_name: go.thread.limit
Expand Down

0 comments on commit 79493af

Please sign in to comment.