Skip to content

Commit

Permalink
Move host to the registry (#498)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Wert <[email protected]>
Co-authored-by: Joao Grassi <[email protected]>
  • Loading branch information
3 people authored Nov 13, 2023
1 parent 659f03c commit 200d20f
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 131 deletions.
1 change: 1 addition & 0 deletions docs/attributes-registry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Currently, the following namespaces exist:
* [Destination](destination.md)
* [Device](device.md)
* [Error](error.md)
* [Host](host.md)
* [HTTP](http.md)
* [Network](network.md)
* [OCI](oci.md)
Expand Down
44 changes: 44 additions & 0 deletions docs/attributes-registry/host.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--- Hugo front matter used to generate the website version of this page:
--->
# Host

## Host Attributes

<!-- semconv registry.host(omit_requirement_level) -->
| Attribute | Type | Description | Examples |
|---|---|---|---|
| `host.arch` | string | The CPU architecture the host system is running on. | `amd64` |
| `host.cpu.cache.l2.size` | int | The amount of level 2 memory cache available to the processor (in Bytes). | `12288000` |
| `host.cpu.family` | string | Family or generation of the CPU. | `6`; `PA-RISC 1.1e` |
| `host.cpu.model.id` | string | Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. | `6`; `9000/778/B180L` |
| `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.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` |
| `host.ip` | string[] | Available IP addresses of the host, excluding loopback interfaces. [2] | `[192.168.1.140, fe80::abc2:4a28:737a:609e]` |
| `host.mac` | string[] | Available MAC addresses of the host, excluding loopback interfaces. [3] | `[AC-DE-48-23-45-67, AC-DE-48-23-45-67-01-9F]` |
| `host.name` | string | Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. | `opentelemetry-test` |
| `host.type` | string | Type of host. For Cloud, this must be the machine type. | `n1-standard-1` |

**[1]:** [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string.

**[2]:** IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format.

**[3]:** MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf): as hyphen-separated octets in uppercase hexadecimal form from most to least significant.

`host.arch` 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 |
|---|---|
| `amd64` | AMD64 |
| `arm32` | ARM32 |
| `arm64` | ARM64 |
| `ia64` | Itanium |
| `ppc32` | 32-bit PowerPC |
| `ppc64` | 64-bit PowerPC |
| `s390x` | IBM z/Architecture |
| `x86` | 32-bit x86 |
<!-- endsemconv -->
32 changes: 16 additions & 16 deletions docs/resource/host.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
The `host.*` namespace SHOULD be exclusively used to capture resource attributes.
To report host metrics, the `system.*` namespace SHOULD be used.

<!-- semconv host -->
<!-- semconv host(full) -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `host.arch` | string | The CPU architecture the host system is running on. | `amd64` | Recommended |
| `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` | Recommended |
| `host.image.id` | string | VM image ID or host OS image ID. For Cloud, this value is from the provider. | `ami-07b06b442921831e5` | Recommended |
| `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` | Recommended |
| `host.image.version` | string | The version string of the VM image or host OS as defined in [Version Attributes](README.md#version-attributes). | `0.1` | Recommended |
| `host.ip` | string[] | Available IP addresses of the host, excluding loopback interfaces. [1] | `[192.168.1.140, fe80::abc2:4a28:737a:609e]` | Opt-In |
| `host.mac` | string[] | Available MAC addresses of the host, excluding loopback interfaces. [2] | `[AC-DE-48-23-45-67, AC-DE-48-23-45-67-01-9F]` | Opt-In |
| `host.name` | string | Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. | `opentelemetry-test` | Recommended |
| `host.type` | string | Type of host. For Cloud, this must be the machine type. | `n1-standard-1` | Recommended |
| [`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.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 |
| [`host.ip`](../attributes-registry/host.md) | string[] | Available IP addresses of the host, excluding loopback interfaces. [1] | `[192.168.1.140, fe80::abc2:4a28:737a:609e]` | Opt-In |
| [`host.mac`](../attributes-registry/host.md) | string[] | Available MAC addresses of the host, excluding loopback interfaces. [2] | `[AC-DE-48-23-45-67, AC-DE-48-23-45-67-01-9F]` | Opt-In |
| [`host.name`](../attributes-registry/host.md) | string | Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user. | `opentelemetry-test` | Recommended |
| [`host.type`](../attributes-registry/host.md) | string | Type of host. For Cloud, this must be the machine type. | `n1-standard-1` | Recommended |

**[1]:** IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format.

Expand All @@ -45,12 +45,12 @@ To report host metrics, the `system.*` namespace SHOULD be used.
<!-- semconv host.cpu -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `host.cpu.cache.l2.size` | int | The amount of level 2 memory cache available to the processor (in Bytes). | `12288000` | Opt-In |
| `host.cpu.family` | string | Family or generation of the CPU. | `6`; `PA-RISC 1.1e` | Opt-In |
| `host.cpu.model.id` | string | Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. | `6`; `9000/778/B180L` | Opt-In |
| `host.cpu.model.name` | string | Model designation of the processor. | `11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz` | Opt-In |
| `host.cpu.stepping` | int | Stepping or core revisions. | `1` | Opt-In |
| `host.cpu.vendor.id` | string | Processor manufacturer identifier. A maximum 12-character string. [1] | `GenuineIntel` | Opt-In |
| [`host.cpu.cache.l2.size`](../attributes-registry/host.md) | int | The amount of level 2 memory cache available to the processor (in Bytes). | `12288000` | Opt-In |
| [`host.cpu.family`](../attributes-registry/host.md) | string | Family or generation of the CPU. | `6`; `PA-RISC 1.1e` | Opt-In |
| [`host.cpu.model.id`](../attributes-registry/host.md) | string | Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. | `6`; `9000/778/B180L` | Opt-In |
| [`host.cpu.model.name`](../attributes-registry/host.md) | string | Model designation of the processor. | `11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz` | Opt-In |
| [`host.cpu.stepping`](../attributes-registry/host.md) | int | Stepping or core revisions. | `1` | Opt-In |
| [`host.cpu.vendor.id`](../attributes-registry/host.md) | string | Processor manufacturer identifier. A maximum 12-character string. [1] | `GenuineIntel` | Opt-In |

**[1]:** [CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers. Writing these to memory in this order results in a 12-character string.
<!-- endsemconv -->
Expand Down
122 changes: 122 additions & 0 deletions model/registry/host.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
groups:
- id: registry.host
prefix: host
type: attribute_group
brief: >
A host is defined as a computing instance. For example, physical servers, virtual machines, switches or disk array.
attributes:
- id: id
type: string
brief: >
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.
examples: ['fdbf79e8af94cb7f9e8df36789187052']
- id: name
type: string
brief: >
Name of the host. On Unix systems, it may contain what the hostname
command returns, or the fully qualified hostname, or another name
specified by the user.
examples: ['opentelemetry-test']
- id: type
type: string
brief: >
Type of host. For Cloud, this must be the machine type.
examples: ['n1-standard-1']
- id: arch
type:
allow_custom_values: true
members:
- id: amd64
value: 'amd64'
brief: "AMD64"
- id: arm32
value: 'arm32'
brief: "ARM32"
- id: arm64
value: 'arm64'
brief: "ARM64"
- id: ia64
value: 'ia64'
brief: "Itanium"
- id: ppc32
value: 'ppc32'
brief: "32-bit PowerPC"
- id: ppc64
value: 'ppc64'
brief: "64-bit PowerPC"
- id: s390x
value: 's390x'
brief: "IBM z/Architecture"
- id: x86
value: 'x86'
brief: "32-bit x86"
brief: >
The CPU architecture the host system is running on.
- id: image.name
type: string
brief: >
Name of the VM image or OS install the host was instantiated from.
examples: ['infra-ami-eks-worker-node-7d4ec78312', 'CentOS-8-x86_64-1905']
- id: image.id
type: string
brief: >
VM image ID or host OS image ID. For Cloud, this value is from the provider.
examples: ['ami-07b06b442921831e5']
- id: image.version
type: string
brief: >
The version string of the VM image or host OS as defined in
[Version Attributes](/docs/resource/README.md#version-attributes).
examples: ['0.1']
- id: ip
type: string[]
brief: >
Available IP addresses of the host, excluding loopback interfaces.
note: >
IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses
MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format.
examples: ["192.168.1.140", "fe80::abc2:4a28:737a:609e"]
- id: mac
type: string[]
brief: >
Available MAC addresses of the host, excluding loopback interfaces.
note: >
MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf):
as hyphen-separated octets in uppercase hexadecimal form from most to least significant.
examples: ['AC-DE-48-23-45-67', 'AC-DE-48-23-45-67-01-9F']
- id: cpu.vendor.id
type: string
brief: >
Processor manufacturer identifier. A maximum 12-character string.
note: >
[CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers.
Writing these to memory in this order results in a 12-character string.
examples: [ 'GenuineIntel' ]
- id: cpu.family
type: string
brief: >
Family or generation of the CPU.
examples: [ '6', 'PA-RISC 1.1e' ]
- id: cpu.model.id
type: string
brief: >
Model identifier. It provides more granular information about the CPU, distinguishing it from
other CPUs within the same family.
examples: [ '6', '9000/778/B180L' ]
- id: cpu.model.name
type: string
brief: >
Model designation of the processor.
examples: [ '11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz' ]
- id: cpu.stepping
type: int
brief: >
Stepping or core revisions.
examples: [ 1 ]
- id: cpu.cache.l2.size
type: int
brief: >
The amount of level 2 memory cache available to the processor (in Bytes).
examples: [ 12288000 ]
130 changes: 15 additions & 115 deletions model/resource/host.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,133 +5,33 @@ groups:
brief: >
A host is defined as a computing instance. For example, physical servers, virtual machines, switches or disk array.
attributes:
- id: id
type: string
brief: >
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.
examples: ['fdbf79e8af94cb7f9e8df36789187052']
- id: name
type: string
brief: >
Name of the host. On Unix systems, it may contain what the hostname
command returns, or the fully qualified hostname, or another name
specified by the user.
examples: ['opentelemetry-test']
- id: type
type: string
brief: >
Type of host. For Cloud, this must be the machine type.
examples: ['n1-standard-1']
- id: arch
type:
allow_custom_values: true
members:
- id: amd64
value: 'amd64'
brief: "AMD64"
- id: arm32
value: 'arm32'
brief: "ARM32"
- id: arm64
value: 'arm64'
brief: "ARM64"
- id: ia64
value: 'ia64'
brief: "Itanium"
- id: ppc32
value: 'ppc32'
brief: "32-bit PowerPC"
- id: ppc64
value: 'ppc64'
brief: "64-bit PowerPC"
- id: s390x
value: 's390x'
brief: "IBM z/Architecture"
- id: x86
value: 'x86'
brief: "32-bit x86"
brief: >
The CPU architecture the host system is running on.
- id: image.name
type: string
brief: >
Name of the VM image or OS install the host was instantiated from.
examples: ['infra-ami-eks-worker-node-7d4ec78312', 'CentOS-8-x86_64-1905']
- id: image.id
type: string
brief: >
VM image ID or host OS image ID. For Cloud, this value is from the provider.
examples: ['ami-07b06b442921831e5']
- id: image.version
type: string
brief: >
The version string of the VM image or host OS as defined in
[Version Attributes](README.md#version-attributes).
examples: ['0.1']
- id: ip
type: string[]
- ref: host.id
- ref: host.name
- ref: host.type
- ref: host.arch
- ref: host.image.name
- ref: host.image.id
- ref: host.image.version
- ref: host.ip
requirement_level: opt_in
brief: >
Available IP addresses of the host, excluding loopback interfaces.
note: >
IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 addresses
MUST be specified in the [RFC 5952](https://www.rfc-editor.org/rfc/rfc5952.html) format.
examples: ["192.168.1.140", "fe80::abc2:4a28:737a:609e"]
- id: mac
type: string[]
- ref: host.mac
requirement_level: opt_in
brief: >
Available MAC addresses of the host, excluding loopback interfaces.
note: >
MAC Addresses MUST be represented in [IEEE RA hexadecimal form](https://standards.ieee.org/wp-content/uploads/import/documents/tutorials/eui.pdf):
as hyphen-separated octets in uppercase hexadecimal form from most to least significant.
examples: ['AC-DE-48-23-45-67', 'AC-DE-48-23-45-67-01-9F']

- id: host.cpu
prefix: host.cpu
type: resource
brief: >
A host's CPU information
attributes:
- id: vendor.id
- ref: host.cpu.vendor.id
requirement_level: opt_in
type: string
brief: >
Processor manufacturer identifier. A maximum 12-character string.
note: >
[CPUID](https://wiki.osdev.org/CPUID) command returns the vendor ID string in EBX, EDX and ECX registers.
Writing these to memory in this order results in a 12-character string.
examples: [ 'GenuineIntel' ]
- id: family
- ref: host.cpu.family
requirement_level: opt_in
type: string
brief: >
Family or generation of the CPU.
examples: [ '6', 'PA-RISC 1.1e' ]
- id: model.id
- ref: host.cpu.model.id
requirement_level: opt_in
type: string
brief: >
Model identifier. It provides more granular information about the CPU, distinguishing it from
other CPUs within the same family.
examples: [ '6', '9000/778/B180L' ]
- id: model.name
- ref: host.cpu.model.name
requirement_level: opt_in
type: string
brief: >
Model designation of the processor.
examples: [ '11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz' ]
- id: stepping
- ref: host.cpu.stepping
requirement_level: opt_in
type: int
brief: >
Stepping or core revisions.
examples: [ 1 ]
- id: cache.l2.size
- ref: host.cpu.cache.l2.size
requirement_level: opt_in
type: int
brief: >
The amount of level 2 memory cache available to the processor (in Bytes).
examples: [ 12288000 ]

0 comments on commit 200d20f

Please sign in to comment.