Skip to content

Conversation

ChrsMark
Copy link
Member

@ChrsMark ChrsMark commented Sep 29, 2025

Fixes #2301

Changes

This brings names in alignment with the pluralisation guidelines: https://github.com/open-telemetry/semantic-conventions/blob/v1.37.0/docs/general/naming.md#do-not-pluralize-updowncounter-names

Renamed metrics:

  • k8s.node.allocatable.pods -> k8s.node.allocatable.pod.count
  • k8s.daemonset.current_scheduled_nodes -> k8s.daemonset.current_scheduled_node.count
  • k8s.daemonset.desired_scheduled_nodes -> k8s.daemonset.desired_scheduled_node.count
  • k8s.daemonset.misscheduled_nodes -> k8s.daemonset.misscheduled_node.count
  • k8s.daemonset.ready_nodes -> k8s.daemonset.ready_node.count
  • k8s.job.active_pods -> k8s.job.active_pod.count
  • k8s.job.failed_pods -> k8s.job.failed_pod.count
  • k8s.job.successful_pods -> k8s.job.successful_pod.count
  • k8s.job.desired_successful_pods -> k8s.job.desired_successful_pod.count
  • k8s.job.max_parallel_pods -> k8s.job.max_parallel_pod.count
  • k8s.cronjob.active_jobs -> k8s.cronjob.active_job.count
  • k8s.deployment.desired_pods -> k8s.deployment.desired_pod.count
  • k8s.deployment.available_pods -> k8s.deployment.available_pod.count
  • k8s.replicaset.desired_pods -> k8s.replicaset.desired_pod.count
  • k8s.replicaset.available_pods -> k8s.replicaset.available_pod.count
  • k8s.replicationcontroller.desired_pods -> k8s.replicationcontroller.desired_pod.count
  • k8s.replicationcontroller.available_pods -> k8s.replicationcontroller.available_pod.count
  • k8s.statefulset.desired_pods -> k8s.statefulset.desired_pod.count
  • k8s.statefulset.ready_pods -> k8s.statefulset.ready_pod.count
  • k8s.statefulset.current_pods -> k8s.statefulset.current_pod.count
  • k8s.statefulset.updated_pods -> k8s.statefulset.updated_pod.count
  • k8s.hpa.desired_pods -> k8s.hpa.desired_pod.count
  • k8s.hpa.current_pods -> k8s.hpa.current_pod.count
  • k8s.hpa.max_pods -> k8s.hpa.max_pod.count
  • k8s.hpa.min_pods -> k8s.hpa.min_pod.count

Merge requirement checklist

  • CONTRIBUTING.md guidelines followed.
  • Change log entry added, according to the guidelines in When to add a changelog entry.
    • If your PR does not need a change log, start the PR title with [chore]
  • Links to the prototypes or existing instrumentations (when adding or changing conventions)

@ChrsMark ChrsMark force-pushed the fix_k8s_updowncounters branch from f2ec37b to 6b81fd4 Compare September 29, 2025 11:53
@ChrsMark ChrsMark moved this to In Review in K8s SemConv SIG Sep 29, 2025
@ChrsMark ChrsMark moved this from Untriaged to Awaiting codeowners approval in Semantic Conventions Triage Sep 29, 2025
Co-authored-by: David Ashpole <[email protected]>
@github-project-automation github-project-automation bot moved this from Awaiting codeowners approval to Needs More Approval in Semantic Conventions Triage Sep 30, 2025
stability: development
deprecated:
reason: renamed
renamed_to: k8s.replicationcontroller.desired_pods
Copy link
Member

Choose a reason for hiding this comment

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

Should we maybe add k8s.replicationcontroller.desired_pods as an additional deprecated metric?
(as this is the second time this metric is being renamed)

Otherwise k8s.replicationcontroller.desired_pods wouldn't be mentioned anywhere as a deprecated metric with only the original (from the first rename) name being documented here (i.e. k8s.replication_controller.desired_pods).

Copy link
Member Author

@ChrsMark ChrsMark Sep 30, 2025

Choose a reason for hiding this comment

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

I had both metrics originally, but the validation failed cause it was pointing to a non-existing metric (the first rename). Not sure if this is expected or an unhandled corner-case of our tooling 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the tooling expects all the previous metric names to remain around.

Given these are not "stable" I think there's less enforcement around keeping things around, although it is risky depending on whether the intermediate name was used.

If you have a caveat asking folks NOT to migrate to new metrics past version "X" then you can drop the intermediary if it's between "X" and now, as (theoretically) anyone taking a dependency there new this might be changing.

stability: development
deprecated:
reason: renamed
renamed_to: k8s.replicationcontroller.available_pods
Copy link
Member

Choose a reason for hiding this comment

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

same as the comment above about adding additional deprecated metric

@dmitryax
Copy link
Member

dmitryax commented Oct 1, 2025

Even after #2306 is resolved, it still unclear why is this change required. Looking at these guidelines it seems like existing naming still valid.

  1. They cannot be taken as namespaces
  2. "value being recorded represents discrete instances of a countable quantity"
### Naming rules for counters and UpDownCounters

#### Pluralization

Metric namespaces SHOULD NOT be pluralized.

