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


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

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

この文書では、OpenTelemetryにおけるV8 JSエンジンランタイムメトリクスに関するセマンティック規約を定義します。このエンジンは、Node.jsやDenoなど一部のJavaScriptランタイムで使用されています。

**Description:** `v8js`の下で取得される、開発中のV8 JSエンジンランタイムメトリクス。

## メトリクス: `v8js.gc.duration`

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

このメトリクスは、[`ExplicitBucketBoundaries` advisoryパラメータ](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.59.0/specification/metrics/api.md#instrument-advisory-parameters)に`[ 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1, 2.5, 5, 7.5, 10 ]`を指定すべきです（SHOULD）。

<!-- semconv metric.v8js.gc.duration -->
<!-- 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 |
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `v8js.gc.duration` | Histogram | `s` | ガーベジコレクションの期間。[1] | ![Development](https://img.shields.io/badge/-development-blue) | |

**[1]:** 値は[`perf_hooks.PerformanceObserver(...).observe({ entryTypes: ['gc'] })`](https://nodejs.org/api/perf_hooks.html#performanceobserverobserveoptions)から取得できます。

**Attributes:**

| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- |
| [`v8js.gc.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/v8js/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | ガーベジコレクションの種別。 | `major`; `minor`; `incremental` |

---

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

| Value | Description | Stability |
| --- | --- | --- |
| `incremental` | インクリメンタル（Incremental Marking）。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `major` | メジャー（Mark Sweep Compact）。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `minor` | マイナー（Scavenge）。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `weakcb` | Weak Callbacks（Process Weak Callbacks）。 | ![Development](https://img.shields.io/badge/-development-blue) |

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

## メトリクス: `v8js.memory.heap.space.available_size`

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

<!-- semconv metric.v8js.memory.heap.space.available_size -->
<!-- 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 |
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `v8js.memory.heap.space.available_size` | UpDownCounter | `By` | ヒープスペースの利用可能サイズ。[1] | ![Development](https://img.shields.io/badge/-development-blue) | |

**[1]:** 値は[`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics)の`space_available_size`の値から取得できます。

**Attributes:**

| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- |
| [`v8js.heap.space.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/v8js/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | ヒープメモリのスペース種別の名前。[1] | `new_space`; `old_space`; `code_space` |

**[1] `v8js.heap.space.name`:** 値は[`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics)の`space_name`の値から取得できます。

---

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

| Value | Description | Stability |
| --- | --- | --- |
| `code_space` | コードメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `large_object_space` | 大きなオブジェクトのメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `map_space` | Mapメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `new_space` | 新しいメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `old_space` | 古いメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |

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

## メトリクス: `v8js.memory.heap.space.physical_size`

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

<!-- semconv metric.v8js.memory.heap.space.physical_size -->
<!-- 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 |
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `v8js.memory.heap.space.physical_size` | UpDownCounter | `By` | ヒープスペースのコミット済みサイズ。[1] | ![Development](https://img.shields.io/badge/-development-blue) | |

**[1]:** 値は[`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics)の`physical_space_size`の値から取得できます。

**Attributes:**

| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- |
| [`v8js.heap.space.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/v8js/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | ヒープメモリのスペース種別の名前。[1] | `new_space`; `old_space`; `code_space` |

**[1] `v8js.heap.space.name`:** 値は[`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics)の`space_name`の値から取得できます。

---

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

| Value | Description | Stability |
| --- | --- | --- |
| `code_space` | コードメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `large_object_space` | 大きなオブジェクトのメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `map_space` | Mapメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `new_space` | 新しいメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `old_space` | 古いメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |

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

## メトリクス: `v8js.memory.heap.space.size`

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

<!-- semconv metric.v8js.memory.heap.space.size -->
<!-- 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 |
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `v8js.memory.heap.space.size` | UpDownCounter | `By` | ヒープスペースにあらかじめ割り当てられたヒープメモリの総サイズ。[1] | ![Development](https://img.shields.io/badge/-development-blue) | |

**[1]:** 値は[`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics)の`space_size`の値から取得できます。

**Attributes:**

| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- |
| [`v8js.heap.space.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/v8js/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | ヒープメモリのスペース種別の名前。[1] | `new_space`; `old_space`; `code_space` |

**[1] `v8js.heap.space.name`:** 値は[`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics)の`space_name`の値から取得できます。

---

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

| Value | Description | Stability |
| --- | --- | --- |
| `code_space` | コードメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `large_object_space` | 大きなオブジェクトのメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `map_space` | Mapメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `new_space` | 新しいメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `old_space` | 古いメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |

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

## メトリクス: `v8js.memory.heap.used`

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

<!-- semconv metric.v8js.memory.heap.used -->
<!-- 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 |
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `v8js.memory.heap.used` | UpDownCounter | `By` | 割り当て済みのヒープメモリサイズ。[1] | ![Development](https://img.shields.io/badge/-development-blue) | |

**[1]:** 値は[`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics)の`space_used_size`の値から取得できます。

**Attributes:**

| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- |
| [`v8js.heap.space.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/v8js/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | ヒープメモリのスペース種別の名前。[1] | `new_space`; `old_space`; `code_space` |

**[1] `v8js.heap.space.name`:** 値は[`v8.getHeapSpaceStatistics()`](https://nodejs.org/api/v8.html#v8getheapspacestatistics)の`space_name`の値から取得できます。

---

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

| Value | Description | Stability |
| --- | --- | --- |
| `code_space` | コードメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `large_object_space` | 大きなオブジェクトのメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `map_space` | Mapメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `new_space` | 新しいメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `old_space` | 古いメモリスペース。 | ![Development](https://img.shields.io/badge/-development-blue) |

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

## メトリクス: `v8js.resource.active`

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

<!-- semconv metric.v8js.resource.active -->
<!-- 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 |
| -------- | --------------- | ----------- | -------------- | --------- | ------ |
| `v8js.resource.active` | Gauge | `{resource}` | イベントループを稼働させ続けている、現在アクティブなリソースのゲージ。[1] | ![Development](https://img.shields.io/badge/-development-blue) | |

**[1]:** 値は[`process.getActiveResourcesInfo()`](https://nodejs.org/api/process.html#processgetactiveresourcesinfo)から取得できます。

**Attributes:**

| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- |
| [`v8js.resource.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/v8js/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | イベントループをアクティブにし続けているリソースの種別。 | `Immediate`; `TCPServerWrap`; `TCPWrap` |

---

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

| Value | Description | Stability |
| --- | --- | --- |
| `Immediate` | アクティブな`setImmediate`コールバック。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `TCPServerWrap` | アクティブなTCPサーバー。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `TCPWrap` | アクティブなTCP接続。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `Timeout` | アクティブな`setTimeout`または`setInterval`タイマー。 | ![Development](https://img.shields.io/badge/-development-blue) |
| `TTYWrap` | アクティブな端末I/O（stdin/stdout）。 | ![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

