Skip to content

Conversation

@odubajDT
Copy link
Contributor

@odubajDT odubajDT commented Sep 9, 2025

Description

Sync allocatable metric names with the latest semconv. This change is being handled with a feature gate, so users have a clean transition phase

Link to tracking issue

Fixes #40708

Documentation

README

@odubajDT odubajDT marked this pull request as ready for review September 9, 2025 09:00
@github-actions github-actions bot requested a review from povilasv September 9, 2025 09:00
## Feature Gates
### `k8scluster.allocatableNamespace.enabled`
Copy link
Member

Choose a reason for hiding this comment

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

Thank's @odubajDT for pushing this forward!

Shall we start using a generic feature gate for all these changes that aim to align the k8s components with the k8s semantic conventions?
We can start using the feature gate described at https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-migration/ even though the Semantic Conventions are not stable yet.

@dmitryax @TylerHelmuth WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A global feature gate may potentially enable features, that users do not want to enable, therefore I would rather stick to the concept of having a feature gate per feature, but I am opened for opinions

Copy link
Member

Choose a reason for hiding this comment

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

The idea here is to have a single feature gate for porting SemConv to Collector k8s components, i.e. semconv.k8s.enableStable. In this we handle SemConv porting with one single gate making the migration easier. At least that's the plan we have defined from SemConv's stability groups and documented at https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-migration/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understand, but if multiple features in multiple different components are enabled/disabled by a single feature gate, it may cause problems for the users. For example: User want to enable feature X in component Z, but with the feature gate, also feature B in component A is enabled. Therefore user enables behavior, that his infrastructure is not prepared yet.

Copy link
Member

Choose a reason for hiding this comment

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

The feature gate semconv.k8s.enableStable will only enable stable Semantic Conventions for k8s across the k8s components. Can this be considered a different feature? In any case the counterpart of this feature gate will be the semconv.k8s.enableLegacy and there will be a period where the dual scheme will be needed for a smooth migration. Metrics can always be switched on/off individually.

I think this will give us less overhead during the migration period, because having to maintain multiple feature gates will be a pain both from code perspective but also for the users that would need to handle them differently in their configurations.

However, I'd be open to hear if we can do better than what the decided single feature gate suggests. Also interested to hear what @dmitryax @TylerHelmuth @braydonk think on this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, thanks for the clarification! Waiting for @dmitryax @TylerHelmuth @braydonk opinions on which approach to go with here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

We already have an option to enable/disable particular metrics in the user config. I don't see why we would need to provide this granularity additionally. I find a option to double-publish more important. So I agree with @ChrsMark, we should have two feature gates to enable/disable old and new metrics. Maybe receiver.k8scluster.metrics.disableLegacy and receiver.k8scluster.metrics.enableStable? I'm not sure if we have any naming standard here.

While the receiver.k8scluster.metrics.enableStable is in alpha we can keep adding new metrics to it

Copy link
Member

Choose a reason for hiding this comment

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

At https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-migration/ we have came up with semconv.k8s.disableLegacy and semconv.k8s.enableLegacy, but we can still change it and make the gates receiver specific.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the opinions, should be adapted!

@odubajDT odubajDT marked this pull request as draft September 9, 2025 10:00
@odubajDT odubajDT marked this pull request as ready for review September 9, 2025 11:27
@odubajDT odubajDT force-pushed the k8scluster-allocatable branch from d48b9d7 to 93eaf01 Compare September 9, 2025 11:28
…emconv

Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
odubajDT and others added 4 commits September 17, 2025 08:47
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
@github-actions
Copy link
Contributor

github-actions bot commented Oct 9, 2025

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Oct 9, 2025
@odubajDT
Copy link
Contributor Author

odubajDT commented Oct 9, 2025

not stale

@odubajDT odubajDT removed the Stale label Oct 9, 2025
@odubajDT odubajDT changed the title [receiver/k8scluster] Sync allocatable metric names with the latest semconv [receiver/k8s_cluster] Sync allocatable metric names with the latest semconv Oct 21, 2025
odubajDT and others added 5 commits October 21, 2025 07:54
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
enabled: true
k8s.node.allocatable.memory:
enabled: true
k8s.node.allocatable.pods:
Copy link
Member

Choose a reason for hiding this comment

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

Apologies for the back and forth here. This is going to change again with open-telemetry/semantic-conventions#2822 because it needs to be aligned with SemConv project. I think the rest of the metrics should change too i.e. k8s.node.cpu.allocatable (I'll send a follow-up PR after). In this, I suggest we wait until we have the semconv part ready, which hopefully will be soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for taking care of it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[receiver/k8scluster] Sync allocatable metric names with the latest semconv

6 participants