Metric names SHOULD NOT be pluralized, unless the value being recorded
represents discrete instances of a
[countable quantity](https://wikipedia.org/wiki/Count_noun).
Generally, the name SHOULD be pluralized only if the unit of the metric in
question is a non-unit (like `{fault}` or `{operation}`).

Examples:

- `system.filesystem.utilization`, `http.server.request.duration`, and `system.cpu.time`
  should not be pluralized, even if many data points are recorded.
- `system.paging.faults`, `system.disk.operations`, and `system.network.packets`
  should be pluralized, even if only a single data point is recorded.

#### Do not pluralize UpDownCounter names

UpDownCounter names SHOULD NOT be pluralized.

For example if we have a namespace `system.process` which contains all metrics related
to the processes then to represent the count of the processes we can have a metric named
`system.process.count` instead of `system.processes`. Similarly, `cicd.pipeline.run.active` is preferred
over the `cicd.pipeline.active_runs`.

What am I missing?

@dmitryax
Copy link
Member

dmitryax commented Oct 2, 2025

The PR introduces a significant number of breaking changes, and I’m not sure the current justification is sufficient.

@ChrsMark
Copy link
Member Author

ChrsMark commented Oct 2, 2025

@dmitryax the guidance moves us towards consistency based on the discussions happened in the respective guidance PR and specifically #2317 (comment). The part that applies here is that UpDownCounters should not be pluralised, with the following example:

Similarly, `cicd.pipeline.run.active` is preferred
over the `cicd.pipeline.active_runs`.

Also note that those metrics are not in use yet in the Collector in the current format hence it's not really an impactful breaking change. Those metrics are already different to the Collector's ones as we can see in https://github.com/open-telemetry/semantic-conventions/pull/2822/files#diff-ba5fa96c108eca125c2c88f68cdfb0a3d0c95792912f5518eedd55666bc1c033.

I don't have a strong preference for this change either but it seems that we need it so as to be consistent with the rest of the project.

@lmolkova please chime in if we miss anything here.

@dmitryax
Copy link
Member

dmitryax commented Oct 7, 2025

Ok, but the guidelines in the spec are still not strong enough for this change. All of the existing metrics seem to follow this section:

Metric names SHOULD NOT be pluralized, unless the value being recorded
represents discrete instances of a
countable quantity.
Generally, the name SHOULD be pluralized only if the unit of the metric in
question is a non-unit (like {fault} or {operation})
.

Do we need to remove that part from the spec?

In general, looking at the changed metrics names as a user, the existing ones seem to be more intuitive than to the new ones.

Comment on lines +24 to +28
- k8s.node.allocatable.pods -> k8s.node.allocatable.pod.count
- k8s.daemonset.current_scheduled_nodes -> k8s.daemonset.current_scheduled_node.count
- k8s.daemonset.desired_scheduled_nodes -> k8s.daemonset.desired_scheduled_node.count
- k8s.daemonset.misscheduled_nodes -> k8s.daemonset.misscheduled_node.count
- k8s.daemonset.ready_nodes -> k8s.daemonset.ready_node.count
Copy link
Member

@dmitryax dmitryax Oct 7, 2025

Choose a reason for hiding this comment

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

Is it expected that we always just add .count suffix? Looking at the discussions behind the new guidelines, should we consider something like this?

Suggested change
- k8s.node.allocatable.pods -> k8s.node.allocatable.pod.count
- k8s.daemonset.current_scheduled_nodes -> k8s.daemonset.current_scheduled_node.count
- k8s.daemonset.desired_scheduled_nodes -> k8s.daemonset.desired_scheduled_node.count
- k8s.daemonset.misscheduled_nodes -> k8s.daemonset.misscheduled_node.count
- k8s.daemonset.ready_nodes -> k8s.daemonset.ready_node.count
- k8s.daemonset.current_scheduled_nodes -> k8s.daemonset.node.current_scheduled
- k8s.daemonset.desired_scheduled_nodes -> k8s.daemonset.node.desired_scheduled
- k8s.daemonset.misscheduled_nodes -> k8s.daemonset.node.misscheduled
- k8s.daemonset.ready_nodes -> k8s.daemonset.node.ready

Similar for other metrics. Just asking for sake of discussion.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeap, adding .count is one option but what you suggest is also an option. I went for .count which looked less controversial to me (i.e. k8s.daemonset.node.ready might not be so clear?) but I would be happy to change it to what you suggest if it's preferable.

@lmolkova could you let us know what your suggestion would be here?
@open-telemetry/semconv-k8s-approvers please let us know what you think.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe your PR is ready to be merged. @lmolkova is OOO right now.

Personally, I like the consistency of .count you have here, but I think both options are viable

Copy link
Contributor

Choose a reason for hiding this comment

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

I marked the PR as ready to be merged. If the k8s SIG feels confident in this direction, please close this comment and this will be merged, otherwise please leave this open.

stability: development
deprecated:
reason: renamed
renamed_to: k8s.replicationcontroller.desired_pods
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the tooling expects all the previous metric names to remain around.

Given these are not "stable" I think there's less enforcement around keeping things around, although it is risky depending on whether the intermediate name was used.

If you have a caveat asking folks NOT to migrate to new metrics past version "X" then you can drop the intermediary if it's between "X" and now, as (theoretically) anyone taking a dependency there new this might be changing.

@jsuereth jsuereth moved this from Needs More Approval to Ready to be Merged in Semantic Conventions Triage Oct 7, 2025
@jsuereth jsuereth enabled auto-merge October 7, 2025 12:07
@github-project-automation github-project-automation bot moved this from Ready to be Merged to Needs More Approval in Semantic Conventions Triage Oct 7, 2025
@joaopgrassi joaopgrassi moved this from Needs More Approval to Ready to be Merged in Semantic Conventions Triage Oct 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Review
Status: Ready to be Merged

Development

Successfully merging this pull request may close these issues.

Review updowncounter naming in k8s

7 participants