Skip to content

Commit

Permalink
Mark JVM metrics stable (open-telemetry#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
trask authored and pyohannes committed Jan 17, 2024
1 parent dc8b8c1 commit f834226
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 18 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ release.
([#163](https://github.com/open-telemetry/semantic-conventions/pull/163))
- Add .NET 8.0 metrics for HTTP client, ASP.NET Core, SignalR server and Kestrel.
([#283](https://github.com/open-telemetry/semantic-conventions/pull/283))
- JVM metrics marked stable
([#569](https://github.com/open-telemetry/semantic-conventions/pull/569))

### Fixes

Expand Down
44 changes: 26 additions & 18 deletions docs/runtime/jvm-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ linkTitle: Runtime Environment

# Semantic Conventions for JVM Metrics

**Status**: [Experimental][DocumentStatus]
**Status**: [Mixed][DocumentStatus]

This document describes semantic conventions for JVM metrics in OpenTelemetry.

Expand All @@ -29,7 +29,7 @@ This document describes semantic conventions for JVM metrics in OpenTelemetry.
* [Metric: `jvm.cpu.time`](#metric-jvmcputime)
* [Metric: `jvm.cpu.count`](#metric-jvmcpucount)
* [Metric: `jvm.cpu.recent_utilization`](#metric-jvmcpurecent_utilization)
- [Very experimental](#very-experimental)
- [Experimental](#experimental)
* [Metric: `jvm.memory.init`](#metric-jvmmemoryinit)
* [Metric: `jvm.system.cpu.utilization`](#metric-jvmsystemcpuutilization)
* [Metric: `jvm.system.cpu.load_1m`](#metric-jvmsystemcpuload_1m)
Expand All @@ -41,6 +41,8 @@ This document describes semantic conventions for JVM metrics in OpenTelemetry.

## JVM Memory

**Status**: [Stable][DocumentStatus]

**Description:** Java Virtual Machine (JVM) metrics captured under the namespace `jvm.memory.*`

### Metric: `jvm.memory.used`
Expand All @@ -57,8 +59,8 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle
<!-- semconv metric.jvm.memory.used(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `jvm.memory.pool.name` | string | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | Recommended |
| `jvm.memory.type` | string | The type of memory. | `heap`; `non_heap` | Recommended |
| `jvm.memory.pool.name` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | Recommended |
| `jvm.memory.type` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>The type of memory. | `heap`; `non_heap` | Recommended |

**[1]:** Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).

Expand All @@ -84,8 +86,8 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle
<!-- semconv metric.jvm.memory.committed(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `jvm.memory.pool.name` | string | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | Recommended |
| `jvm.memory.type` | string | The type of memory. | `heap`; `non_heap` | Recommended |
| `jvm.memory.pool.name` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | Recommended |
| `jvm.memory.type` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>The type of memory. | `heap`; `non_heap` | Recommended |

**[1]:** Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).

Expand All @@ -111,8 +113,8 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle
<!-- semconv metric.jvm.memory.limit(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `jvm.memory.pool.name` | string | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | Recommended |
| `jvm.memory.type` | string | The type of memory. | `heap`; `non_heap` | Recommended |
| `jvm.memory.pool.name` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | Recommended |
| `jvm.memory.type` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>The type of memory. | `heap`; `non_heap` | Recommended |

**[1]:** Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).

Expand All @@ -138,8 +140,8 @@ This metric is obtained from [`MemoryPoolMXBean#getCollectionUsage()`](https://d
<!-- semconv metric.jvm.memory.used_after_last_gc(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `jvm.memory.pool.name` | string | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | Recommended |
| `jvm.memory.type` | string | The type of memory. | `heap`; `non_heap` | Recommended |
| `jvm.memory.pool.name` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | Recommended |
| `jvm.memory.type` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>The type of memory. | `heap`; `non_heap` | Recommended |

**[1]:** Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).

Expand All @@ -153,6 +155,8 @@ This metric is obtained from [`MemoryPoolMXBean#getCollectionUsage()`](https://d

## JVM Garbage Collection

**Status**: [Stable][DocumentStatus]

**Description:** Java Virtual Machine (JVM) metrics captured under the namespace `jvm.gc.*`

### Metric: `jvm.gc.duration`
Expand All @@ -174,8 +178,8 @@ of `[ 0.01, 0.1, 1, 10 ]`.
<!-- semconv metric.jvm.gc.duration(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `jvm.gc.action` | string | Name of the garbage collector action. [1] | `end of minor GC`; `end of major GC` | Recommended |
| `jvm.gc.name` | string | Name of the garbage collector. [2] | `G1 Young Generation`; `G1 Old Generation` | Recommended |
| `jvm.gc.action` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>Name of the garbage collector action. [1] | `end of minor GC`; `end of major GC` | Recommended |
| `jvm.gc.name` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>Name of the garbage collector. [2] | `G1 Young Generation`; `G1 Old Generation` | Recommended |

**[1]:** 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()).

Expand Down Expand Up @@ -207,8 +211,8 @@ Note that this is the number of platform threads (as opposed to virtual threads)
<!-- semconv metric.jvm.thread.count(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `jvm.thread.daemon` | boolean | Whether the thread is daemon or not. | | Recommended |
| `jvm.thread.state` | string | State of the thread. | `runnable`; `blocked` | Recommended |
| `jvm.thread.daemon` | boolean | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>Whether the thread is daemon or not. | | Recommended |
| `jvm.thread.state` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>State of the thread. | `runnable`; `blocked` | Recommended |

`jvm.thread.state` MUST be one of the following:

Expand Down Expand Up @@ -270,6 +274,8 @@ This metric is obtained from [`ClassLoadingMXBean#getLoadedClassCount()`](https:

## JVM CPU

**Status**: [Stable][DocumentStatus]

**Description:** Java Virtual Machine (JVM) metrics captured under the namespace `jvm.cpu.*`

### Metric: `jvm.cpu.time`
Expand Down Expand Up @@ -321,9 +327,11 @@ Note that the JVM does not provide a definition of what "recent" means.
<!-- semconv metric.jvm.cpu.recent_utilization(full) -->
<!-- endsemconv -->

## Very experimental
## Experimental

**Status**: [Experimental][DocumentStatus]

**Description:** Very experimental Java Virtual Machine (JVM) metrics captured under `jvm.`
**Description:** Experimental Java Virtual Machine (JVM) metrics captured under `jvm.`

### Metric: `jvm.memory.init`

Expand All @@ -339,8 +347,8 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle
<!-- semconv metric.jvm.memory.init(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `jvm.memory.pool.name` | string | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | Recommended |
| `jvm.memory.type` | string | The type of memory. | `heap`; `non_heap` | Recommended |
| `jvm.memory.pool.name` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | Recommended |
| `jvm.memory.type` | string | ![Stable](https://img.shields.io/badge/-stable-lightgreen)<br>The type of memory. | `heap`; `non_heap` | Recommended |

**[1]:** Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).

Expand Down
6 changes: 6 additions & 0 deletions model/metrics/jvm-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ groups:
prefix: jvm.memory
attributes:
- id: type
stability: stable
type:
allow_custom_values: false
members:
Expand All @@ -18,6 +19,7 @@ groups:
brief: The type of memory.
examples: ["heap", "non_heap"]
- id: pool.name
stability: stable
type: string
requirement_level: recommended
brief: Name of the memory pool.
Expand Down Expand Up @@ -67,6 +69,7 @@ groups:
prefix: jvm.gc
attributes:
- id: name
stability: stable
type: string
requirement_level: recommended
brief: Name of the garbage collector.
Expand All @@ -75,6 +78,7 @@ groups:
Garbage collector name is generally obtained via
[GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()).
- id: action
stability: stable
type: string
requirement_level: recommended
brief: Name of the garbage collector action.
Expand All @@ -91,10 +95,12 @@ groups:
unit: "{thread}"
attributes:
- id: jvm.thread.daemon
stability: stable
type: boolean
requirement_level: recommended
brief: "Whether the thread is daemon or not."
- id: jvm.thread.state
stability: stable
requirement_level: recommended
type:
allow_custom_values: false
Expand Down

0 comments on commit f834226

Please sign in to comment.