> Source: https://www.ymotongpoo.com/works/otel-specs-ja/semconv/runtime/cpython-metrics/


# CPythonランタイムメトリクスに関するセマンティック規約

**ステータス**: [Development][DocumentStatus]

この文書では、OpenTelemetryにおけるCPythonランタイムメトリクスに関するセマンティック規約を定義します。

## CPythonのガーベジコレクション

**ステータス**: [development][DocumentStatus]

**Description:** 名前空間`cpython.gc.*`の下で取得される、ガーベジコレクションに関するCPythonメトリクス。

### メトリクス: `cpython.gc.collections`

このメトリクスは[推奨][MetricRecommended]です。

<!-- semconv metric.cpython.gc.collections -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `cpython.gc.collections` | Counter | `{collection}` | インタプリタの起動以降、ある世代がコレクトされた回数。[1] | ![Development](https://img.shields.io/badge/-development-blue) | |

**[1]:** このメトリクスは[`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats)からのデータを報告します。

**Attributes:**

| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- |
| [`cpython.gc.generation`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/cpython/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | int | ガーベジコレクターのコレクション世代の値。 | `0`; `1`; `2` |

---

`cpython.gc.generation`には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `0` | 世代0 | ![Development](https://img.shields.io/badge/-development-blue) |
| `1` | 世代1 | ![Development](https://img.shields.io/badge/-development-blue) |
| `2` | 世代2 | ![Development](https://img.shields.io/badge/-development-blue) |

<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### メトリクス: `cpython.gc.collected_objects`

このメトリクスは[推奨][MetricRecommended]です。

<!-- semconv metric.cpython.gc.collected_objects -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `cpython.gc.collected_objects` | Counter | `{object}` | インタプリタの起動以降、ある世代の中でコレクトされたオブジェクトの総数。[1] | ![Development](https://img.shields.io/badge/-development-blue) | |

**[1]:** このメトリクスは[`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats)からのデータを報告します。

**Attributes:**

| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- |
| [`cpython.gc.generation`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/cpython/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | int | ガーベジコレクターのコレクション世代の値。 | `0`; `1`; `2` |

---

`cpython.gc.generation`には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `0` | 世代0 | ![Development](https://img.shields.io/badge/-development-blue) |
| `1` | 世代1 | ![Development](https://img.shields.io/badge/-development-blue) |
| `2` | 世代2 | ![Development](https://img.shields.io/badge/-development-blue) |

<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

### メトリクス: `cpython.gc.uncollectable_objects`

このメトリクスは[推奨][MetricRecommended]です。

<!-- semconv metric.cpython.gc.uncollectable_objects -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

| Name | Instrument Type | Unit (UCUM) | Description | Stability | Entity Associations |
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `cpython.gc.uncollectable_objects` | Counter | `{object}` | インタプリタの起動以降、ある世代の中でコレクト不能と判明したオブジェクトの総数。[1] | ![Development](https://img.shields.io/badge/-development-blue) | |

**[1]:** このメトリクスは[`gc.stats()`](https://docs.python.org/3/library/gc.html#gc.get_stats)からのデータを報告します。

**Attributes:**

| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- |
| [`cpython.gc.generation`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/cpython/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | int | ガーベジコレクターのコレクション世代の値。 | `0`; `1`; `2` |

---

`cpython.gc.generation`には、次のよく知られた値の一覧があります。いずれかが該当する場合はその値を使用しなければならず（MUST）、それ以外の場合は独自の値を使ってもかまいません（MAY）。

| Value | Description | Stability |
| --- | --- | --- |
| `0` | 世代0 | ![Development](https://img.shields.io/badge/-development-blue) |
| `1` | 世代1 | ![Development](https://img.shields.io/badge/-development-blue) |
| `2` | 世代2 | ![Development](https://img.shields.io/badge/-development-blue) |

<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

[DocumentStatus]: https://opentelemetry.io/docs/specs/otel/document-status
[MetricRecommended]: /works/otel-specs-ja/semconv/general/metric-requirement-level/#recommended

