From 1aa04a4851cbaf6e56a069a4d40ecaa2b4dd5dca Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Thu, 6 Feb 2025 11:26:26 +0100 Subject: [PATCH 01/20] Fix typo --- model/v8js/metrics.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/v8js/metrics.yaml b/model/v8js/metrics.yaml index 30925ce0ce..0ca777563f 100644 --- a/model/v8js/metrics.yaml +++ b/model/v8js/metrics.yaml @@ -10,7 +10,7 @@ groups: - ref: v8js.gc.type requirement_level: required note: > - The values can be retrieve from [`perf_hooks.PerformanceObserver(...).observe({ entryTypes: ['gc'] })`](https://nodejs.org/api/perf_hooks.html#performanceobserverobserveoptions) + The values can be retrieved from [`perf_hooks.PerformanceObserver(...).observe({ entryTypes: ['gc'] })`](https://nodejs.org/api/perf_hooks.html#performanceobserverobserveoptions) - id: metric.v8js.memory.heap.limit type: metric From 4d8ea726b870a3944ebe2cae271ea82c842394de Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 21 Feb 2025 11:02:42 +0100 Subject: [PATCH 02/20] Add CPython runtime metrics about garbage collection --- docs/attributes-registry/README.md | 1 + docs/attributes-registry/cpython.md | 22 ++++ docs/runtime/README.md | 1 + docs/runtime/cpython-metrics.md | 135 ++++++++++++++++++++++++ docs/runtime/v8js-metrics.md | 2 +- model/cpython/metrics.yaml | 39 +++++++ model/cpython/registry.yaml | 25 +++++ templates/registry/markdown/weaver.yaml | 1 + 8 files changed, 225 insertions(+), 1 deletion(-) create mode 100644 docs/attributes-registry/cpython.md create mode 100644 docs/runtime/cpython-metrics.md create mode 100644 model/cpython/metrics.yaml create mode 100644 model/cpython/registry.yaml diff --git a/docs/attributes-registry/README.md b/docs/attributes-registry/README.md index 629a46c242..da8bcd7a3d 100644 --- a/docs/attributes-registry/README.md +++ b/docs/attributes-registry/README.md @@ -48,6 +48,7 @@ Currently, the following namespaces exist: - [Code](code.md) - [Container](container.md) - [CPU](cpu.md) +- [CPython](cpython.md) - [DB](db.md) - [Deployment](deployment.md) - [Destination](destination.md) diff --git a/docs/attributes-registry/cpython.md b/docs/attributes-registry/cpython.md new file mode 100644 index 0000000000..45a307c474 --- /dev/null +++ b/docs/attributes-registry/cpython.md @@ -0,0 +1,22 @@ + + + +# CPython + +## CPython attributes + +This document defines CPython related attributes. + +| Attribute | Type | Description | Examples | Stability | +|---|---|---|---|---| +| `cpython.gc.generation` | string | Name of the garbage collector collection generation. | `gen0`; `gen1`; `gen2` | ![Development](https://img.shields.io/badge/-development-blue) | + +--- + +`cpython.gc.generation` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `gen0` | Generation 0 | ![Development](https://img.shields.io/badge/-development-blue) | +| `gen1` | Generation 1 | ![Development](https://img.shields.io/badge/-development-blue) | +| `gen2` | Generation 2 | ![Development](https://img.shields.io/badge/-development-blue) | diff --git a/docs/runtime/README.md b/docs/runtime/README.md index d4632bb4d8..b68c014536 100644 --- a/docs/runtime/README.md +++ b/docs/runtime/README.md @@ -45,6 +45,7 @@ Also consider the [OS process metrics](/docs/system/process-metrics.md) semantic conventions when instrumenting runtime environments. +- [CPython](cpython-metrics.md) - [Go](go-metrics.md) - [JVM](jvm-metrics.md) - [Node.js](nodejs-metrics.md) diff --git a/docs/runtime/cpython-metrics.md b/docs/runtime/cpython-metrics.md new file mode 100644 index 0000000000..fde468bbc9 --- /dev/null +++ b/docs/runtime/cpython-metrics.md @@ -0,0 +1,135 @@ + + +# Semantic conventions for CPython runtime metrics + +**Status**: [Development][DocumentStatus] + +This document describes semantic conventions for CPython Runtime metrics in OpenTelemetry. + + + +- [CPython Garbage Collection](#cpython-garbage-collection) + - [Metric: `cpython.gc.collections`](#metric-cpythongccollections) + - [Metric: `cpython.gc.collected`](#metric-cpythongccollected) + - [Metric: `cpython.gc.collectuncollectable`](#metric-cpythongcuncollectable) + + + +## CPython Garbage Collection + +**Status**: [development][DocumentStatus] + +**Description:** CPython metrics related to garbage collection, captured under the namespace `cpython.gc.*`. + +### Metric: `cpython.gc.collections` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `cpython.gc.collections` | Counter | `{collection}` | The number of times a generation was collected since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | + +**[1]:** This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`cpython.gc.generation`](/docs/attributes-registry/cpython.md) | string | Name of the garbage collector collection generation. | `gen0`; `gen1`; `gen2` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) | + +--- + +`cpython.gc.generation` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `gen0` | Generation 0 | ![Development](https://img.shields.io/badge/-development-blue) | +| `gen1` | Generation 1 | ![Development](https://img.shields.io/badge/-development-blue) | +| `gen2` | Generation 2 | ![Development](https://img.shields.io/badge/-development-blue) | + + + + + + +### Metric: `cpython.gc.collected` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `cpython.gc.collected` | Counter | `{collection}` | The total number of objects collected inside a generation that have occurred since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | + +**[1]:** This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`cpython.gc.generation`](/docs/attributes-registry/cpython.md) | string | Name of the garbage collector collection generation. | `gen0`; `gen1`; `gen2` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) | + +--- + +`cpython.gc.generation` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `gen0` | Generation 0 | ![Development](https://img.shields.io/badge/-development-blue) | +| `gen1` | Generation 1 | ![Development](https://img.shields.io/badge/-development-blue) | +| `gen2` | Generation 2 | ![Development](https://img.shields.io/badge/-development-blue) | + + + + + + +### Metric: `cpython.gc.uncollectable` + +This metric is [recommended][MetricRecommended]. + + + + + + + + +| Name | Instrument Type | Unit (UCUM) | Description | Stability | +| -------- | --------------- | ----------- | -------------- | --------- | +| `cpython.gc.uncollectable` | Counter | `{collection}` | The total number of uncollectable objects inside a generation that have occurred since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | + +**[1]:** This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) + +| Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | +|---|---|---|---|---|---| +| [`cpython.gc.generation`](/docs/attributes-registry/cpython.md) | string | Name of the garbage collector collection generation. | `gen0`; `gen1`; `gen2` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) | + +--- + +`cpython.gc.generation` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used. + +| Value | Description | Stability | +|---|---|---| +| `gen0` | Generation 0 | ![Development](https://img.shields.io/badge/-development-blue) | +| `gen1` | Generation 1 | ![Development](https://img.shields.io/badge/-development-blue) | +| `gen2` | Generation 2 | ![Development](https://img.shields.io/badge/-development-blue) | + + + + + + +[DocumentStatus]: https://github.com/open-telemetry/opentelemetry-specification/tree/v1.42.0/specification/document-status.md +[MetricRecommended]: /docs/general/metric-requirement-level.md#recommended diff --git a/docs/runtime/v8js-metrics.md b/docs/runtime/v8js-metrics.md index 40d37f44fa..8d0e4493a3 100644 --- a/docs/runtime/v8js-metrics.md +++ b/docs/runtime/v8js-metrics.md @@ -39,7 +39,7 @@ of `[ 0.01, 0.1, 1, 10 ]`. | -------- | --------------- | ----------- | -------------- | --------- | | `v8js.gc.duration` | Histogram | `s` | Garbage collection duration. [1] | ![Development](https://img.shields.io/badge/-development-blue) | -**[1]:** The values can be retrieve from [`perf_hooks.PerformanceObserver(...).observe({ entryTypes: ['gc'] })`](https://nodejs.org/api/perf_hooks.html#performanceobserverobserveoptions) +**[1]:** The values can be retrieved from [`perf_hooks.PerformanceObserver(...).observe({ entryTypes: ['gc'] })`](https://nodejs.org/api/perf_hooks.html#performanceobserverobserveoptions) | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| diff --git a/model/cpython/metrics.yaml b/model/cpython/metrics.yaml new file mode 100644 index 0000000000..98e1e87d99 --- /dev/null +++ b/model/cpython/metrics.yaml @@ -0,0 +1,39 @@ +groups: + - id: metric.cpython.gc.collections + type: metric + metric_name: cpython.gc.collections + brief: "The number of times a generation was collected since interpreter start." + note: > + This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) + instrument: counter + unit: "{collection}" + stability: development + attributes: + - ref: cpython.gc.generation + requirement_level: required + + - id: metric.cpython.gc.collected + type: metric + metric_name: cpython.gc.collected + brief: "The total number of objects collected inside a generation that have occurred since interpreter start." + note: > + This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) + instrument: counter + unit: "{collection}" + stability: development + attributes: + - ref: cpython.gc.generation + requirement_level: required + + - id: metric.cpython.gc.uncollectable + type: metric + metric_name: cpython.gc.uncollectable + brief: "The total number of uncollectable objects inside a generation that have occurred since interpreter start." + note: > + This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) + instrument: counter + unit: "{collection}" + stability: development + attributes: + - ref: cpython.gc.generation + requirement_level: required diff --git a/model/cpython/registry.yaml b/model/cpython/registry.yaml new file mode 100644 index 0000000000..94569fd0c3 --- /dev/null +++ b/model/cpython/registry.yaml @@ -0,0 +1,25 @@ +groups: + - id: registry.cpython + type: attribute_group + display_name: CPython attributes + brief: > + This document defines CPython related attributes. + attributes: + - id: cpython.gc.generation + stability: development + type: + members: + - id: gen0 + value: 'gen0' + brief: "Generation 0" + stability: development + - id: gen1 + value: 'gen1' + brief: "Generation 1" + stability: development + - id: gen2 + value: 'gen2' + brief: "Generation 2" + stability: development + brief: Name of the garbage collector collection generation. + examples: ["gen0", "gen1", "gen2"] diff --git a/templates/registry/markdown/weaver.yaml b/templates/registry/markdown/weaver.yaml index cbe61f30e3..c5440dcf00 100644 --- a/templates/registry/markdown/weaver.yaml +++ b/templates/registry/markdown/weaver.yaml @@ -12,6 +12,7 @@ acronyms: - CloudEvents - CloudFoundry - CLR + - CPython - CPU - CSI - DB From 5eca7dd1b233012a45df30624c0635f0b2360641 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 24 Feb 2025 12:19:10 +0100 Subject: [PATCH 03/20] Add changelog --- cpython-runtime-gc.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 cpython-runtime-gc.yaml diff --git a/cpython-runtime-gc.yaml b/cpython-runtime-gc.yaml new file mode 100644 index 0000000000..069c62f419 --- /dev/null +++ b/cpython-runtime-gc.yaml @@ -0,0 +1,22 @@ +# Use this changelog template to create an entry for release notes. +# +# If your change doesn't affect end users you should instead start +# your pull request title with [chore] or use the "Skip Changelog" label. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: new_component + +# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db) +component: cpython + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Add CPython runtime garbage collector metrics + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +# The values here must be integers. +issues: [1930] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: From 891d05f3d1e3d70e527a616354131c00099256da Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 24 Feb 2025 12:21:52 +0100 Subject: [PATCH 04/20] Fix typo --- docs/runtime/cpython-metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/runtime/cpython-metrics.md b/docs/runtime/cpython-metrics.md index fde468bbc9..9bd04e1113 100644 --- a/docs/runtime/cpython-metrics.md +++ b/docs/runtime/cpython-metrics.md @@ -13,7 +13,7 @@ This document describes semantic conventions for CPython Runtime metrics in Open - [CPython Garbage Collection](#cpython-garbage-collection) - [Metric: `cpython.gc.collections`](#metric-cpythongccollections) - [Metric: `cpython.gc.collected`](#metric-cpythongccollected) - - [Metric: `cpython.gc.collectuncollectable`](#metric-cpythongcuncollectable) + - [Metric: `cpython.gc.uncollectable`](#metric-cpythongcuncollectable) From 6250c5fec97a56cdf66cfb67233d6f95db94aa7f Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 24 Feb 2025 12:25:16 +0100 Subject: [PATCH 05/20] Put changelog in the right dir --- cpython-runtime-gc.yaml => .chloggen/cpython-runtime-gc.yaml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename cpython-runtime-gc.yaml => .chloggen/cpython-runtime-gc.yaml (100%) diff --git a/cpython-runtime-gc.yaml b/.chloggen/cpython-runtime-gc.yaml similarity index 100% rename from cpython-runtime-gc.yaml rename to .chloggen/cpython-runtime-gc.yaml From 2ac185d1fe0d5365576aa572c56f097356c380ee Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 24 Feb 2025 12:27:18 +0100 Subject: [PATCH 06/20] Fix yamllint --- .chloggen/cpython-runtime-gc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.chloggen/cpython-runtime-gc.yaml b/.chloggen/cpython-runtime-gc.yaml index 069c62f419..d418d8dcc0 100644 --- a/.chloggen/cpython-runtime-gc.yaml +++ b/.chloggen/cpython-runtime-gc.yaml @@ -10,7 +10,7 @@ change_type: new_component component: cpython # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Add CPython runtime garbage collector metrics +note: Add CPython runtime garbage collector metrics # Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. # The values here must be integers. From 406d472047c7fe8ab06fc0616619be46e31c6adf Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 24 Feb 2025 12:27:57 +0100 Subject: [PATCH 07/20] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.yaml | 1 + .github/ISSUE_TEMPLATE/change_proposal.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 4edc8d9694..1cb895abdb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -37,6 +37,7 @@ body: - area:code - area:container - area:cpu + - area:cpython - area:db - area:deployment - area:destination diff --git a/.github/ISSUE_TEMPLATE/change_proposal.yaml b/.github/ISSUE_TEMPLATE/change_proposal.yaml index b9e963a44b..a472a40433 100644 --- a/.github/ISSUE_TEMPLATE/change_proposal.yaml +++ b/.github/ISSUE_TEMPLATE/change_proposal.yaml @@ -29,6 +29,7 @@ body: - area:code - area:container - area:cpu + - area:cpython - area:db - area:deployment - area:destination From 33724e030b040b341ccbc4cf28e1c57b126678ad Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 24 Feb 2025 17:24:36 +0100 Subject: [PATCH 08/20] Apply suggestions from code review --- docs/runtime/cpython-metrics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/runtime/cpython-metrics.md b/docs/runtime/cpython-metrics.md index 9bd04e1113..6ed9dae794 100644 --- a/docs/runtime/cpython-metrics.md +++ b/docs/runtime/cpython-metrics.md @@ -36,7 +36,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `cpython.gc.collections` | Counter | `{collection}` | The number of times a generation was collected since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | +| `cpython.gc.collections` | Counter | `{collections}` | The number of times a generation was collected since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | **[1]:** This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) @@ -72,7 +72,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `cpython.gc.collected` | Counter | `{collection}` | The total number of objects collected inside a generation that have occurred since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | +| `cpython.gc.collected` | Counter | `{object}` | The total number of objects collected inside a generation that have occurred since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | **[1]:** This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) From a784aa77d5b13983cdf9841197b32054189adb8e Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 24 Feb 2025 17:25:19 +0100 Subject: [PATCH 09/20] Apply suggestions from code review --- model/cpython/metrics.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/cpython/metrics.yaml b/model/cpython/metrics.yaml index 98e1e87d99..21b549cd24 100644 --- a/model/cpython/metrics.yaml +++ b/model/cpython/metrics.yaml @@ -19,7 +19,7 @@ groups: note: > This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) instrument: counter - unit: "{collection}" + unit: "{object}" stability: development attributes: - ref: cpython.gc.generation @@ -32,7 +32,7 @@ groups: note: > This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) instrument: counter - unit: "{collection}" + unit: "{object}" stability: development attributes: - ref: cpython.gc.generation From 41993f6e2fc077561b6936509a735550640bdaba Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 24 Feb 2025 17:26:41 +0100 Subject: [PATCH 10/20] Apply suggestions from code review --- docs/runtime/cpython-metrics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/runtime/cpython-metrics.md b/docs/runtime/cpython-metrics.md index 6ed9dae794..ad64f5472f 100644 --- a/docs/runtime/cpython-metrics.md +++ b/docs/runtime/cpython-metrics.md @@ -36,7 +36,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `cpython.gc.collections` | Counter | `{collections}` | The number of times a generation was collected since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | +| `cpython.gc.collections` | Counter | `{collection}` | The number of times a generation was collected since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | **[1]:** This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) @@ -108,7 +108,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `cpython.gc.uncollectable` | Counter | `{collection}` | The total number of uncollectable objects inside a generation that have occurred since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | +| `cpython.gc.uncollectable` | Counter | `{object}` | The total number of uncollectable objects inside a generation that have occurred since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | **[1]:** This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) From 8ef9e089e5f138c1ff850e5ee4da771eaaabbcef Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Thu, 6 Mar 2025 21:40:45 +0100 Subject: [PATCH 11/20] Use .objects suffix in metrics to avoid confusion with eventual other measures Props to: lmolkova --- docs/runtime/cpython-metrics.md | 4 ++-- model/cpython/metrics.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/runtime/cpython-metrics.md b/docs/runtime/cpython-metrics.md index ad64f5472f..b1480de1e8 100644 --- a/docs/runtime/cpython-metrics.md +++ b/docs/runtime/cpython-metrics.md @@ -72,7 +72,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `cpython.gc.collected` | Counter | `{object}` | The total number of objects collected inside a generation that have occurred since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | +| `cpython.gc.collected.objects` | Counter | `{object}` | The total number of objects collected inside a generation that have occurred since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | **[1]:** This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) @@ -108,7 +108,7 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `cpython.gc.uncollectable` | Counter | `{object}` | The total number of uncollectable objects inside a generation that have occurred since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | +| `cpython.gc.uncollectable.objects` | Counter | `{object}` | The total number of uncollectable objects inside a generation that have occurred since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | **[1]:** This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) diff --git a/model/cpython/metrics.yaml b/model/cpython/metrics.yaml index 21b549cd24..765d918998 100644 --- a/model/cpython/metrics.yaml +++ b/model/cpython/metrics.yaml @@ -14,7 +14,7 @@ groups: - id: metric.cpython.gc.collected type: metric - metric_name: cpython.gc.collected + metric_name: cpython.gc.collected.objects brief: "The total number of objects collected inside a generation that have occurred since interpreter start." note: > This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) @@ -27,7 +27,7 @@ groups: - id: metric.cpython.gc.uncollectable type: metric - metric_name: cpython.gc.uncollectable + metric_name: cpython.gc.uncollectable.objects brief: "The total number of uncollectable objects inside a generation that have occurred since interpreter start." note: > This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) From 3e2c786daa02391e0deb60e0f0ea6c6588bd0b52 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 7 Mar 2025 16:20:01 +0100 Subject: [PATCH 12/20] Update docs/runtime/cpython-metrics.md Co-authored-by: Liudmila Molkova --- docs/runtime/cpython-metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/runtime/cpython-metrics.md b/docs/runtime/cpython-metrics.md index b1480de1e8..4391d629d3 100644 --- a/docs/runtime/cpython-metrics.md +++ b/docs/runtime/cpython-metrics.md @@ -95,7 +95,7 @@ This metric is [recommended][MetricRecommended]. -### Metric: `cpython.gc.uncollectable` +### Metric: `cpython.gc.uncollectable.objects` This metric is [recommended][MetricRecommended]. From d930c7408d144d4790be7daff41badf38ce0540f Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 7 Mar 2025 16:20:09 +0100 Subject: [PATCH 13/20] Update docs/runtime/cpython-metrics.md Co-authored-by: Liudmila Molkova --- docs/runtime/cpython-metrics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/runtime/cpython-metrics.md b/docs/runtime/cpython-metrics.md index 4391d629d3..3d8bee5f5c 100644 --- a/docs/runtime/cpython-metrics.md +++ b/docs/runtime/cpython-metrics.md @@ -59,7 +59,7 @@ This metric is [recommended][MetricRecommended]. -### Metric: `cpython.gc.collected` +### Metric: `cpython.gc.collected.objects` This metric is [recommended][MetricRecommended]. From b9cf90405d7c18ca1900203464021f7b7702653b Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 7 Mar 2025 16:22:54 +0100 Subject: [PATCH 14/20] Update docs/runtime/cpython-metrics.md --- docs/runtime/cpython-metrics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/runtime/cpython-metrics.md b/docs/runtime/cpython-metrics.md index 3d8bee5f5c..b9b8c08804 100644 --- a/docs/runtime/cpython-metrics.md +++ b/docs/runtime/cpython-metrics.md @@ -12,8 +12,8 @@ This document describes semantic conventions for CPython Runtime metrics in Open - [CPython Garbage Collection](#cpython-garbage-collection) - [Metric: `cpython.gc.collections`](#metric-cpythongccollections) - - [Metric: `cpython.gc.collected`](#metric-cpythongccollected) - - [Metric: `cpython.gc.uncollectable`](#metric-cpythongcuncollectable) + - [Metric: `cpython.gc.collected.objects`](#metric-cpythongccollectedobjects) + - [Metric: `cpython.gc.uncollectable.objects`](#metric-cpythongcuncollectableobjects) From 5a8ec6ae26ba3e58625da30efe640e02b8d7d129 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 7 Mar 2025 16:25:12 +0100 Subject: [PATCH 15/20] Update model/cpython/metrics.yaml Co-authored-by: Liudmila Molkova --- model/cpython/metrics.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/cpython/metrics.yaml b/model/cpython/metrics.yaml index 765d918998..f27a1daeab 100644 --- a/model/cpython/metrics.yaml +++ b/model/cpython/metrics.yaml @@ -25,7 +25,7 @@ groups: - ref: cpython.gc.generation requirement_level: required - - id: metric.cpython.gc.uncollectable + - id: metric.cpython.gc.uncollectable.objects type: metric metric_name: cpython.gc.uncollectable.objects brief: "The total number of uncollectable objects inside a generation that have occurred since interpreter start." From 433072ce1e2753b815c52c01b62786252ecdde13 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 7 Mar 2025 16:25:46 +0100 Subject: [PATCH 16/20] Update model/cpython/metrics.yaml --- model/cpython/metrics.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/cpython/metrics.yaml b/model/cpython/metrics.yaml index f27a1daeab..543c7aa91f 100644 --- a/model/cpython/metrics.yaml +++ b/model/cpython/metrics.yaml @@ -12,7 +12,7 @@ groups: - ref: cpython.gc.generation requirement_level: required - - id: metric.cpython.gc.collected + - id: metric.cpython.gc.collected.objects type: metric metric_name: cpython.gc.collected.objects brief: "The total number of objects collected inside a generation that have occurred since interpreter start." From 6ad9c9dc72b1e8778bbfd5af8a6466e56a1221dd Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Sat, 8 Mar 2025 23:06:37 +0100 Subject: [PATCH 17/20] Fix metric reference --- docs/runtime/cpython-metrics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/runtime/cpython-metrics.md b/docs/runtime/cpython-metrics.md index b9b8c08804..572b7ad3c7 100644 --- a/docs/runtime/cpython-metrics.md +++ b/docs/runtime/cpython-metrics.md @@ -63,7 +63,7 @@ This metric is [recommended][MetricRecommended]. This metric is [recommended][MetricRecommended]. - + @@ -99,7 +99,7 @@ This metric is [recommended][MetricRecommended]. This metric is [recommended][MetricRecommended]. - + From 589e469458182193849544c6841a181a22abd0c6 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 24 Mar 2025 09:53:37 +0100 Subject: [PATCH 18/20] Rename metrics and use int as values --- docs/attributes-registry/cpython.md | 8 +++--- docs/runtime/cpython-metrics.md | 40 ++++++++++++++--------------- model/cpython/metrics.yaml | 8 +++--- model/cpython/registry.yaml | 16 ++++++------ 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/docs/attributes-registry/cpython.md b/docs/attributes-registry/cpython.md index 45a307c474..d66e8ede5a 100644 --- a/docs/attributes-registry/cpython.md +++ b/docs/attributes-registry/cpython.md @@ -9,7 +9,7 @@ This document defines CPython related attributes. | Attribute | Type | Description | Examples | Stability | |---|---|---|---|---| -| `cpython.gc.generation` | string | Name of the garbage collector collection generation. | `gen0`; `gen1`; `gen2` | ![Development](https://img.shields.io/badge/-development-blue) | +| `cpython.gc.generation` | int | Value of the garbage collector collection generation. | `0`; `1`; `2` | ![Development](https://img.shields.io/badge/-development-blue) | --- @@ -17,6 +17,6 @@ This document defines CPython related attributes. | Value | Description | Stability | |---|---|---| -| `gen0` | Generation 0 | ![Development](https://img.shields.io/badge/-development-blue) | -| `gen1` | Generation 1 | ![Development](https://img.shields.io/badge/-development-blue) | -| `gen2` | Generation 2 | ![Development](https://img.shields.io/badge/-development-blue) | +| `0` | Generation 0 | ![Development](https://img.shields.io/badge/-development-blue) | +| `1` | Generation 1 | ![Development](https://img.shields.io/badge/-development-blue) | +| `2` | Generation 2 | ![Development](https://img.shields.io/badge/-development-blue) | diff --git a/docs/runtime/cpython-metrics.md b/docs/runtime/cpython-metrics.md index 572b7ad3c7..b3c10aab2b 100644 --- a/docs/runtime/cpython-metrics.md +++ b/docs/runtime/cpython-metrics.md @@ -12,8 +12,8 @@ This document describes semantic conventions for CPython Runtime metrics in Open - [CPython Garbage Collection](#cpython-garbage-collection) - [Metric: `cpython.gc.collections`](#metric-cpythongccollections) - - [Metric: `cpython.gc.collected.objects`](#metric-cpythongccollectedobjects) - - [Metric: `cpython.gc.uncollectable.objects`](#metric-cpythongcuncollectableobjects) + - [Metric: `cpython.gc.collected_objects`](#metric-cpythongccollectedobjects) + - [Metric: `cpython.gc.uncollectable_objects`](#metric-cpythongcuncollectableobjects) @@ -42,7 +42,7 @@ This metric is [recommended][MetricRecommended]. | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`cpython.gc.generation`](/docs/attributes-registry/cpython.md) | string | Name of the garbage collector collection generation. | `gen0`; `gen1`; `gen2` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) | +| [`cpython.gc.generation`](/docs/attributes-registry/cpython.md) | int | Value of the garbage collector collection generation. | `0`; `1`; `2` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) | --- @@ -50,20 +50,20 @@ This metric is [recommended][MetricRecommended]. | Value | Description | Stability | |---|---|---| -| `gen0` | Generation 0 | ![Development](https://img.shields.io/badge/-development-blue) | -| `gen1` | Generation 1 | ![Development](https://img.shields.io/badge/-development-blue) | -| `gen2` | Generation 2 | ![Development](https://img.shields.io/badge/-development-blue) | +| `0` | Generation 0 | ![Development](https://img.shields.io/badge/-development-blue) | +| `1` | Generation 1 | ![Development](https://img.shields.io/badge/-development-blue) | +| `2` | Generation 2 | ![Development](https://img.shields.io/badge/-development-blue) | -### Metric: `cpython.gc.collected.objects` +### Metric: `cpython.gc.collected_objects` This metric is [recommended][MetricRecommended]. - + @@ -72,13 +72,13 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `cpython.gc.collected.objects` | Counter | `{object}` | The total number of objects collected inside a generation that have occurred since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | +| `cpython.gc.collected_objects` | Counter | `{object}` | The total number of objects collected inside a generation that have occurred since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | **[1]:** This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`cpython.gc.generation`](/docs/attributes-registry/cpython.md) | string | Name of the garbage collector collection generation. | `gen0`; `gen1`; `gen2` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) | +| [`cpython.gc.generation`](/docs/attributes-registry/cpython.md) | int | Value of the garbage collector collection generation. | `0`; `1`; `2` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) | --- @@ -86,20 +86,20 @@ This metric is [recommended][MetricRecommended]. | Value | Description | Stability | |---|---|---| -| `gen0` | Generation 0 | ![Development](https://img.shields.io/badge/-development-blue) | -| `gen1` | Generation 1 | ![Development](https://img.shields.io/badge/-development-blue) | -| `gen2` | Generation 2 | ![Development](https://img.shields.io/badge/-development-blue) | +| `0` | Generation 0 | ![Development](https://img.shields.io/badge/-development-blue) | +| `1` | Generation 1 | ![Development](https://img.shields.io/badge/-development-blue) | +| `2` | Generation 2 | ![Development](https://img.shields.io/badge/-development-blue) | -### Metric: `cpython.gc.uncollectable.objects` +### Metric: `cpython.gc.uncollectable_objects` This metric is [recommended][MetricRecommended]. - + @@ -108,13 +108,13 @@ This metric is [recommended][MetricRecommended]. | Name | Instrument Type | Unit (UCUM) | Description | Stability | | -------- | --------------- | ----------- | -------------- | --------- | -| `cpython.gc.uncollectable.objects` | Counter | `{object}` | The total number of uncollectable objects inside a generation that have occurred since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | +| `cpython.gc.uncollectable_objects` | Counter | `{object}` | The total number of uncollectable objects inside a generation that have occurred since interpreter start. [1] | ![Development](https://img.shields.io/badge/-development-blue) | **[1]:** This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) | Attribute | Type | Description | Examples | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Stability | |---|---|---|---|---|---| -| [`cpython.gc.generation`](/docs/attributes-registry/cpython.md) | string | Name of the garbage collector collection generation. | `gen0`; `gen1`; `gen2` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) | +| [`cpython.gc.generation`](/docs/attributes-registry/cpython.md) | int | Value of the garbage collector collection generation. | `0`; `1`; `2` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) | --- @@ -122,9 +122,9 @@ This metric is [recommended][MetricRecommended]. | Value | Description | Stability | |---|---|---| -| `gen0` | Generation 0 | ![Development](https://img.shields.io/badge/-development-blue) | -| `gen1` | Generation 1 | ![Development](https://img.shields.io/badge/-development-blue) | -| `gen2` | Generation 2 | ![Development](https://img.shields.io/badge/-development-blue) | +| `0` | Generation 0 | ![Development](https://img.shields.io/badge/-development-blue) | +| `1` | Generation 1 | ![Development](https://img.shields.io/badge/-development-blue) | +| `2` | Generation 2 | ![Development](https://img.shields.io/badge/-development-blue) | diff --git a/model/cpython/metrics.yaml b/model/cpython/metrics.yaml index 543c7aa91f..a884ac84e2 100644 --- a/model/cpython/metrics.yaml +++ b/model/cpython/metrics.yaml @@ -12,9 +12,9 @@ groups: - ref: cpython.gc.generation requirement_level: required - - id: metric.cpython.gc.collected.objects + - id: metric.cpython.gc.collected_objects type: metric - metric_name: cpython.gc.collected.objects + metric_name: cpython.gc.collected_objects brief: "The total number of objects collected inside a generation that have occurred since interpreter start." note: > This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) @@ -25,9 +25,9 @@ groups: - ref: cpython.gc.generation requirement_level: required - - id: metric.cpython.gc.uncollectable.objects + - id: metric.cpython.gc.uncollectable_objects type: metric - metric_name: cpython.gc.uncollectable.objects + metric_name: cpython.gc.uncollectable_objects brief: "The total number of uncollectable objects inside a generation that have occurred since interpreter start." note: > This metric reports data from [`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats) diff --git a/model/cpython/registry.yaml b/model/cpython/registry.yaml index 94569fd0c3..af512ff26c 100644 --- a/model/cpython/registry.yaml +++ b/model/cpython/registry.yaml @@ -9,17 +9,17 @@ groups: stability: development type: members: - - id: gen0 - value: 'gen0' + - id: '0' + value: 0 brief: "Generation 0" stability: development - - id: gen1 - value: 'gen1' + - id: '1' + value: 1 brief: "Generation 1" stability: development - - id: gen2 - value: 'gen2' + - id: '2' + value: 2 brief: "Generation 2" stability: development - brief: Name of the garbage collector collection generation. - examples: ["gen0", "gen1", "gen2"] + brief: Value of the garbage collector collection generation. + examples: [0, 1, 2] From 9374a5b2320a1dff712995fe23be44f64b89be18 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 24 Mar 2025 09:57:59 +0100 Subject: [PATCH 19/20] Fix link fragments --- docs/runtime/cpython-metrics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/runtime/cpython-metrics.md b/docs/runtime/cpython-metrics.md index b3c10aab2b..f2b86f1b7d 100644 --- a/docs/runtime/cpython-metrics.md +++ b/docs/runtime/cpython-metrics.md @@ -12,8 +12,8 @@ This document describes semantic conventions for CPython Runtime metrics in Open - [CPython Garbage Collection](#cpython-garbage-collection) - [Metric: `cpython.gc.collections`](#metric-cpythongccollections) - - [Metric: `cpython.gc.collected_objects`](#metric-cpythongccollectedobjects) - - [Metric: `cpython.gc.uncollectable_objects`](#metric-cpythongcuncollectableobjects) + - [Metric: `cpython.gc.collected_objects`](#metric-cpythongccollected_objects) + - [Metric: `cpython.gc.uncollectable_objects`](#metric-cpythongcuncollectable_objects) From 86fa8067c01af48d78fbf43cdf5c4d7fe6aee3e2 Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Mon, 24 Mar 2025 10:00:27 +0100 Subject: [PATCH 20/20] Fix gc generation ids --- model/cpython/registry.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/model/cpython/registry.yaml b/model/cpython/registry.yaml index af512ff26c..d1135480e6 100644 --- a/model/cpython/registry.yaml +++ b/model/cpython/registry.yaml @@ -9,15 +9,15 @@ groups: stability: development type: members: - - id: '0' + - id: gen0 value: 0 brief: "Generation 0" stability: development - - id: '1' + - id: gen1 value: 1 brief: "Generation 1" stability: development - - id: '2' + - id: gen2 value: 2 brief: "Generation 2" stability: development