Skip to content

Commit

Permalink
add namespace to jvm metric attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitlinger committed Jun 30, 2023
1 parent 537da51 commit 4ef4cb1
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 30 deletions.
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,25 @@ Note: This is the first release of Semantic Conventions separate from the Specif
([#39](https://github.com/open-telemetry/semantic-conventions/pull/39))
- Add Elasticsearch client semantic conventions.
([#23](https://github.com/open-telemetry/semantic-conventions/pull/23))

BREAKING: Add namespaces to JVM metric attributes ([#20](https://github.com/open-telemetry/semantic-conventions/pull/20)).
- Rename attributes `type` to `jvm.memory.type`, `pool` to `jvm.memory.pool.name`
- Applies to metrics:
- `process.runtime.jvm.memory.usage`
- `process.runtime.jvm.memory.init`
- `process.runtime.jvm.memory.committed`
- `process.runtime.jvm.memory.limit`
- `process.runtime.jvm.memory.usage_after_last_gc`
- Rename attributes `gc`, `action` to `jvm.gc.name`, `jvm.gc.action`
- Applies to metrics:
- `process.runtime.jvm.gc.duration`
- Rename attribute `daemon` to `thread.daemon`
- Applies to metrics:
- `process.runtime.jvm.threads.count`
- Rename attribute `pool` to `jvm.buffer.pool.name`
- Applies to metrics:
- `process.runtime.jvm.buffer.usage`
- `process.runtime.jvm.buffer.limit`
- `process.runtime.jvm.buffer.count`
## v1.20.0 (2023-04-07)

This and earlier versions were released as part of [the Specification](https://github.com/open-telemetry/opentelemetry-specification/). See [the specification changelog](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/CHANGELOG.md) if you'd like to `git blame` a changelog entry.
Expand Down
15 changes: 15 additions & 0 deletions schemas/1.21.0
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,21 @@ versions:
# https://github.com/open-telemetry/semantic-conventions/pull/53
- rename_metrics:
process.runtime.jvm.cpu.utilization: process.runtime.jvm.cpu.recent_utilization
# https://github.com/open-telemetry/opentelemetry-specification/pull/3464
- rename_attributes:
attribute_map:
type: jvm.memory.type
pool: jvm.memory.pool.name
- rename_attributes:
attribute_map:
name: jvm.gc.name
action: jvm.gc.action
- rename_attributes:
attribute_map:
daemon: thread.daemon
- rename_attributes:
attribute_map:
pool: jvm.buffer.pool.name
1.20.0:
spans:
changes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ groups:
- id: attributes.process.runtime.jvm.buffer
type: attribute_group
brief: "Describes JVM buffer metric attributes."
prefix: jvm.buffer
attributes:
- ref: pool
- id: pool.name
type: string
requirement_level: recommended
brief: Name of the buffer pool.
examples: [ "mapped", "direct" ]
note: >
Expand Down
12 changes: 5 additions & 7 deletions semantic_conventions/metrics/process-runtime-jvm-metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ groups:
- id: attributes.process.runtime.jvm.memory
type: attribute_group
brief: "Describes JVM memory metric attributes."
prefix: jvm.memory
attributes:
- id: type
type:
Expand All @@ -16,7 +17,7 @@ groups:
requirement_level: recommended
brief: The type of memory.
examples: ["heap", "non_heap"]
- id: pool
- id: pool.name
type: string
requirement_level: recommended
brief: Name of the memory pool.
Expand Down Expand Up @@ -63,8 +64,9 @@ groups:
brief: "Duration of JVM garbage collection actions."
instrument: histogram
unit: "s"
prefix: jvm.gc
attributes:
- id: gc
- id: name
type: string
requirement_level: recommended
brief: Name of the garbage collector.
Expand All @@ -87,11 +89,7 @@ groups:
brief: "Number of executing platform threads."
instrument: updowncounter
unit: "{thread}"
attributes:
- id: daemon
brief: "Whether the thread is daemon or not."
type: boolean
requirement_level: recommended
extends: metric_attributes.thread

- id: metric.process.runtime.jvm.classes.loaded
type: metric
Expand Down
10 changes: 10 additions & 0 deletions semantic_conventions/metrics/thread.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
groups:
- id: metric_attributes.thread
type: attribute_group
brief: 'Thread attributes'
prefix: thread
attributes:
- id: daemon
brief: "Whether the thread is daemon or not."
type: boolean
requirement_level: recommended
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle
<!-- semconv metric.process.runtime.jvm.memory.usage(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `type` | string | The type of memory. | `heap`; `non_heap` | Recommended |
| `pool` | 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 | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | 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()).

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

| Value | Description |
|---|---|
Expand All @@ -118,12 +118,12 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle
<!-- semconv metric.process.runtime.jvm.memory.committed(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `type` | string | The type of memory. | `heap`; `non_heap` | Recommended |
| `pool` | 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 | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | 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()).

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

| Value | Description |
|---|---|
Expand All @@ -145,12 +145,12 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle
<!-- semconv metric.process.runtime.jvm.memory.limit(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `type` | string | The type of memory. | `heap`; `non_heap` | Recommended |
| `pool` | 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 | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | 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()).

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

| Value | Description |
|---|---|
Expand All @@ -172,12 +172,12 @@ This metric is obtained from [`MemoryPoolMXBean#getCollectionUsage()`](https://d
<!-- semconv metric.process.runtime.jvm.memory.usage_after_last_gc(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `type` | string | The type of memory. | `heap`; `non_heap` | Recommended |
| `pool` | 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 | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | 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()).

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

| Value | Description |
|---|---|
Expand All @@ -204,8 +204,8 @@ of `[]` (single bucket histogram capturing count, sum, min, max).
<!-- semconv metric.process.runtime.jvm.gc.duration(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `gc` | string | Name of the garbage collector. [1] | `G1 Young Generation`; `G1 Old Generation` | Recommended |
| `action` | string | Name of the garbage collector action. [2] | `end of minor GC`; `end of major GC` | Recommended |
| `jvm.gc.name` | string | Name of the garbage collector. [1] | `G1 Young Generation`; `G1 Old Generation` | Recommended |
| `jvm.gc.action` | string | Name of the garbage collector action. [2] | `end of minor GC`; `end of major GC` | Recommended |

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

Expand All @@ -228,7 +228,7 @@ Note that this is the number of platform threads (as opposed to virtual threads)
<!-- semconv metric.process.runtime.jvm.threads.count(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `daemon` | boolean | Whether the thread is daemon or not. | | Recommended |
| `thread.daemon` | boolean | Whether the thread is daemon or not. | | Recommended |
<!-- endsemconv -->

### Metric: `process.runtime.jvm.classes.loaded`
Expand Down Expand Up @@ -323,12 +323,12 @@ This metric is obtained from [`MemoryPoolMXBean#getUsage()`](https://docs.oracle
<!-- semconv metric.process.runtime.jvm.memory.init(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `type` | string | The type of memory. | `heap`; `non_heap` | Recommended |
| `pool` | 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 | Name of the memory pool. [1] | `G1 Old Gen`; `G1 Eden space`; `G1 Survivor Space` | 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()).

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

| Value | Description |
|---|---|
Expand Down Expand Up @@ -379,7 +379,7 @@ This metric is obtained from [`BufferPoolMXBean#getMemoryUsed()`](https://docs.o
<!-- semconv metric.process.runtime.jvm.buffer.usage(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `pool` | string | Name of the buffer pool. [1] | `mapped`; `direct` | Recommended |
| `jvm.buffer.pool.name` | string | Name of the buffer pool. [1] | `mapped`; `direct` | Recommended |

**[1]:** Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()).
<!-- endsemconv -->
Expand All @@ -398,7 +398,7 @@ This metric is obtained from [`BufferPoolMXBean#getTotalCapacity()`](https://doc
<!-- semconv metric.process.runtime.jvm.buffer.limit(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `pool` | string | Name of the buffer pool. [1] | `mapped`; `direct` | Recommended |
| `jvm.buffer.pool.name` | string | Name of the buffer pool. [1] | `mapped`; `direct` | Recommended |

**[1]:** Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()).
<!-- endsemconv -->
Expand All @@ -417,7 +417,7 @@ This metric is obtained from [`BufferPoolMXBean#getCount()`](https://docs.oracle
<!-- semconv metric.process.runtime.jvm.buffer.count(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `pool` | string | Name of the buffer pool. [1] | `mapped`; `direct` | Recommended |
| `jvm.buffer.pool.name` | string | Name of the buffer pool. [1] | `mapped`; `direct` | Recommended |

**[1]:** Pool names are generally obtained via [BufferPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/BufferPoolMXBean.html#getName()).
<!-- endsemconv -->
Expand Down

0 comments on commit 4ef4cb1

Please sign in to comment.