> Source: https://www.ymotongpoo.com/works/otel-specs-ja/semconv/resource/host/


# Host

`host.*`名前空間は、リソース属性を取得するためだけに使用すべきです（SHOULD）。
ホストメトリクスを報告するには、`system.*`名前空間を使用すべきです（SHOULD）。

<!-- markdownlint-disable -->
<!-- semconv entity.host -->
<!-- NOTE: THIS TEXT IS AUTOGENERATED. DO NOT EDIT BY HAND. -->
<!-- see templates/registry/markdown/snippet.md.j2 -->
<!-- prettier-ignore-start -->

**Status:** ![Development](https://img.shields.io/badge/-development-blue)

**type:** `host`

**Description:** ホストは、コンピュートインスタンスとして定義されます。例えば、物理サーバー、仮想マシン、スイッチ、ディスクアレイなどです。

> [!warning]
> このEntity定義には、roleを持たない属性が含まれています。
> 安定版のEntityは、roleが定義されていない属性を持ってはなりません（MUST NOT）。

**Attributes:**

| Role | Key | Stability | [Requirement Level](/works/otel-specs-ja/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- | --- |
| Other | [`host.arch`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/host/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | ホストシステムが動作しているCPUアーキテクチャ。 | `amd64`; `arm32`; `arm64` |
| Other | [`host.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/host/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | 一意のホストID。クラウドの場合、これはクラウドプロバイダーが割り当てるinstance_idでなければなりません。コンテナ化されていないシステムの場合、これは`machine-id`であるべきです。オペレーティングシステムごとに`machine-id`を決定するために使用するソースについては、下の表を参照してください。[1] | `fdbf79e8af94cb7f9e8df36789187052` |
| Other | [`host.image.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/host/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | VMイメージIDまたはホストOSイメージID。クラウドの場合、この値はプロバイダーから取得されます。 | `ami-07b06b442921831e5` |
| Other | [`host.image.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/host/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | そのホストが起動されたVMイメージまたはOSインストールの名前。 | `infra-ami-eks-worker-node-7d4ec78312`; `CentOS-8-x86_64-1905` |
| Other | [`host.image.version`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/host/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | [バージョン属性](/works/otel-specs-ja/semconv/resource/#バージョン属性)で定義されている、VMイメージまたはホストOSのバージョン文字列。 | `0.1` |
| Other | [`host.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/host/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | ホストの名前。UNIXシステムでは、hostnameコマンドが返す値、完全修飾ホスト名、またはユーザーが指定した他の名前が含まれることがあります。 | `opentelemetry-test` |
| Other | [`host.type`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/host/) | ![Development](https://img.shields.io/badge/-development-blue) | `Recommended` | string | ホストの種別。クラウドの場合、これはマシンタイプでなければなりません。 | `n1-standard-1` |
| Other | [`host.ip`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/host/) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string[] | ループバックインターフェースを除く、ホストの利用可能なIPアドレス。[2] | `["192.168.1.140", "fe80::abc2:4a28:737a:609e"]` |
| Other | [`host.mac`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/host/) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string[] | ループバックインターフェースを除く、ホストの利用可能なMACアドレス。[3] | `["AC-DE-48-23-45-67", "AC-DE-48-23-45-67-01-9F"]` |

**[1] `host.id`:** コンテナ化されていないシステムから`host.id`を収集する

**非特権のマシンID参照**

コンテナ化されていないシステムに対して`host.id`を収集する場合、マシンIDの非特権参照が推奨されます。SDKのdetector実装は、マシンIDを取得するために、下に挙げるソースを使用しなければなりません（MUST）。

| OS | Primary | Fallback |
| --- | --- | --- |
| Linux | `/etc/machine-id`の内容 | `/var/lib/dbus/machine-id`の内容 |
| BSD | `/etc/hostid`の内容 | `/bin/kenv -q smbios.system.uuid`の出力 |
| macOS | `/usr/sbin/ioreg -rd1 -c "IOPlatformExpertDevice"`の出力にある`IOPlatformUUID`行 | - |
| Windows | レジストリ`HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography`の`MachineGuid` | - |

**特権のマシンID参照**

`host.id`は、特権を持つソースを使って参照することもできます。例えばLinuxシステムでは、`dmidecode -t system`、`dmidecode -t baseboard`、`dmidecode -t chassis`の出力を使う、あるいはファイルシステムから対応するデータを読み取ることができます（`cat /sys/devices/virtual/dmi/id/product_id`、`cat /sys/devices/virtual/dmi/id/product_uuid`など）。しかし、SDKのリソースdetector実装は、特権を持つソースから`host.id`を収集してはなりません（MUST NOT）。`host.id`の特権参照が必要な場合、その値は`OTEL_RESOURCE_ATTRIBUTES`環境変数を通じて注入すべきです（SHOULD）。

**[2] `host.ip`:** IPv4アドレスはドット付き10進表記で指定しなければなりません（MUST）。IPv6アドレスは[RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html)の形式で指定しなければなりません（MUST）。

**[3] `host.mac`:** MACアドレスは、[IEEE RAの16進表記](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf)で表現しなければなりません（MUST）。つまり、上位から下位の順に、大文字の16進表記でハイフンで区切ったオクテットとして表します。

---

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

| Value | Description | Stability |
| --- | --- | --- |
| `amd64` | AMD64 | ![Development](https://img.shields.io/badge/-development-blue) |
| `arm32` | ARM32 | ![Development](https://img.shields.io/badge/-development-blue) |
| `arm64` | ARM64 | ![Development](https://img.shields.io/badge/-development-blue) |
| `ia64` | Itanium | ![Development](https://img.shields.io/badge/-development-blue) |
| `ppc32` | 32ビットPowerPC | ![Development](https://img.shields.io/badge/-development-blue) |
| `ppc64` | 64ビットPowerPC | ![Development](https://img.shields.io/badge/-development-blue) |
| `s390x` | IBM z/Architecture | ![Development](https://img.shields.io/badge/-development-blue) |
| `x86` | 32ビットx86 | ![Development](https://img.shields.io/badge/-development-blue) |
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->
<!-- markdownlint-restore -->

**type:** `host.cpu`

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

**Status:** ![Development](https://img.shields.io/badge/-development-blue)

**type:** `host.cpu`

**Description:** ホストのCPU情報。

> [!warning]
> このEntity定義には、roleを持たない属性が含まれています。
> 安定版のEntityは、roleが定義されていない属性を持ってはなりません（MUST NOT）。

**Attributes:**

| Role | Key | Stability | [Requirement Level](/works/otel-specs-ja/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values |
| --- | --- | --- | --- | --- | --- | --- |
| Other | [`host.cpu.cache.l2.size`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/host/) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | int | プロセッサーが利用できるレベル2メモリキャッシュの量（バイト単位）。 | `12288000` |
| Other | [`host.cpu.family`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/host/) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string | CPUのファミリーまたは世代。 | `6`; `PA-RISC 1.1e` |
| Other | [`host.cpu.model.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/host/) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string | モデル識別子。同じファミリー内の他のCPUと区別する、より詳細な情報を提供します。 | `6`; `9000/778/B180L` |
| Other | [`host.cpu.model.name`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/host/) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string | プロセッサーのモデル名称。 | `11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz` |
| Other | [`host.cpu.stepping`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/host/) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string | ステッピングまたはコアのリビジョン。 | `1`; `r1p1` |
| Other | [`host.cpu.vendor.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/host/) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string | プロセッサー製造元の識別子。最大12文字の文字列。[1] | `GenuineIntel` |

**[1] `host.cpu.vendor.id`:** [CPUID](https://wiki.osdev.org/CPUID)コマンドは、EBX、EDX、ECXレジスタにベンダーID文字列を返します。これらをこの順序でメモリに書き込むと、12文字の文字列になります。
<!-- prettier-ignore-end -->
<!-- END AUTOGENERATED TEXT -->
<!-- endsemconv -->

