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

[receiver/k8scluster] adding more Node resource attributes #30342

Closed
povilasv opened this issue Jan 9, 2024 · 8 comments
Closed

[receiver/k8scluster] adding more Node resource attributes #30342

povilasv opened this issue Jan 9, 2024 · 8 comments

Comments

@povilasv
Copy link
Contributor

povilasv commented Jan 9, 2024

Component(s)

receiver/k8scluster

Is your feature request related to a problem? Please describe.

I would like to use k8s cluster receiver to get more information about Node, such as Container Runtime Version, OS version and OS description.

Describe the solution you'd like

I propose to add these resource attributes added to Node metrics, which should be disabled by default:

  k8s.container_runtime.version:
    description: The version of container runtime used by Kubernetes Node.
    type: string
    enabled: false

  os.version:
    description: The version of operating system used by Kubernetes Node.
    type: string
    enabled: false

  os.description:
    description: The os description used by Kubernetes Node.
    type: string
    enabled: false

Describe alternatives you've considered

No response

Additional context

I did a POC and this is how it looks rendered, when using kind cluster:

k8s_node_allocatable_cpu{k8s_container_runtime_version="containerd://1.6.9", k8s_kubelet_version="v1.25.3", k8s_node_name="kind-control-plane", os_description="Ubuntu 22.04.1 LTS", os_version="6.6.8-arch1-1"}

Which seems to fit the Otel Semantic conventions in https://opentelemetry.io/docs/specs/semconv/resource/os/

@povilasv povilasv added enhancement New feature or request needs triage New item requiring triage labels Jan 9, 2024
@povilasv povilasv changed the title [receiverr/k8scluster] adding more Node resource attributes [receiver/k8scluster] adding more Node resource attributes Jan 9, 2024
@TylerHelmuth TylerHelmuth added receiver/k8scluster priority:p2 Medium and removed needs triage New item requiring triage labels Jan 9, 2024
Copy link
Contributor

github-actions bot commented Jan 9, 2024

Pinging code owners for receiver/k8scluster: @dmitryax @TylerHelmuth @povilasv. See Adding Labels via Comments if you do not have permissions to add labels yourself.

dmitryax pushed a commit that referenced this issue Jan 12, 2024
**Description:**
I would like to use k8s cluster receiver to get more information about
Node, such as Container Runtime Version, OS version and OS description.

This is how it looks when using kind:
```
k8s_node_allocatable_cpu_{container_runtime="containerd", container_runtime_version="1.6.9", k8s_kubelet_version="v1.25.3", k8s_node_name="kind-control-plane", k8s_node_uid="29b8a758-ac58-45e7-9091-b9ed2e285be9", os_description="Ubuntu 22.04.1 LTS", os_version="6.6.10-arch1-1"}

```

**Link to tracking Issue:**

#30342
@jinja2
Copy link
Contributor

jinja2 commented Jan 16, 2024

@povilasv I realize this has been merged already but just want to raise a small concern I have. Could mapping os.version attr to the kernel version value be confusing for nodes running linux distros? For instance, a node running Ubuntu 22.04, could the user be expecting the version id as seen in /etc/os-release which would be 22.04 in this case, instead of the kernel version (value in /proc/sys/kernel).
Screenshot with the 2 different versions for example

os_kernel_version

I don't see any guidance for differentiating distro vs kernel version in semantic-conventions, and it isn't that confusing so should be okay. Just thinking out loud if this could potentially be a source of confusion.

Additionally, what do you think about exposing the nodeInfo.operatingSystem as os.type attr for completeness and can give more context for os.version? I should mention though that this is also available as the k8s standard node label kubernetes.io/os which users might already be extracting.

@TylerHelmuth
Copy link
Member

Which value between /etc/os-release or /proc/sys/kernel do you think is more "right"?

@jinja2
Copy link
Contributor

jinja2 commented Jan 16, 2024

To clarify, the kubelet is exposing the version info from /proc/sys/kernel as the kernelVersion field.

Which value between /etc/os-release or /proc/sys/kernel do you think is more "right"?

Both are technically right depending on whether you want the version of linux or of the distro. In this case, the accompanying os.description attribute which is the os name like Container-Optimized OS from Google or Ubuntu 22.04.3 LTS might set the expectation that the os.version is for the distro. Imo, adding os.type from nodeInfo. operatingSystem which will be set to linux/windows might make it more "correct" with os.version now referring to the os.type's version.

@povilasv povilasv reopened this Jan 17, 2024
@povilasv
Copy link
Contributor Author

povilasv commented Jan 17, 2024

I think it make sense to add os.type.

Regarding os.version I think we should rename it to kernel.version, given it's not OS version (Centos 7, Ubuntu 22, whatehever) but actual Linux kernel version.

This change wasn't yet released so we can do the breaking change.

Thoughts?

cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this issue Feb 1, 2024
)

**Description:**
I would like to use k8s cluster receiver to get more information about
Node, such as Container Runtime Version, OS version and OS description.

This is how it looks when using kind:
```
k8s_node_allocatable_cpu_{container_runtime="containerd", container_runtime_version="1.6.9", k8s_kubelet_version="v1.25.3", k8s_node_name="kind-control-plane", k8s_node_uid="29b8a758-ac58-45e7-9091-b9ed2e285be9", os_description="Ubuntu 22.04.1 LTS", os_version="6.6.10-arch1-1"}

```

**Link to tracking Issue:**

open-telemetry#30342
@povilasv
Copy link
Contributor Author

povilasv commented Feb 9, 2024

looks like adding os.kernel.version is blocked by open-telemetry/semantic-conventions#66

Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Apr 10, 2024
Copy link
Contributor

github-actions bot commented Jun 9, 2024

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants