Skip to content

Commit

Permalink
Add jvm.cpu.count metric (#52)
Browse files Browse the repository at this point in the history
Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
  • Loading branch information
trask and arminru committed Aug 16, 2023
1 parent c83a10a commit 0669ca5
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ release.
- Clarify that `http/dup` has higher precedence than `http` in case both values are present
in `OTEL_SEMCONV_STABILITY_OPT_IN`
([#249](https://github.com/open-telemetry/semantic-conventions/pull/249))
- Add `jvm.cpu.count` metric.
([#52](https://github.com/open-telemetry/semantic-conventions/pull/52))

## v1.21.0 (2023-07-13)

Expand Down
16 changes: 16 additions & 0 deletions docs/system/runtime-environment-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ semantic conventions when instrumenting runtime environments.
* [Metric: `jvm.classes.unloaded`](#metric-jvmclassesunloaded)
* [Metric: `jvm.classes.current_loaded`](#metric-jvmclassescurrent_loaded)
* [Metric: `jvm.cpu.time`](#metric-jvmcputime)
* [Metric: `jvm.cpu.count`](#metric-jvmcpucount)
* [Metric: `jvm.cpu.recent_utilization`](#metric-jvmcpurecent_utilization)
- [JVM Metrics (Experimental)](#jvm-metrics-experimental)
* [Metric: `jvm.memory.init`](#metric-jvmmemoryinit)
Expand Down Expand Up @@ -289,6 +290,21 @@ and [`com.ibm.lang.management.OperatingSystemMXBean#getProcessCpuTime()`](https:
<!-- semconv metric.jvm.cpu.time(full) -->
<!-- endsemconv -->

### Metric: `jvm.cpu.count`

This metric is [recommended][MetricRecommended].
This metric is obtained from [`Runtime#availableProcessors()`](https://docs.oracle.com/javase/8/docs/api/java/lang/Runtime.html#availableProcessors--).
Note that this is always an integer value (i.e. fractional or millicores are not represented).

<!-- semconv metric.jvm.cpu.count(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `jvm.cpu.count` | UpDownCounter | `{cpu}` | Number of processors available to the Java virtual machine. |
<!-- endsemconv -->

<!-- semconv metric.jvm.cpu.count(full) -->
<!-- endsemconv -->

### Metric: `jvm.cpu.recent_utilization`

This metric is [recommended][MetricRecommended].
Expand Down
7 changes: 7 additions & 0 deletions model/metrics/process-runtime-jvm-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ groups:
instrument: updowncounter
unit: "{class}"

- id: metric.jvm.cpu.count
type: metric
metric_name: jvm.cpu.count
brief: "Number of processors available to the Java virtual machine."
instrument: updowncounter
unit: "{cpu}"

- id: metric.jvm.cpu.time
type: metric
metric_name: jvm.cpu.time
Expand Down

0 comments on commit 0669ca5

Please sign in to comment.