Skip to content

Commit

Permalink
Move JVM attribtues to registry. (#979)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexandra Konrad <[email protected]>
  • Loading branch information
jsuereth and trisch-me authored Apr 29, 2024
1 parent 37a7942 commit b4a04fd
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 87 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ body:
- area:heroku
- area:host
- area:http
- area:jvm
- area:k8s
- area:log
- area:messaging
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/change_proposal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ body:
- area:heroku
- area:host
- area:http
- area:jvm
- area:k8s
- area:log
- area:messaging
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/new-conventions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ body:
- area:heroku
- area:host
- area:http
- area:jvm
- area:k8s
- area:log
- area:messaging
Expand Down
1 change: 1 addition & 0 deletions docs/attributes-registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Currently, the following namespaces exist:
* [Host](host.md)
* [HTTP](http.md)
* [iOS](ios.md)
* [JVM](jvm.md)
* [K8s](k8s.md)
* [Log](log.md)
* [Network](network.md)
Expand Down
44 changes: 44 additions & 0 deletions docs/attributes-registry/jvm.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# JVM

<!-- toc -->

- [JVM Attributes](#jvm-attributes)

<!-- tocstop -->

## JVM Attributes

<!-- semconv registry.jvm(omit_requirement_level) -->
| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| `jvm.gc.action` | string | Name of the garbage collector action. [1] | `end of minor GC`; `end of major GC` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `jvm.gc.name` | string | Name of the garbage collector. [2] | `G1 Young Generation`; `G1 Old Generation` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `jvm.memory.pool.name` | string | Name of the memory pool. [3] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `jvm.memory.type` | string | The type of memory. | `heap`; `non_heap` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `jvm.thread.daemon` | boolean | Whether the thread is daemon or not. | | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `jvm.thread.state` | string | State of the thread. | `runnable`; `blocked` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

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

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

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

`jvm.memory.type` MUST be one of the following:

| Value | Description | Stability |
|---|---|---|
| `heap` | Heap memory. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `non_heap` | Non-heap memory | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

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

| Value | Description | Stability |
|---|---|---|
| `new` | A thread that has not yet started is in this state. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `runnable` | A thread executing in the Java virtual machine is in this state. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `blocked` | A thread that is blocked waiting for a monitor lock is in this state. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `waiting` | A thread that is waiting indefinitely for another thread to perform a particular action is in this state. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `timed_waiting` | A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `terminated` | A thread that has exited is in this state. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
<!-- endsemconv -->
28 changes: 14 additions & 14 deletions docs/runtime/jvm-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,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](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| `jvm.memory.pool.name` | string | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `jvm.memory.type` | string | The type of memory. | `heap`; `non_heap` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`jvm.memory.pool.name`](../attributes-registry/jvm.md) | string | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`jvm.memory.type`](../attributes-registry/jvm.md) | string | The type of memory. | `heap`; `non_heap` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[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 @@ -86,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](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| `jvm.memory.pool.name` | string | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `jvm.memory.type` | string | The type of memory. | `heap`; `non_heap` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`jvm.memory.pool.name`](../attributes-registry/jvm.md) | string | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`jvm.memory.type`](../attributes-registry/jvm.md) | string | The type of memory. | `heap`; `non_heap` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[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 @@ -113,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](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| `jvm.memory.pool.name` | string | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `jvm.memory.type` | string | The type of memory. | `heap`; `non_heap` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`jvm.memory.pool.name`](../attributes-registry/jvm.md) | string | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`jvm.memory.type`](../attributes-registry/jvm.md) | string | The type of memory. | `heap`; `non_heap` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[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 @@ -140,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](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| `jvm.memory.pool.name` | string | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `jvm.memory.type` | string | The type of memory. | `heap`; `non_heap` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`jvm.memory.pool.name`](../attributes-registry/jvm.md) | string | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`jvm.memory.type`](../attributes-registry/jvm.md) | string | The type of memory. | `heap`; `non_heap` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[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 Expand Up @@ -178,8 +178,8 @@ of `[ 0.01, 0.1, 1, 10 ]`.
<!-- semconv metric.jvm.gc.duration(full) -->
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| `jvm.gc.action` | string | Name of the garbage collector action. [1] | `end of minor GC`; `end of major GC` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `jvm.gc.name` | string | Name of the garbage collector. [2] | `G1 Young Generation`; `G1 Old Generation` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`jvm.gc.action`](../attributes-registry/jvm.md) | string | Name of the garbage collector action. [1] | `end of minor GC`; `end of major GC` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`jvm.gc.name`](../attributes-registry/jvm.md) | string | Name of the garbage collector. [2] | `G1 Young Generation`; `G1 Old Generation` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[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 @@ -213,8 +213,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](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| `jvm.thread.daemon` | boolean | Whether the thread is daemon or not. | | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `jvm.thread.state` | string | State of the thread. | `runnable`; `blocked` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`jvm.thread.daemon`](../attributes-registry/jvm.md) | boolean | Whether the thread is daemon or not. | | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`jvm.thread.state`](../attributes-registry/jvm.md) | string | State of the thread. | `runnable`; `blocked` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

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

