Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to collect host architecture #1483

Merged
merged 8 commits into from
Mar 5, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ release.
([#1439](https://github.com/open-telemetry/opentelemetry-specification/pull/1439))
- Add [`ForceFlush`](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#forceflush) to SDK's `TracerProvider` ([#1452](https://github.com/open-telemetry/opentelemetry-specification/pull/1452))
- Add `elasticsearch` to `db.system` semantic conventions ([#1463](https://github.com/open-telemetry/opentelemetry-specification/pull/1463))
- Add `arch` to `host` semantic conventions ([#1483](https://github.com/open-telemetry/opentelemetry-specification/pull/1483))
- Add `runtime` to `container` semantic conventions ([#1482](https://github.com/open-telemetry/opentelemetry-specification/pull/1482))

## v1.0.1 (2021-02-11)
Expand Down
21 changes: 21 additions & 0 deletions semantic_conventions/resource/host.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@ groups:
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: ARM_64
value: 'ARM_64'
brief: "ARM 64-bit"
- id: ARM_32
value: 'ARM_32'
brief: "ARM 32-bit"
- id: AMD_64
value: 'AMD_64'
brief: "AMD 64-bit"
- id: x86
value: 'x86'
brief: "x86 32-bit"
- id: x86_64
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved
value: 'x86_64'
brief: "x86 64-bit"
brief: >
The CPU architecture the host system is running on.
anuraaga marked this conversation as resolved.
Show resolved Hide resolved
carlosalberto marked this conversation as resolved.
Show resolved Hide resolved
- id: image.name
type: string
brief: >
Expand Down
11 changes: 11 additions & 0 deletions specification/resource/semantic_conventions/host.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,18 @@
| `host.id` | string | Unique host ID. For Cloud, this must be the instance_id assigned by the cloud provider. | `opentelemetry-test` | No |
| `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` | No |
| `host.type` | string | Type of host. For Cloud, this must be the machine type. | `n1-standard-1` | No |
| `host.arch` | string | The CPU architecture the host system is running on. | `ARM_64` | No |
| `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` | No |
| `host.image.id` | string | VM image ID. For Cloud, this value is from the provider. | `ami-07b06b442921831e5` | No |
| `host.image.version` | string | The version string of the VM image as defined in [Version Attributes](README.md#version-attributes). | `0.1` | No |

`host.arch` MUST be one of the following or, if none of the listed values apply, a custom value:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Values here neither match the common convention for Linux / Debian arch, e.g. not matching what's reported by uname -m, nor match what Node.js os.arch() API would have reported; nor what Rust architecture uses for the standard set of arch.... For different languages - you'd have different strings. And none of them would match the list proposed here 😄 So it's going to be quite an adventure to normalize to that proposed list 🤷

I believe a better set could be this:

Architecture Applies to
x86 x86, wow64, i386, i486, etc.
amd64 x86_64, amd64, x64
arm32 arm32
arm64 arm64, aarch64
ppc32 32-bit PowerPC
ppc64 64-bit PowerPC
ia64 Itanium
other indistinguishable, or not listed here. Architecture as reported by the language of choice without normalizing it / without bringing it to common denominator.

C++, Rust, or Node - typically have their own API to obtain the process arch string. This string is going to be in their own common format. For Node - this list is well-described here: https://nodejs.org/api/os.html#os_os_arch - I personally believe Node's list is quite reasonable.

More complete set of architectures is described here in Linux kernel tree:
https://github.com/torvalds/linux/tree/master/arch

If you truly intend to describe the host arch , it would be reasonable to respect the Linux standard names for the archs, as the most prominent host OS. That's also what uname -m command would typically report, namely [arm|arm64|ia64|mips|x86]. I would've left the loophole in this list to allow reporting what OS language-specific API reports as architecture. Any data analysis within a slice of data reported by agents written in specific language is consistent: a language (e.g. node) would report only a fixed set of archs. There is also not going to be any need to normalize.

I don't like this proposed list because it does not seem to align with the arch lists typically captured by prominent language APIs, neither matches the Linux kernel arch list.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks so much better. Go has a similar approach here. I initially wanted to propose something more aligned with uname but the formatting of OS names made me want to follow the UPPER_CASE style here. I'm modifying this PR in a bit.


| Value | Description |
|---|---|
| `ARM_64` | ARM 64-bit |
| `ARM_32` | ARM 32-bit |
| `AMD_64` | AMD 64-bit |
| `x86` | x86 32-bit |
| `x86_64` | x86 64-bit |
<!-- endsemconv -->