From 256706f0bccc0bc02c6f18d5486d248d73b5daca Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Tue, 25 Jul 2023 16:53:12 +0300 Subject: [PATCH 1/8] Add host cpu info Signed-off-by: ChrsMark --- docs/resource/host.md | 7 +++++++ model/resource/host.yaml | 42 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/docs/resource/host.md b/docs/resource/host.md index 96d7da4dea..b78593c342 100644 --- a/docs/resource/host.md +++ b/docs/resource/host.md @@ -16,6 +16,13 @@ | `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.id` | string | VM image ID or host OS image ID. For Cloud, this value is from the provider. | `ami-07b06b442921831e5` | 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.cpu.vendor_id` | string | Processor manufacturer. First part of the CPUID identifier - a maximum 12-character name of the manufacturer. | `GenuineIntel` | Opt-In | +| `host.cpu.family` | string | Numeric value specifying model variant. Second part of the CPUID identifier. | `6` | Opt-In | +| `host.cpu.model` | string | VM image ID or host OS image ID. For Cloud, this value is from the provider. | `6` | 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` | string | Stepping or core revisions. | `1` | Opt-In | +| `host.cpu.frequency` | string | Clock frequency in MHz. | `3000.000` | Opt-In | +| `host.cpu.cache_size` | string | The amount of level 2 memory cache available to the processor (in Bytes). | `12288000` | Opt-In | `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. diff --git a/model/resource/host.yaml b/model/resource/host.yaml index 457aa1c8ae..75be39a885 100644 --- a/model/resource/host.yaml +++ b/model/resource/host.yaml @@ -70,3 +70,45 @@ groups: The version string of the VM image or host OS as defined in [Version Attributes](README.md#version-attributes). examples: ['0.1'] + - id: cpu.vendor_id + requirement_level: opt_in + type: string + brief: > + Processor manufacturer. First part of the CPUID identifier - a maximum 12-character name of the manufacturer. + examples: [ 'GenuineIntel' ] + - id: cpu.family + requirement_level: opt_in + type: string + brief: > + Numeric value specifying model variant. Second part of the CPUID identifier. + examples: [ '6' ] + - id: cpu.model + requirement_level: opt_in + type: string + brief: > + VM image ID or host OS image ID. For Cloud, this value is from the provider. + examples: [ '6' ] + - id: 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: cpu.stepping + requirement_level: opt_in + type: string + brief: > + Stepping or core revisions. + examples: [ '1' ] + - id: cpu.frequency + requirement_level: opt_in + type: string + brief: > + Clock frequency in MHz. + examples: [ '3000.000' ] + - id: cpu.cache_size + requirement_level: opt_in + type: string + brief: > + The amount of level 2 memory cache available to the processor (in Bytes). + examples: [ '12288000' ] From bf87b56e03064d053b0ebee959e6986c5dbbfd86 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Tue, 25 Jul 2023 17:00:03 +0300 Subject: [PATCH 2/8] fix namespace Signed-off-by: ChrsMark --- docs/resource/host.md | 21 ++++++++++++++------- model/resource/host.yaml | 20 +++++++++++++------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/docs/resource/host.md b/docs/resource/host.md index b78593c342..eb4ae78ac9 100644 --- a/docs/resource/host.md +++ b/docs/resource/host.md @@ -16,13 +16,6 @@ | `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.id` | string | VM image ID or host OS image ID. For Cloud, this value is from the provider. | `ami-07b06b442921831e5` | 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.cpu.vendor_id` | string | Processor manufacturer. First part of the CPUID identifier - a maximum 12-character name of the manufacturer. | `GenuineIntel` | Opt-In | -| `host.cpu.family` | string | Numeric value specifying model variant. Second part of the CPUID identifier. | `6` | Opt-In | -| `host.cpu.model` | string | VM image ID or host OS image ID. For Cloud, this value is from the provider. | `6` | 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` | string | Stepping or core revisions. | `1` | Opt-In | -| `host.cpu.frequency` | string | Clock frequency in MHz. | `3000.000` | Opt-In | -| `host.cpu.cache_size` | string | The amount of level 2 memory cache available to the processor (in Bytes). | `12288000` | Opt-In | `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. @@ -38,6 +31,20 @@ | `x86` | 32-bit x86 | +**type:** `host.cpu` + + +| Attribute | Type | Description | Examples | Requirement Level | +|---|---|---|---|---| +| `host.cpu.vendor_id` | string | Processor manufacturer. First part of the CPUID identifier - a maximum 12-character name of the manufacturer. | `GenuineIntel` | Opt-In | +| `host.cpu.family` | string | Numeric value specifying model variant. Second part of the CPUID identifier. | `6` | Opt-In | +| `host.cpu.model` | string | VM image ID or host OS image ID. For Cloud, this value is from the provider. | `6` | 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` | string | Stepping or core revisions. | `1` | Opt-In | +| `host.cpu.frequency` | string | Clock frequency in MHz. | `3000.000` | Opt-In | +| `host.cpu.cache_size` | string | The amount of level 2 memory cache available to the processor (in Bytes). | `12288000` | Opt-In | + + ## Collecting host.id from non-containerized systems ### Non-privileged Machine ID Lookup diff --git a/model/resource/host.yaml b/model/resource/host.yaml index 75be39a885..1c3e1f414d 100644 --- a/model/resource/host.yaml +++ b/model/resource/host.yaml @@ -70,43 +70,49 @@ groups: The version string of the VM image or host OS as defined in [Version Attributes](README.md#version-attributes). examples: ['0.1'] - - id: cpu.vendor_id + - id: host.cpu + prefix: host.cpu + type: resource + brief: > + A host's CPU information + attributes: + - id: vendor_id requirement_level: opt_in type: string brief: > Processor manufacturer. First part of the CPUID identifier - a maximum 12-character name of the manufacturer. examples: [ 'GenuineIntel' ] - - id: cpu.family + - id: family requirement_level: opt_in type: string brief: > Numeric value specifying model variant. Second part of the CPUID identifier. examples: [ '6' ] - - id: cpu.model + - id: model requirement_level: opt_in type: string brief: > VM image ID or host OS image ID. For Cloud, this value is from the provider. examples: [ '6' ] - - id: cpu.model_name + - id: 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: cpu.stepping + - id: stepping requirement_level: opt_in type: string brief: > Stepping or core revisions. examples: [ '1' ] - - id: cpu.frequency + - id: frequency requirement_level: opt_in type: string brief: > Clock frequency in MHz. examples: [ '3000.000' ] - - id: cpu.cache_size + - id: cache_size requirement_level: opt_in type: string brief: > From ecf5c21337ab8958efb5e3253ecff669dd406dac Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Tue, 25 Jul 2023 17:20:18 +0300 Subject: [PATCH 3/8] fix model id description Signed-off-by: ChrsMark --- docs/resource/host.md | 2 +- model/resource/host.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/resource/host.md b/docs/resource/host.md index eb4ae78ac9..d4476194b9 100644 --- a/docs/resource/host.md +++ b/docs/resource/host.md @@ -38,7 +38,7 @@ |---|---|---|---|---| | `host.cpu.vendor_id` | string | Processor manufacturer. First part of the CPUID identifier - a maximum 12-character name of the manufacturer. | `GenuineIntel` | Opt-In | | `host.cpu.family` | string | Numeric value specifying model variant. Second part of the CPUID identifier. | `6` | Opt-In | -| `host.cpu.model` | string | VM image ID or host OS image ID. For Cloud, this value is from the provider. | `6` | Opt-In | +| `host.cpu.model` | string | Extended Model ID | `6` | 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` | string | Stepping or core revisions. | `1` | Opt-In | | `host.cpu.frequency` | string | Clock frequency in MHz. | `3000.000` | Opt-In | diff --git a/model/resource/host.yaml b/model/resource/host.yaml index 1c3e1f414d..78fb6b7c23 100644 --- a/model/resource/host.yaml +++ b/model/resource/host.yaml @@ -92,7 +92,7 @@ groups: requirement_level: opt_in type: string brief: > - VM image ID or host OS image ID. For Cloud, this value is from the provider. + Extended Model ID examples: [ '6' ] - id: model_name requirement_level: opt_in From 5daf813fd132c700820ac8d7e424ddfedffb9730 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Mon, 31 Jul 2023 17:05:08 +0300 Subject: [PATCH 4/8] improve descriptions and use proper types Signed-off-by: ChrsMark --- docs/resource/host.md | 12 ++++++------ model/resource/host.yaml | 27 ++++++++++++++------------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/docs/resource/host.md b/docs/resource/host.md index d4476194b9..0069679975 100644 --- a/docs/resource/host.md +++ b/docs/resource/host.md @@ -36,13 +36,13 @@ | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `host.cpu.vendor_id` | string | Processor manufacturer. First part of the CPUID identifier - a maximum 12-character name of the manufacturer. | `GenuineIntel` | Opt-In | -| `host.cpu.family` | string | Numeric value specifying model variant. Second part of the CPUID identifier. | `6` | Opt-In | -| `host.cpu.model` | string | Extended Model ID | `6` | Opt-In | +| `host.cpu.vendor_id` | string | Processor manufacturer identifier. A maximum 12-character string. | `GenuineIntel` | Opt-In | +| `host.cpu.family` | int | Numeric value specifying the family or generation of the CPU. | `6` | Opt-In | +| `host.cpu.model` | int | Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. | `6` | 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` | string | Stepping or core revisions. | `1` | Opt-In | -| `host.cpu.frequency` | string | Clock frequency in MHz. | `3000.000` | Opt-In | -| `host.cpu.cache_size` | string | The amount of level 2 memory cache available to the processor (in Bytes). | `12288000` | Opt-In | +| `host.cpu.stepping` | int | Stepping or core revisions. | `1` | Opt-In | +| `host.cpu.frequency` | double | Clock frequency in MHz. | `3000.0` | Opt-In | +| `host.cpu.cache_size` | int | The amount of level 2 memory cache available to the processor (in Bytes). | `12288000` | Opt-In | ## Collecting host.id from non-containerized systems diff --git a/model/resource/host.yaml b/model/resource/host.yaml index 78fb6b7c23..57523d1974 100644 --- a/model/resource/host.yaml +++ b/model/resource/host.yaml @@ -80,20 +80,21 @@ groups: requirement_level: opt_in type: string brief: > - Processor manufacturer. First part of the CPUID identifier - a maximum 12-character name of the manufacturer. + Processor manufacturer identifier. A maximum 12-character string. examples: [ 'GenuineIntel' ] - id: family requirement_level: opt_in - type: string + type: int brief: > - Numeric value specifying model variant. Second part of the CPUID identifier. - examples: [ '6' ] + Numeric value specifying the family or generation of the CPU. + examples: [ 6 ] - id: model requirement_level: opt_in - type: string + type: int brief: > - Extended Model ID - examples: [ '6' ] + Model identifier. It provides more granular information about the CPU, distinguishing it from + other CPUs within the same family. + examples: [ 6 ] - id: model_name requirement_level: opt_in type: string @@ -102,19 +103,19 @@ groups: examples: [ '11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz' ] - id: stepping requirement_level: opt_in - type: string + type: int brief: > Stepping or core revisions. - examples: [ '1' ] + examples: [ 1 ] - id: frequency requirement_level: opt_in - type: string + type: double brief: > Clock frequency in MHz. - examples: [ '3000.000' ] + examples: [ 3000.000 ] - id: cache_size requirement_level: opt_in - type: string + type: int brief: > The amount of level 2 memory cache available to the processor (in Bytes). - examples: [ '12288000' ] + examples: [ 12288000 ] From f1e7ca89c59f4f51b2e1223b21339f1b44bbaa80 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Fri, 4 Aug 2023 10:50:59 +0300 Subject: [PATCH 5/8] Remove frequency from the resource attributes Signed-off-by: ChrsMark --- docs/resource/host.md | 1 - model/resource/host.yaml | 6 ------ 2 files changed, 7 deletions(-) diff --git a/docs/resource/host.md b/docs/resource/host.md index 0069679975..f7d3e6f143 100644 --- a/docs/resource/host.md +++ b/docs/resource/host.md @@ -41,7 +41,6 @@ | `host.cpu.model` | int | Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. | `6` | 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.frequency` | double | Clock frequency in MHz. | `3000.0` | Opt-In | | `host.cpu.cache_size` | int | The amount of level 2 memory cache available to the processor (in Bytes). | `12288000` | Opt-In | diff --git a/model/resource/host.yaml b/model/resource/host.yaml index 57523d1974..750c4f0400 100644 --- a/model/resource/host.yaml +++ b/model/resource/host.yaml @@ -107,12 +107,6 @@ groups: brief: > Stepping or core revisions. examples: [ 1 ] - - id: frequency - requirement_level: opt_in - type: double - brief: > - Clock frequency in MHz. - examples: [ 3000.000 ] - id: cache_size requirement_level: opt_in type: int From 356e3f8a293cad107ac1ba3c47df0d531562d2dd Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Fri, 4 Aug 2023 13:37:18 +0300 Subject: [PATCH 6/8] better group fields nesting Signed-off-by: ChrsMark --- docs/resource/host.md | 8 ++++---- model/resource/host.yaml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/resource/host.md b/docs/resource/host.md index f7d3e6f143..0daa5c7e05 100644 --- a/docs/resource/host.md +++ b/docs/resource/host.md @@ -36,12 +36,12 @@ | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `host.cpu.vendor_id` | string | Processor manufacturer identifier. A maximum 12-character string. | `GenuineIntel` | Opt-In | +| `host.cpu.vendor.id` | string | Processor manufacturer identifier. A maximum 12-character string. | `GenuineIntel` | Opt-In | | `host.cpu.family` | int | Numeric value specifying the family or generation of the CPU. | `6` | Opt-In | -| `host.cpu.model` | int | Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. | `6` | 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.model.id` | int | Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. | `6` | 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.cache_size` | int | The amount of level 2 memory cache available to the processor (in Bytes). | `12288000` | Opt-In | +| `host.cpu.cache.l2.size` | int | The amount of level 2 memory cache available to the processor (in Bytes). | `12288000` | Opt-In | ## Collecting host.id from non-containerized systems diff --git a/model/resource/host.yaml b/model/resource/host.yaml index 750c4f0400..1753b830c2 100644 --- a/model/resource/host.yaml +++ b/model/resource/host.yaml @@ -76,7 +76,7 @@ groups: brief: > A host's CPU information attributes: - - id: vendor_id + - id: vendor.id requirement_level: opt_in type: string brief: > @@ -88,14 +88,14 @@ groups: brief: > Numeric value specifying the family or generation of the CPU. examples: [ 6 ] - - id: model + - id: model.id requirement_level: opt_in type: int brief: > Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. examples: [ 6 ] - - id: model_name + - id: model.name requirement_level: opt_in type: string brief: > @@ -107,7 +107,7 @@ groups: brief: > Stepping or core revisions. examples: [ 1 ] - - id: cache_size + - id: cache.l2.size requirement_level: opt_in type: int brief: > From 7354d756707d5e3b7502ad01f80c4a900f544715 Mon Sep 17 00:00:00 2001 From: ChrsMark Date: Thu, 31 Aug 2023 14:49:39 +0300 Subject: [PATCH 7/8] Add changelog and vendor id note Signed-off-by: ChrsMark --- CHANGELOG.md | 2 ++ docs/resource/host.md | 4 +++- model/resource/host.yaml | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6faafa19c4..8fdb96d53a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,8 @@ release. ([#252](https://github.com/open-telemetry/semantic-conventions/pull/252)) - Simplify HTTP metric briefs. ([#276](https://github.com/open-telemetry/semantic-conventions/pull/276)) +- Add host cpu info. + ([#209](https://github.com/open-telemetry/semantic-conventions/pull/209)) ## v1.21.0 (2023-07-13) diff --git a/docs/resource/host.md b/docs/resource/host.md index 0daa5c7e05..150755dc19 100644 --- a/docs/resource/host.md +++ b/docs/resource/host.md @@ -36,12 +36,14 @@ | Attribute | Type | Description | Examples | Requirement Level | |---|---|---|---|---| -| `host.cpu.vendor.id` | string | Processor manufacturer identifier. A maximum 12-character string. | `GenuineIntel` | Opt-In | +| `host.cpu.vendor.id` | string | Processor manufacturer identifier. A maximum 12-character string. [1] | `GenuineIntel` | Opt-In | | `host.cpu.family` | int | Numeric value specifying the family or generation of the CPU. | `6` | Opt-In | | `host.cpu.model.id` | int | Model identifier. It provides more granular information about the CPU, distinguishing it from other CPUs within the same family. | `6` | 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.cache.l2.size` | int | The amount of level 2 memory cache available to the processor (in Bytes). | `12288000` | 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. ## Collecting host.id from non-containerized systems diff --git a/model/resource/host.yaml b/model/resource/host.yaml index 1753b830c2..2839d8f660 100644 --- a/model/resource/host.yaml +++ b/model/resource/host.yaml @@ -81,6 +81,9 @@ groups: 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 requirement_level: opt_in From e224edc56bc8b0dea9594e156c4892133eebadad Mon Sep 17 00:00:00 2001 From: Chris Mark Date: Sat, 2 Sep 2023 10:17:07 +0300 Subject: [PATCH 8/8] Update CHANGELOG.md Co-authored-by: Joao Grassi --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fdb96d53a..ed0bba815c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,7 +59,7 @@ release. ([#252](https://github.com/open-telemetry/semantic-conventions/pull/252)) - Simplify HTTP metric briefs. ([#276](https://github.com/open-telemetry/semantic-conventions/pull/276)) -- Add host cpu info. +- Add host cpu resource attributes. ([#209](https://github.com/open-telemetry/semantic-conventions/pull/209)) ## v1.21.0 (2023-07-13)