From 981f05f2be90fda5defc8ca489ce7445f495cee8 Mon Sep 17 00:00:00 2001 From: Christos Kalkanis Date: Mon, 4 Dec 2023 09:45:10 -0500 Subject: [PATCH] Add fallback for host.id in Cloud If the instance_id can not be retrieved, use machine-id value. --- docs/attributes-registry/host.md | 2 +- docs/resource/host.md | 2 +- model/registry/host.yaml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/attributes-registry/host.md b/docs/attributes-registry/host.md index 005700c2cc..85584db986 100644 --- a/docs/attributes-registry/host.md +++ b/docs/attributes-registry/host.md @@ -14,7 +14,7 @@ | `host.cpu.model.name` | string | Model designation of the processor. | `11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz` | | `host.cpu.stepping` | int | Stepping or core revisions. | `1` | | `host.cpu.vendor.id` | string | Processor manufacturer identifier. A maximum 12-character string. [1] | `GenuineIntel` | -| `host.id` | string | Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. | `fdbf79e8af94cb7f9e8df36789187052` | +| `host.id` | string | Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. If the instance_id can not be retrieved, this should be the `machine-id`. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. | `fdbf79e8af94cb7f9e8df36789187052` | | `host.image.id` | string | VM image ID or host OS image ID. For Cloud, this value is from the provider. | `ami-07b06b442921831e5` | | `host.image.name` | string | Name of the VM image or OS install the host was instantiated from. | `infra-ami-eks-worker-node-7d4ec78312`; `CentOS-8-x86_64-1905` | | `host.image.version` | string | The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). | `0.1` | diff --git a/docs/resource/host.md b/docs/resource/host.md index a11c735b86..c252129d37 100644 --- a/docs/resource/host.md +++ b/docs/resource/host.md @@ -13,7 +13,7 @@ To report host metrics, the `system.*` namespace SHOULD be used. | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| | [`host.arch`](../attributes-registry/host.md) | string | The CPU architecture the host system is running on. | `amd64` | Recommended | -| [`host.id`](../attributes-registry/host.md) | string | Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. | `fdbf79e8af94cb7f9e8df36789187052` | Recommended | +| [`host.id`](../attributes-registry/host.md) | string | Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. If the instance_id can not be retrieved, this should be the `machine-id`. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. | `fdbf79e8af94cb7f9e8df36789187052` | Recommended | | [`host.image.id`](../attributes-registry/host.md) | string | VM image ID or host OS image ID. For Cloud, this value is from the provider. | `ami-07b06b442921831e5` | Recommended | | [`host.image.name`](../attributes-registry/host.md) | string | Name of the VM image or OS install the host was instantiated from. | `infra-ami-eks-worker-node-7d4ec78312`; `CentOS-8-x86_64-1905` | Recommended | | [`host.image.version`](../attributes-registry/host.md) | string | The version string of the VM image or host OS as defined in [Version Attributes](/docs/resource/README.md#version-attributes). | `0.1` | Recommended | diff --git a/model/registry/host.yaml b/model/registry/host.yaml index 3deb5f5707..9a8f16a222 100644 --- a/model/registry/host.yaml +++ b/model/registry/host.yaml @@ -9,6 +9,7 @@ groups: type: string brief: > Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. + If the instance_id can not be retrieved, this should be the `machine-id`. For non-containerized systems, this should be the `machine-id`. See the table below for the sources to use to determine the `machine-id` based on operating system. examples: ['fdbf79e8af94cb7f9e8df36789187052']