Skip to content

[k8s] Fix updowncounters to follow the non-pluralization rule#2822

Merged
jsuereth merged 5 commits intoopen-telemetry:mainfrom
ChrsMark:fix_k8s_updowncounters
Oct 26, 2025
Merged

[k8s] Fix updowncounters to follow the non-pluralization rule#2822
jsuereth merged 5 commits intoopen-telemetry:mainfrom
ChrsMark:fix_k8s_updowncounters

Conversation

@ChrsMark
Copy link
Copy Markdown
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.pod.allocatable
  • 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
  • k8s.job.active_pods -> k8s.job.pod.active
  • k8s.job.failed_pods -> k8s.job.pod.failed
  • k8s.job.successful_pods -> k8s.job.pod.successful
  • k8s.job.desired_successful_pods -> k8s.job.pod.desired_successful
  • k8s.job.max_parallel_pods -> k8s.job.pod.max_parallel
  • k8s.cronjob.active_jobs -> k8s.cronjob.job.active
  • k8s.deployment.desired_pods -> k8s.deployment.pod.desired
  • k8s.deployment.available_pods -> k8s.deployment.pod.available
  • k8s.replicaset.desired_pods -> k8s.replicaset.pod.desired
  • k8s.replicaset.available_pods -> k8s.replicaset.pod.available
  • k8s.replicationcontroller.desired_pods -> k8s.replicationcontroller.pod.desired
  • k8s.replicationcontroller.available_pods -> k8s.replicationcontroller.pod.available
  • k8s.statefulset.desired_pods -> k8s.statefulset.pod.desired
  • k8s.statefulset.ready_pods -> k8s.statefulset.pod.ready
  • k8s.statefulset.current_pods -> k8s.statefulset.pod.current
  • k8s.statefulset.updated_pods -> k8s.statefulset.pod.updated
  • k8s.hpa.desired_pods -> k8s.hpa.pod.desired
  • k8s.hpa.current_pods -> k8s.hpa.pod.current
  • k8s.hpa.max_pods -> k8s.hpa.pod.max
  • k8s.hpa.min_pods -> k8s.hpa.pod.min

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 requested review from a team as code owners September 29, 2025 11:27
@ChrsMark ChrsMark force-pushed the fix_k8s_updowncounters branch from 1761c7e to 1dc71dc Compare September 29, 2025 11:33
@ChrsMark ChrsMark requested a review from a team as a code owner September 29, 2025 11:33
@ChrsMark ChrsMark force-pushed the fix_k8s_updowncounters branch from 1dc71dc to 7a3898b Compare September 29, 2025 11:41
@ChrsMark ChrsMark requested a review from a team as a code owner September 29, 2025 11:41
@ChrsMark ChrsMark force-pushed the fix_k8s_updowncounters branch 3 times, most recently 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
Comment thread docs/non-normative/k8s-migration.md Outdated
@github-project-automation github-project-automation Bot moved this from Awaiting codeowners approval to Needs More Approval in Semantic Conventions Triage Sep 30, 2025
Comment thread model/k8s/deprecated/metrics-deprecated.yaml
Comment thread model/k8s/deprecated/metrics-deprecated.yaml
@dmitryax
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 thread .chloggen/fix_k8s_updowncounters.yaml Outdated
Comment thread model/k8s/deprecated/metrics-deprecated.yaml
@jsuereth jsuereth moved this from Needs More Approval to Ready to be Merged in Semantic Conventions Triage Oct 7, 2025
@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
@ChrsMark ChrsMark moved this from In Review to In Progress in K8s SemConv SIG Oct 21, 2025
@ChrsMark ChrsMark moved this from Ready to be Merged to Awaiting codeowners approval in Semantic Conventions Triage Oct 21, 2025
@ChrsMark
Copy link
Copy Markdown
Member Author

I will update this based on the outcome of #2822 (comment).

ChrsMark and others added 2 commits October 21, 2025 14:51
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Co-authored-by: David Ashpole <dashpole@google.com>
@ChrsMark ChrsMark force-pushed the fix_k8s_updowncounters branch from 03d620f to 5fb40ce Compare October 21, 2025 11:53
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Copy link
Copy Markdown
Member

@dmitryax dmitryax left a comment

Choose a reason for hiding this comment

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

LGTM

@github-project-automation github-project-automation Bot moved this from Awaiting codeowners approval to Needs More Approval in Semantic Conventions Triage Oct 21, 2025
@ChrsMark ChrsMark requested review from dashpole and jinja2 October 22, 2025 10:41
@ChrsMark
Copy link
Copy Markdown
Member Author

@open-telemetry/semconv-k8s-approvers please take another look since this PR has been updated.

@open-telemetry/specs-semconv-maintainers could you help with the deprecation question from #2822 (comment)? Right now the checks fail because of the "double" deprecation chain, or do I miss anything else there?

Comment thread docs/system/k8s-metrics.md Outdated
Comment thread docs/system/k8s-metrics.md Outdated
Comment thread docs/system/k8s-metrics.md Outdated
Comment thread docs/system/k8s-metrics.md Outdated
Comment thread docs/system/k8s-metrics.md Outdated
Comment thread docs/system/k8s-metrics.md Outdated
Comment thread docs/system/k8s-metrics.md Outdated
Comment thread docs/non-normative/k8s-migration.md
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
@jsuereth jsuereth added this pull request to the merge queue Oct 26, 2025
Merged via the queue into open-telemetry:main with commit 81278be Oct 26, 2025
18 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in K8s SemConv SIG Oct 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done
Archived in project

Development

Successfully merging this pull request may close these issues.

Review updowncounter naming in k8s

8 participants