Expand Down Expand Up @@ -351,8 +351,8 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle
<!-- semconv metric.jvm.memory.init(full) -->
| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability |
|---|---|---|---|---|---|
| `jvm.memory.pool.name` | string | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `jvm.memory.type` | string | The type of memory. | `heap`; `non_heap` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`jvm.memory.pool.name`](../attributes-registry/jvm.md) | string | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`jvm.memory.type`](../attributes-registry/jvm.md) | string | The type of memory. | `heap`; `non_heap` | `Recommended` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[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
79 changes: 6 additions & 73 deletions model/metrics/jvm-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,11 @@ groups:
brief: "Describes JVM memory metric attributes."
prefix: jvm.memory
attributes:
- id: type
stability: stable
type:
allow_custom_values: false
members:
- id: heap
value: 'heap'
brief: 'Heap memory.'
stability: stable
- id: non_heap
value: 'non_heap'
brief: 'Non-heap memory'
stability: stable
- ref: jvm.memory.type
requirement_level: recommended
brief: The type of memory.
examples: ["heap", "non_heap"]
- id: pool.name
stability: stable
type: string
- ref: jvm.memory.pool.name
requirement_level: recommended
brief: Name of the memory pool.
examples: ["G1 Old Gen", "G1 Eden space", "G1 Survivor Space"]
note: >
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()).

- id: metric.jvm.memory.used
type: metric
Expand Down Expand Up @@ -74,24 +54,10 @@ groups:
unit: "s"
prefix: jvm.gc
attributes:
- id: name
stability: stable
type: string
- ref: jvm.gc.name
requirement_level: recommended
brief: Name of the garbage collector.
examples: ["G1 Young Generation", "G1 Old Generation"]
note: >
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
- ref: jvm.gc.action
requirement_level: recommended
brief: Name of the garbage collector action.
examples: ["end of minor GC", "end of major GC"]
note: >
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()).
stability: stable

- id: metric.jvm.thread.count
Expand All @@ -101,43 +67,10 @@ groups:
instrument: updowncounter
unit: "{thread}"
attributes:
- id: jvm.thread.daemon
stability: stable
type: boolean
- ref: jvm.thread.daemon
requirement_level: recommended
brief: "Whether the thread is daemon or not."
- id: jvm.thread.state
stability: stable
- ref: jvm.thread.state
requirement_level: recommended
type:
allow_custom_values: false
members:
- id: new
value: 'new'
brief: 'A thread that has not yet started is in this state.'
stability: stable
- id: runnable
value: 'runnable'
brief: 'A thread executing in the Java virtual machine is in this state.'
stability: stable
- id: blocked
value: 'blocked'
brief: 'A thread that is blocked waiting for a monitor lock is in this state.'
stability: stable
- id: waiting
value: 'waiting'
brief: 'A thread that is waiting indefinitely for another thread to perform a particular action is in this state.'
stability: stable
- id: timed_waiting
value: 'timed_waiting'
brief: 'A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state.'
stability: stable
- id: terminated
value: 'terminated'
brief: 'A thread that has exited is in this state.'
stability: stable
brief: "State of the thread."
examples: ["runnable", "blocked"]
stability: stable

- id: metric.jvm.class.loaded
Expand Down
Loading

0 comments on commit b4a04fd

Please sign in to comment.