Skip to content

Comments

feat: add new kube_service_spec_ports metric#2849

Open
Serializator wants to merge 3 commits intokubernetes:mainfrom
Serializator:ISSUE-2819-kube-service-port-metric
Open

feat: add new kube_service_spec_ports metric#2849
Serializator wants to merge 3 commits intokubernetes:mainfrom
Serializator:ISSUE-2819-kube-service-port-metric

Conversation

@Serializator
Copy link

What this PR does / why we need it:
Add new metric kube_service_spec_ports to represent ports on the service resource.

The kube_service_spec_ prefix matches with the naming convention for the rest of the metrics.

To stay aligned with other metrics, .spec.ports.appProtocol is not included as a label. The same is true for the kube_endpoint_address metric.

.spec.ports.targetPort is not included as a label due to its inconsistent value. It can be a named port or port number.

How does this change affect the cardinality of KSM:
Increases cardinality with a new time series.

Which issue(s) this PR fixes:
Fixes #2819

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 18, 2026
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If kube-state-metrics contributors determine this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Serializator
Once this PR has been reviewed and has the lgtm label, please assign catherinef-dev for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested a review from mrueg January 18, 2026 01:10
@github-project-automation github-project-automation bot moved this to Needs Triage in SIG Instrumentation Jan 18, 2026
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 18, 2026
@Serializator Serializator changed the title Add new kube_service_spec_ports metric feat: add new kube_service_spec_ports metric Jan 18, 2026
@Serializator Serializator force-pushed the ISSUE-2819-kube-service-port-metric branch from a35c311 to dc2f674 Compare January 18, 2026 01:18
Signed-off-by: Julian van den Berkmortel <7153670+Serializator@users.noreply.github.com>
Signed-off-by: Julian van den Berkmortel <7153670+Serializator@users.noreply.github.com>
Signed-off-by: Julian van den Berkmortel <7153670+Serializator@users.noreply.github.com>
@Serializator Serializator force-pushed the ISSUE-2819-kube-service-port-metric branch from dc2f674 to e9da2b6 Compare January 30, 2026 22:07
@Serializator
Copy link
Author

Hey @dgrisonnet & @mrueg! Would one of you have time to approve the workflow so tests can run? Thank you in advance!

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

Missing port information in service metrics

2 participants