Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jvm.cpu.count metric #52

Merged
merged 10 commits into from
Aug 16, 2023
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ release.
([#3458](https://github.com/open-telemetry/opentelemetry-specification/pull/3458))
- Specify the value range for JVM CPU metrics.
([#13](https://github.com/open-telemetry/semantic-conventions/pull/13))
- Add `process.runtime.jvm.available_processors` metric.
([#52](https://github.com/open-telemetry/semantic-conventions/pull/52))
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.available_processors
type: metric
metric_name: process.runtime.jvm.available_processors
brief: "Number of processors available to the Java virtual machine."
instrument: updowncounter
unit: "{processor}"

- id: metric.process.runtime.jvm.cpu.utilization
type: metric
metric_name: process.runtime.jvm.cpu.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.available_processors`](#metric-processruntimejvmavailable_processors)
* [Metric: `process.runtime.jvm.cpu.utilization`](#metric-processruntimejvmcpuutilization)
* [Metric: `process.runtime.jvm.system.cpu.utilization`](#metric-processruntimejvmsystemcpuutilization)
* [Metric: `process.runtime.jvm.system.cpu.load_1m`](#metric-processruntimejvmsystemcpuload_1m)
Expand Down Expand Up @@ -297,6 +298,21 @@ This metric is obtained from [`ClassLoadingMXBean#getLoadedClassCount()`](https:
<!-- semconv metric.process.runtime.jvm.classes.current_loaded(full) -->
<!-- endsemconv -->

### Metric: `process.runtime.jvm.available_processors`
trask marked this conversation as resolved.
Show resolved Hide resolved

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.process.runtime.jvm.available_processors(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `process.runtime.jvm.available_processors` | UpDownCounter | `{processor}` | Number of processors available to the Java virtual machine. |
<!-- endsemconv -->

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

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

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