Skip to content

Commit

Permalink
Remove pluralization from JVM metric namespaces (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
trask authored Aug 17, 2023
1 parent a42aecc commit 098db1c
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 33 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ release.
([#253](https://github.com/open-telemetry/semantic-conventions/pull/253))
- BREAKING: Rename `jvm.classes.current_loaded` metrics to `jvm.classes.count`
([#60](https://github.com/open-telemetry/semantic-conventions/pull/60))
- BREAKING: Remove pluralization from JVM metric namespaces.
([#252](https://github.com/open-telemetry/semantic-conventions/pull/252))

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

Expand Down
40 changes: 20 additions & 20 deletions docs/system/runtime-environment-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ semantic conventions when instrumenting runtime environments.
* [Metric: `jvm.memory.limit`](#metric-jvmmemorylimit)
* [Metric: `jvm.memory.usage_after_last_gc`](#metric-jvmmemoryusage_after_last_gc)
* [Metric: `jvm.gc.duration`](#metric-jvmgcduration)
* [Metric: `jvm.threads.count`](#metric-jvmthreadscount)
* [Metric: `jvm.classes.loaded`](#metric-jvmclassesloaded)
* [Metric: `jvm.classes.unloaded`](#metric-jvmclassesunloaded)
* [Metric: `jvm.classes.count`](#metric-jvmclassescount)
* [Metric: `jvm.thread.count`](#metric-jvmthreadcount)
* [Metric: `jvm.class.loaded`](#metric-jvmclassloaded)
* [Metric: `jvm.class.unloaded`](#metric-jvmclassunloaded)
* [Metric: `jvm.class.count`](#metric-jvmclasscount)
* [Metric: `jvm.cpu.time`](#metric-jvmcputime)
* [Metric: `jvm.cpu.count`](#metric-jvmcpucount)
* [Metric: `jvm.cpu.recent_utilization`](#metric-jvmcpurecent_utilization)
Expand Down Expand Up @@ -213,65 +213,65 @@ of `[]` (single bucket histogram capturing count, sum, min, max).
**[2]:** Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()).
<!-- endsemconv -->

### Metric: `jvm.threads.count`
### Metric: `jvm.thread.count`

This metric is [recommended][MetricRecommended].
This metric is obtained from [`ThreadMXBean#getDaemonThreadCount()`](https://docs.oracle.com/javase/8/docs/api/java/lang/management/ThreadMXBean.html#getDaemonThreadCount--) and
[`ThreadMXBean#getThreadCount()`](https://docs.oracle.com/javase/8/docs/api/java/lang/management/ThreadMXBean.html#getThreadCount--).
Note that this is the number of platform threads (as opposed to virtual threads).

<!-- semconv metric.jvm.threads.count(metric_table) -->
<!-- semconv metric.jvm.thread.count(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `jvm.threads.count` | UpDownCounter | `{thread}` | Number of executing platform threads. |
| `jvm.thread.count` | UpDownCounter | `{thread}` | Number of executing platform threads. |
<!-- endsemconv -->

<!-- semconv metric.jvm.threads.count(full) -->
<!-- semconv metric.jvm.thread.count(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| [`thread.daemon`](../general/attributes.md) | boolean | Whether the thread is daemon or not. | | Recommended |
<!-- endsemconv -->

### Metric: `jvm.classes.loaded`
### Metric: `jvm.class.loaded`

This metric is [recommended][MetricRecommended].
This metric is obtained from [`ClassLoadingMXBean#getTotalLoadedClassCount()`](https://docs.oracle.com/javase/8/docs/api/java/lang/management/ClassLoadingMXBean.html#getTotalLoadedClassCount--).

<!-- semconv metric.jvm.classes.loaded(metric_table) -->
<!-- semconv metric.jvm.class.loaded(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `jvm.classes.loaded` | Counter | `{class}` | Number of classes loaded since JVM start. |
| `jvm.class.loaded` | Counter | `{class}` | Number of classes loaded since JVM start. |
<!-- endsemconv -->

<!-- semconv metric.jvm.classes.loaded(full) -->
<!-- semconv metric.jvm.class.loaded(full) -->
<!-- endsemconv -->

### Metric: `jvm.classes.unloaded`
### Metric: `jvm.class.unloaded`

This metric is [recommended][MetricRecommended].
This metric is obtained from [`ClassLoadingMXBean#getUnloadedClassCount()`](https://docs.oracle.com/javase/8/docs/api/java/lang/management/ClassLoadingMXBean.html#getUnloadedClassCount--).

<!-- semconv metric.jvm.classes.unloaded(metric_table) -->
<!-- semconv metric.jvm.class.unloaded(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `jvm.classes.unloaded` | Counter | `{class}` | Number of classes unloaded since JVM start. |
| `jvm.class.unloaded` | Counter | `{class}` | Number of classes unloaded since JVM start. |
<!-- endsemconv -->

<!-- semconv metric.jvm.classes.unloaded(full) -->
<!-- semconv metric.jvm.class.unloaded(full) -->
<!-- endsemconv -->

### Metric: `jvm.classes.count`
### Metric: `jvm.class.count`

This metric is [recommended][MetricRecommended].
This metric is obtained from [`ClassLoadingMXBean#getLoadedClassCount()`](https://docs.oracle.com/javase/8/docs/api/java/lang/management/ClassLoadingMXBean.html#getLoadedClassCount--).

<!-- semconv metric.jvm.classes.count(metric_table) -->
<!-- semconv metric.jvm.class.count(metric_table) -->
| Name | Instrument Type | Unit (UCUM) | Description |
| -------- | --------------- | ----------- | -------------- |
| `jvm.classes.count` | UpDownCounter | `{class}` | Number of classes currently loaded. |
| `jvm.class.count` | UpDownCounter | `{class}` | Number of classes currently loaded. |
<!-- endsemconv -->

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

### Metric: `jvm.cpu.time`
Expand Down
16 changes: 8 additions & 8 deletions model/metrics/process-runtime-jvm-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,33 +83,33 @@ groups:
Garbage collector action is generally obtained via
[GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()).
- id: metric.jvm.threads.count
- id: metric.jvm.thread.count
type: metric
metric_name: jvm.threads.count
metric_name: jvm.thread.count
brief: "Number of executing platform threads."
instrument: updowncounter
unit: "{thread}"
attributes:
- ref: thread.daemon
requirement_level: recommended

- id: metric.jvm.classes.loaded
- id: metric.jvm.class.loaded
type: metric
metric_name: jvm.classes.loaded
metric_name: jvm.class.loaded
brief: "Number of classes loaded since JVM start."
instrument: counter
unit: "{class}"

- id: metric.jvm.classes.unloaded
- id: metric.jvm.class.unloaded
type: metric
metric_name: jvm.classes.unloaded
metric_name: jvm.class.unloaded
brief: "Number of classes unloaded since JVM start."
instrument: counter
unit: "{class}"

- id: metric.jvm.classes.count
- id: metric.jvm.class.count
type: metric
metric_name: jvm.classes.count
metric_name: jvm.class.count
brief: "Number of classes currently loaded."
instrument: updowncounter
unit: "{class}"
Expand Down
14 changes: 9 additions & 5 deletions schema-next.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ versions:
process.runtime.jvm.memory.limit: jvm.memory.limit
process.runtime.jvm.memory.usage_after_last_gc: jvm.memory.usage_after_last_gc
process.runtime.jvm.gc.duration: jvm.gc.duration
process.runtime.jvm.threads.count: jvm.threads.count
process.runtime.jvm.classes.loaded: jvm.classes.loaded
process.runtime.jvm.classes.unloaded: jvm.classes.unloaded
# https://github.com/open-telemetry/semantic-conventions/pull/60
process.runtime.jvm.classes.current_loaded: jvm.classes.count
# also https://github.com/open-telemetry/semantic-conventions/pull/252
process.runtime.jvm.threads.count: jvm.thread.count
# also https://github.com/open-telemetry/semantic-conventions/pull/252
process.runtime.jvm.classes.loaded: jvm.class.loaded
# also https://github.com/open-telemetry/semantic-conventions/pull/252
process.runtime.jvm.classes.unloaded: jvm.class.unloaded
# also https://github.com/open-telemetry/semantic-conventions/pull/252
# and https://github.com/open-telemetry/semantic-conventions/pull/60
process.runtime.jvm.classes.current_loaded: jvm.class.count
process.runtime.jvm.cpu.time: jvm.cpu.time
process.runtime.jvm.cpu.recent_utilization: jvm.cpu.recent_utilization
process.runtime.jvm.memory.init: jvm.memory.init
Expand Down

0 comments on commit 098db1c

Please sign in to comment.