From ecf8f6da04b04c6ee5f3d888a18fd62a2f7de190 Mon Sep 17 00:00:00 2001 From: Jack Berg Date: Mon, 24 Oct 2022 13:51:28 -0500 Subject: [PATCH 1/4] Add metric for jvm memory usage after gc --- .../runtime-environment-metrics.md | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/specification/metrics/semantic_conventions/runtime-environment-metrics.md b/specification/metrics/semantic_conventions/runtime-environment-metrics.md index da842a6fb64..6831a873bd8 100644 --- a/specification/metrics/semantic_conventions/runtime-environment-metrics.md +++ b/specification/metrics/semantic_conventions/runtime-environment-metrics.md @@ -61,26 +61,28 @@ consider, for example pthreads vs green thread implementations. All JVM metric attributes are required unless otherwise indicated. -| Name | Description | Unit | Unit ([UCUM](README.md#instrument-units)) | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key | Attribute Values | -|--------------------------------------------|----------------------------------------------------------|---------|-------------------------------------------|---------------------------------------------------|------------|---------------|-----------------------| -| process.runtime.jvm.memory.usage | Measure of memory used | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | -| | | | | | | pool | Name of pool [1] | -| process.runtime.jvm.memory.init | Measure of initial memory requested | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | -| | | | | | | pool | Name of pool [1] | -| process.runtime.jvm.memory.committed | Measure of memory committed | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | -| | | | | | | pool | Name of pool [1] | -| process.runtime.jvm.memory.limit | Measure of max obtainable memory | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | -| | | | | | | pool | Name of pool [1] | -| process.runtime.jvm.threads.count | Number of executing threads | threads | `{threads}` | UpDownCounter | Int64 | daemon | `true`, `false` | -| process.runtime.jvm.classes.loaded | Number of classes loaded since JVM start | classes | `{classes}` | Counter | Int64 | | | -| process.runtime.jvm.classes.unloaded | Number of classes unloaded since JVM start | classes | `{classes}` | Counter | Int64 | | | -| process.runtime.jvm.classes.current_loaded | Number of classes currently loaded | classes | `{classes}` | UpDownCounter | Int64 | | | -| process.runtime.jvm.cpu.utilization | Recent cpu utilization for the process [2] | 1 | 1 | Asynchronous Gauge | Double | | | -| process.runtime.jvm.system.cpu.utilization | Recent cpu utilization for the whole system [2] | 1 | 1 | Asynchronous Gauge | Double | | | -| process.runtime.jvm.system.cpu.load_1m | Average CPU load of the whole system for the last minute | 1 | 1 | Asynchronous Gauge | Double | | | -| process.runtime.jvm.buffer.usage | Measure of memory used by buffers | Bytes | `By` | UpDownCounter | Int64 | pool | Name of pool[3] | -| process.runtime.jvm.buffer.limit | Measure of total memory capacity of buffers | Bytes | `By` | UpDownCounter | Int64 | pool | Name of pool[3] | -| process.runtime.jvm.buffer.count | Number of buffers in the pool | buffers | `{buffers}` | UpDownCounter | Int64 | pool | Name of pool[3] | +| Name | Description | Unit | Unit ([UCUM](README.md#instrument-units)) | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key | Attribute Values | +|--------------------------------------------|------------------------------------------------------------------------------------|---------|-------------------------------------------|---------------------------------------------------|------------|---------------|-----------------------| +| process.runtime.jvm.memory.usage | Measure of memory used | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | +| | | | | | | pool | Name of pool [1] | +| process.runtime.jvm.memory.init | Measure of initial memory requested | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | +| | | | | | | pool | Name of pool [1] | +| process.runtime.jvm.memory.committed | Measure of memory committed | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | +| | | | | | | pool | Name of pool [1] | +| process.runtime.jvm.memory.limit | Measure of max obtainable memory | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | +| | | | | | | pool | Name of pool [1] | +| process.runtime.jvm.memory.usage_after_gc | Measure of memory used after the most recent garbage collection event on this pool | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | +| | | | | | | pool | Name of pool [1] | +| process.runtime.jvm.threads.count | Number of executing threads | threads | `{threads}` | UpDownCounter | Int64 | daemon | `true`, `false` | +| process.runtime.jvm.classes.loaded | Number of classes loaded since JVM start | classes | `{classes}` | Counter | Int64 | | | +| process.runtime.jvm.classes.unloaded | Number of classes unloaded since JVM start | classes | `{classes}` | Counter | Int64 | | | +| process.runtime.jvm.classes.current_loaded | Number of classes currently loaded | classes | `{classes}` | UpDownCounter | Int64 | | | +| process.runtime.jvm.cpu.utilization | Recent cpu utilization for the process [2] | 1 | 1 | Asynchronous Gauge | Double | | | +| process.runtime.jvm.system.cpu.utilization | Recent cpu utilization for the whole system [2] | 1 | 1 | Asynchronous Gauge | Double | | | +| process.runtime.jvm.system.cpu.load_1m | Average CPU load of the whole system for the last minute | 1 | 1 | Asynchronous Gauge | Double | | | +| process.runtime.jvm.buffer.usage | Measure of memory used by buffers | Bytes | `By` | UpDownCounter | Int64 | pool | Name of pool[3] | +| process.runtime.jvm.buffer.limit | Measure of total memory capacity of buffers | Bytes | `By` | UpDownCounter | Int64 | pool | Name of pool[3] | +| process.runtime.jvm.buffer.count | Number of buffers in the pool | buffers | `{buffers}` | UpDownCounter | Int64 | pool | Name of pool[3] | **[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()). Examples include `G1 Old Gen`, `G1 Eden space`, `G1 Survivor Space`, `Metaspace`, etc. From ce73384cb580cadbf37a312ecfa3300b30005b4a Mon Sep 17 00:00:00 2001 From: Jack Berg Date: Mon, 24 Oct 2022 13:57:25 -0500 Subject: [PATCH 2/4] Add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 153dc96a3c3..67ce659c85f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ release. - Handle duplicate description comments during Prometheus conversion. ([#2890](https://github.com/open-telemetry/opentelemetry-specification/pull/2890)) +- Add `process.runtime.jvm.memory.usage_after_gc` metric to semantic conventions. + ([#2901](https://github.com/open-telemetry/opentelemetry-specification/pull/2901)) ### Logs From 2dc6c213b030af7bc03061c2c93a2b64a61fb1bb Mon Sep 17 00:00:00 2001 From: Jack Berg Date: Mon, 31 Oct 2022 12:58:32 -0500 Subject: [PATCH 3/4] PR feedback --- .../runtime-environment-metrics.md | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/specification/metrics/semantic_conventions/runtime-environment-metrics.md b/specification/metrics/semantic_conventions/runtime-environment-metrics.md index 6831a873bd8..0872558d7fb 100644 --- a/specification/metrics/semantic_conventions/runtime-environment-metrics.md +++ b/specification/metrics/semantic_conventions/runtime-environment-metrics.md @@ -61,28 +61,28 @@ consider, for example pthreads vs green thread implementations. All JVM metric attributes are required unless otherwise indicated. -| Name | Description | Unit | Unit ([UCUM](README.md#instrument-units)) | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key | Attribute Values | -|--------------------------------------------|------------------------------------------------------------------------------------|---------|-------------------------------------------|---------------------------------------------------|------------|---------------|-----------------------| -| process.runtime.jvm.memory.usage | Measure of memory used | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | -| | | | | | | pool | Name of pool [1] | -| process.runtime.jvm.memory.init | Measure of initial memory requested | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | -| | | | | | | pool | Name of pool [1] | -| process.runtime.jvm.memory.committed | Measure of memory committed | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | -| | | | | | | pool | Name of pool [1] | -| process.runtime.jvm.memory.limit | Measure of max obtainable memory | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | -| | | | | | | pool | Name of pool [1] | -| process.runtime.jvm.memory.usage_after_gc | Measure of memory used after the most recent garbage collection event on this pool | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | -| | | | | | | pool | Name of pool [1] | -| process.runtime.jvm.threads.count | Number of executing threads | threads | `{threads}` | UpDownCounter | Int64 | daemon | `true`, `false` | -| process.runtime.jvm.classes.loaded | Number of classes loaded since JVM start | classes | `{classes}` | Counter | Int64 | | | -| process.runtime.jvm.classes.unloaded | Number of classes unloaded since JVM start | classes | `{classes}` | Counter | Int64 | | | -| process.runtime.jvm.classes.current_loaded | Number of classes currently loaded | classes | `{classes}` | UpDownCounter | Int64 | | | -| process.runtime.jvm.cpu.utilization | Recent cpu utilization for the process [2] | 1 | 1 | Asynchronous Gauge | Double | | | -| process.runtime.jvm.system.cpu.utilization | Recent cpu utilization for the whole system [2] | 1 | 1 | Asynchronous Gauge | Double | | | -| process.runtime.jvm.system.cpu.load_1m | Average CPU load of the whole system for the last minute | 1 | 1 | Asynchronous Gauge | Double | | | -| process.runtime.jvm.buffer.usage | Measure of memory used by buffers | Bytes | `By` | UpDownCounter | Int64 | pool | Name of pool[3] | -| process.runtime.jvm.buffer.limit | Measure of total memory capacity of buffers | Bytes | `By` | UpDownCounter | Int64 | pool | Name of pool[3] | -| process.runtime.jvm.buffer.count | Number of buffers in the pool | buffers | `{buffers}` | UpDownCounter | Int64 | pool | Name of pool[3] | +| Name | Description | Unit | Unit ([UCUM](README.md#instrument-units)) | Instrument Type ([*](README.md#instrument-types)) | Value Type | Attribute Key | Attribute Values | +|------------------------------------------------|-------------------------------------------------------------------------------------------------|---------|-------------------------------------------|---------------------------------------------------|------------|---------------|-----------------------| +| process.runtime.jvm.memory.usage | Measure of memory used | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | +| | | | | | | pool | Name of pool [1] | +| process.runtime.jvm.memory.init | Measure of initial memory requested | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | +| | | | | | | pool | Name of pool [1] | +| process.runtime.jvm.memory.committed | Measure of memory committed | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | +| | | | | | | pool | Name of pool [1] | +| process.runtime.jvm.memory.limit | Measure of max obtainable memory | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | +| | | | | | | pool | Name of pool [1] | +| process.runtime.jvm.memory.usage_after_last_gc | Measure of memory used, as measured after the most recent garbage collection event on this pool | Bytes | `By` | UpDownCounter | Int64 | type | `"heap"`, `"nonheap"` | +| | | | | | | pool | Name of pool [1] | +| process.runtime.jvm.threads.count | Number of executing threads | threads | `{threads}` | UpDownCounter | Int64 | daemon | `true`, `false` | +| process.runtime.jvm.classes.loaded | Number of classes loaded since JVM start | classes | `{classes}` | Counter | Int64 | | | +| process.runtime.jvm.classes.unloaded | Number of classes unloaded since JVM start | classes | `{classes}` | Counter | Int64 | | | +| process.runtime.jvm.classes.current_loaded | Number of classes currently loaded | classes | `{classes}` | UpDownCounter | Int64 | | | +| process.runtime.jvm.cpu.utilization | Recent cpu utilization for the process [2] | 1 | 1 | Asynchronous Gauge | Double | | | +| process.runtime.jvm.system.cpu.utilization | Recent cpu utilization for the whole system [2] | 1 | 1 | Asynchronous Gauge | Double | | | +| process.runtime.jvm.system.cpu.load_1m | Average CPU load of the whole system for the last minute | 1 | 1 | Asynchronous Gauge | Double | | | +| process.runtime.jvm.buffer.usage | Measure of memory used by buffers | Bytes | `By` | UpDownCounter | Int64 | pool | Name of pool[3] | +| process.runtime.jvm.buffer.limit | Measure of total memory capacity of buffers | Bytes | `By` | UpDownCounter | Int64 | pool | Name of pool[3] | +| process.runtime.jvm.buffer.count | Number of buffers in the pool | buffers | `{buffers}` | UpDownCounter | Int64 | pool | Name of pool[3] | **[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()). Examples include `G1 Old Gen`, `G1 Eden space`, `G1 Survivor Space`, `Metaspace`, etc. From b92a3a606425ce49980f536f8e1696e9a4f4d251 Mon Sep 17 00:00:00 2001 From: jack-berg <34418638+jack-berg@users.noreply.github.com> Date: Mon, 31 Oct 2022 16:38:03 -0500 Subject: [PATCH 4/4] Update CHANGELOG.md Co-authored-by: Trask Stalnaker --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67ce659c85f..e75076b02d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ release. - Handle duplicate description comments during Prometheus conversion. ([#2890](https://github.com/open-telemetry/opentelemetry-specification/pull/2890)) -- Add `process.runtime.jvm.memory.usage_after_gc` metric to semantic conventions. +- Add `process.runtime.jvm.memory.usage_after_last_gc` metric to semantic conventions. ([#2901](https://github.com/open-telemetry/opentelemetry-specification/pull/2901)) ### Logs