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 Jul 19, 2023
1 parent 82a6efb commit ea93e1a
Show file tree
Hide file tree
Showing 7 changed files with 210 additions and 27 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,26 @@ release.

## Unreleased

- 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.21.0 (2023-07-13)

Note: This is the first release of Semantic Conventions separate from the Specification.
Expand Down
1 change: 1 addition & 0 deletions docs/general/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ a thread that started a span.
|---|---|---|---|---|
| `thread.id` | int | Current "managed" thread ID (as opposed to OS thread ID). | `42` | Recommended |
| `thread.name` | string | Current thread name. | `main` | Recommended |
| `thread.daemon` | boolean | Whether the thread is daemon or not. | | Recommended |
<!-- endsemconv -->

Examples of where `thread.id` and `thread.name` can be extracted from:
Expand Down
42 changes: 21 additions & 21 deletions docs/system/runtime-environment-metrics.md
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`](../general/attributes.md) | boolean | Whether the thread is daemon or not. | | Recommended |
<!-- endsemconv -->

### Metric: `process.runtime.jvm.classes.loaded`
Expand Down Expand Up @@ -325,12 +325,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 @@ -385,7 +385,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 @@ -404,7 +404,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 @@ -423,7 +423,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
5 changes: 4 additions & 1 deletion model/metrics/process-runtime-jvm-metrics-experimental.yaml
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
10 changes: 5 additions & 5 deletions model/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 @@ -88,9 +90,7 @@ groups:
instrument: updowncounter
unit: "{thread}"
attributes:
- id: daemon
brief: "Whether the thread is daemon or not."
type: boolean
- ref: thread.daemon
requirement_level: recommended

- id: metric.process.runtime.jvm.classes.loaded
Expand Down
3 changes: 3 additions & 0 deletions model/trace/general.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ groups:
brief: >
Current thread name.
examples: main
- id: daemon
brief: "Whether the thread is daemon or not."
type: boolean
- id: code
prefix: code
type: span
Expand Down
156 changes: 156 additions & 0 deletions schemas/1.22.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
file_format: 1.1.0
schema_url: https://opentelemetry.io/schemas/1.22.0
versions:
1.22.0:
metrics:
changes:
# 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.21.0:
spans:
changes:
# https://github.com/open-telemetry/opentelemetry-specification/pull/3336
- rename_attributes:
attribute_map:
messaging.kafka.client_id: messaging.client_id
messaging.rocketmq.client_id: messaging.client_id
# https://github.com/open-telemetry/opentelemetry-specification/pull/3402
- rename_attributes:
attribute_map:
# net.peer.(name|port) attributes were usually populated on client side
# so they should be usually translated to server.(address|port)
# net.host.* attributes were only populated on server side
net.host.name: server.address
net.host.port: server.port
# was only populated on client side
net.sock.peer.name: server.socket.domain
# net.sock.peer.(addr|port) mapping is not possible
# since they applied to both client and server side
# were only populated on server side
net.sock.host.addr: server.socket.address
net.sock.host.port: server.socket.port
http.client_ip: client.address
# https://github.com/open-telemetry/opentelemetry-specification/pull/3426
- rename_attributes:
attribute_map:
net.protocol.name: network.protocol.name
net.protocol.version: network.protocol.version
net.host.connection.type: network.connection.type
net.host.connection.subtype: network.connection.subtype
net.host.carrier.name: network.carrier.name
net.host.carrier.mcc: network.carrier.mcc
net.host.carrier.mnc: network.carrier.mnc
net.host.carrier.icc: network.carrier.icc
# https://github.com/open-telemetry/opentelemetry-specification/pull/3355
- rename_attributes:
attribute_map:
http.method: http.request.method
http.status_code: http.response.status_code
http.scheme: url.scheme
http.url: url.full
http.request_content_length: http.request.body.size
http.response_content_length: http.response.body.size
metrics:
changes:
# https://github.com/open-telemetry/semantic-conventions/pull/53
- rename_metrics:
process.runtime.jvm.cpu.utilization: process.runtime.jvm.cpu.recent_utilization
1.20.0:
spans:
changes:
# https://github.com/open-telemetry/opentelemetry-specification/pull/3272
- rename_attributes:
attribute_map:
net.app.protocol.name: net.protocol.name
net.app.protocol.version: net.protocol.version
1.19.0:
spans:
changes:
# https://github.com/open-telemetry/opentelemetry-specification/pull/3209
- rename_attributes:
attribute_map:
faas.execution: faas.invocation_id
# https://github.com/open-telemetry/opentelemetry-specification/pull/3188
- rename_attributes:
attribute_map:
faas.id: cloud.resource_id
# https://github.com/open-telemetry/opentelemetry-specification/pull/3190
- rename_attributes:
attribute_map:
http.user_agent: user_agent.original
resources:
changes:
# https://github.com/open-telemetry/opentelemetry-specification/pull/3190
- rename_attributes:
attribute_map:
browser.user_agent: user_agent.original
1.18.0:
1.17.0:
spans:
changes:
# https://github.com/open-telemetry/opentelemetry-specification/pull/2957
- rename_attributes:
attribute_map:
messaging.consumer_id: messaging.consumer.id
messaging.protocol: net.app.protocol.name
messaging.protocol_version: net.app.protocol.version
messaging.destination: messaging.destination.name
messaging.temp_destination: messaging.destination.temporary
messaging.destination_kind: messaging.destination.kind
messaging.message_id: messaging.message.id
messaging.conversation_id: messaging.message.conversation_id
messaging.message_payload_size_bytes: messaging.message.payload_size_bytes
messaging.message_payload_compressed_size_bytes: messaging.message.payload_compressed_size_bytes
messaging.rabbitmq.routing_key: messaging.rabbitmq.destination.routing_key
messaging.kafka.message_key: messaging.kafka.message.key
messaging.kafka.partition: messaging.kafka.destination.partition
messaging.kafka.tombstone: messaging.kafka.message.tombstone
messaging.rocketmq.message_type: messaging.rocketmq.message.type
messaging.rocketmq.message_tag: messaging.rocketmq.message.tag
messaging.rocketmq.message_keys: messaging.rocketmq.message.keys
messaging.kafka.consumer_group: messaging.kafka.consumer.group
1.16.0:
1.15.0:
spans:
changes:
# https://github.com/open-telemetry/opentelemetry-specification/pull/2743
- rename_attributes:
attribute_map:
http.retry_count: http.resend_count
1.14.0:
1.13.0:
spans:
changes:
# https://github.com/open-telemetry/opentelemetry-specification/pull/2614
- rename_attributes:
attribute_map:
net.peer.ip: net.sock.peer.addr
net.host.ip: net.sock.host.addr
1.12.0:
1.11.0:
1.10.0:
1.9.0:
1.8.0:
spans:
changes:
- rename_attributes:
attribute_map:
db.cassandra.keyspace: db.name
db.hbase.namespace: db.name
1.7.0:
1.6.1:
1.5.0:
1.4.0:

0 comments on commit ea93e1a

Please sign in to comment.