Skip to content

Commit

Permalink
Add process.runtime.jvm.cpu.time metric (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
trask authored Jun 14, 2023
1 parent f07495d commit 8f9fbdf
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,5 @@ release.
([#70](https://github.com/open-telemetry/semantic-conventions/pull/70))
- Clarify that OTEL_SEMCONV_STABILITY_OPT_IN is a comma-separated list of values
([#104](https://github.com/open-telemetry/semantic-conventions/pull/104))
- Add `process.runtime.jvm.cpu.time` metric.
([#55](https://github.com/open-telemetry/semantic-conventions/pull/55))
7 changes: 7 additions & 0 deletions semantic_conventions/metrics/process-runtime-jvm-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,13 @@ groups:
instrument: updowncounter
unit: "{class}"

- id: metric.process.runtime.jvm.cpu.time
type: metric
metric_name: process.runtime.jvm.cpu.time
brief: "CPU time used by the process."
instrument: counter
unit: "s"

- id: metric.process.runtime.jvm.cpu.recent_utilization
type: metric
metric_name: process.runtime.jvm.cpu.recent_utilization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ semantic conventions when instrumenting runtime environments.
* [Metric: `process.runtime.jvm.classes.loaded`](#metric-processruntimejvmclassesloaded)
* [Metric: `process.runtime.jvm.classes.unloaded`](#metric-processruntimejvmclassesunloaded)
* [Metric: `process.runtime.jvm.classes.current_loaded`](#metric-processruntimejvmclassescurrent_loaded)
* [Metric: `process.runtime.jvm.cpu.time`](#metric-processruntimejvmcputime)
* [Metric: `process.runtime.jvm.cpu.recent_utilization`](#metric-processruntimejvmcpurecent_utilization)
* [Metric: `process.runtime.jvm.system.cpu.utilization`](#metric-processruntimejvmsystemcpuutilization)
* [Metric: `process.runtime.jvm.system.cpu.load_1m`](#metric-processruntimejvmsystemcpuload_1m)
Expand Down Expand Up @@ -298,6 +299,22 @@ This metric is obtained from [`ClassLoadingMXBean#getLoadedClassCount()`](https:
<!-- semconv metric.process.runtime.jvm.classes.current_loaded(full) -->
<!-- endsemconv -->

### Metric: `process.runtime.jvm.cpu.time`

This metric is [recommended][MetricRecommended].

This metric is obtained from [`com.sun.management.OperatingSystemMXBean#getProcessCpuTime()`](https://docs.oracle.com/en/java/javase/17/docs/api/jdk.management/com/sun/management/OperatingSystemMXBean.html#getProcessCpuTime()) on HotSpot
and [`com.ibm.lang.management.OperatingSystemMXBean#getProcessCpuTime()`](https://www.ibm.com/docs/api/v1/content/SSYKE2_8.0.0/openj9/api/jdk8/jre/management/extension/com/ibm/lang/management/OperatingSystemMXBean.html#getProcessCpuTime--) on J9.

<!-- semconv metric.process.runtime.jvm.cpu.time(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `process.runtime.jvm.cpu.time` | Counter | `s` | CPU time used by the process. |
<!-- endsemconv -->

<!-- semconv metric.process.runtime.jvm.cpu.time(full) -->
<!-- endsemconv -->

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

This metric is [recommended][MetricRecommended].
Expand Down

0 comments on commit 8f9fbdf

Please sign in to comment.