Skip to content

ipam: Register k8s sync metrics for cluster-pool#41531

Merged
pippolo84 merged 1 commit intocilium:mainfrom
pippolo84:pr/pippolo84/cluster-pool-k8s-sync-metrics
Sep 18, 2025
Merged

ipam: Register k8s sync metrics for cluster-pool#41531
pippolo84 merged 1 commit intocilium:mainfrom
pippolo84:pr/pippolo84/cluster-pool-k8s-sync-metrics

Conversation

@pippolo84
Copy link
Copy Markdown
Member

@pippolo84 pippolo84 commented Sep 4, 2025

In cluster-pool IPAM mode the allocator creates a metrics set related to the activity of the internal trigger. Specifically, the trigger is called (and the related metrics are updated) each time the internal status of the CiliumNode, including the allocated pod CIDRs, is synced to k8s. There is however an issue, since the metrics are not correctly registered to the metrics registry, therefore they are not actually available.

This commit registers the metrics so that they can be correctly exposed and visible with the cilium-operator-generic metrics list command.


In a kind cluster, with --enable-metrics passed to the operator

Before:

$ kubectl -n kube-system exec -ti deploy/cilium-operator -- cilium-operator-generic metrics list | grep "ipam_k8s_sync"
<empty>

After:

$ kubectl -n kube-system exec -ti deploy/cilium-operator -- cilium-operator-generic metrics list | grep "ipam_k8s_sync"
cilium_operator_ipam_k8s_sync_duration_seconds                                                                                                   0.000107
cilium_operator_ipam_k8s_sync_folds                                                                                                              2.000000
cilium_operator_ipam_k8s_sync_latency_seconds                                                                                                    1.000271
cilium_operator_ipam_k8s_sync_queued_total                                                                                                       3.000000
Register cluster-pool IPAM metrics related to CiliumNode synchronization with k8s

@pippolo84 pippolo84 added release-note/minor This PR changes functionality that users may find relevant to operating Cilium. area/metrics Impacts statistics / metrics gathering, eg via Prometheus. area/ipam IP address management, including cloud IPAM labels Sep 4, 2025
@pippolo84 pippolo84 force-pushed the pr/pippolo84/cluster-pool-k8s-sync-metrics branch from d5467a8 to c801cec Compare September 4, 2025 15:37
@pippolo84 pippolo84 marked this pull request as ready for review September 4, 2025 15:39
@pippolo84 pippolo84 requested review from a team as code owners September 4, 2025 15:39
@pippolo84 pippolo84 added kind/bug This is a bug in the Cilium logic. needs-backport/1.16 needs-backport/1.17 This PR / issue needs backporting to the v1.17 branch needs-backport/1.18 This PR / issue needs backporting to the v1.18 branch release-note/bug This PR fixes an issue in a previous release of Cilium. and removed release-note/minor This PR changes functionality that users may find relevant to operating Cilium. labels Sep 4, 2025
Copy link
Copy Markdown
Contributor

@tommyp1ckles tommyp1ckles left a comment

Choose a reason for hiding this comment

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

Thanks @pippolo84

@pippolo84
Copy link
Copy Markdown
Member Author

/test

In cluster-pool IPAM mode the allocator creates a metrics set related to
the activity of the internal trigger. Specifically, the trigger is
called (and the related metrics are updated) each time the internal
status of the CiliumNode, including the allocated pod CIDRs, is synced
to k8s.  There is however an issue, since the metrics are not correctly
registered to the metrics registry, therefore they are not actually
available.

This commit registers the metrics so that they can be correctly exposed
and visible with the `cilium-operator-generic metrics list` command.

Signed-off-by: Fabio Falzoi <fabio.falzoi@isovalent.com>
@pippolo84 pippolo84 force-pushed the pr/pippolo84/cluster-pool-k8s-sync-metrics branch from c801cec to e8af548 Compare September 17, 2025 15:59
@pippolo84
Copy link
Copy Markdown
Member Author

/test

1 similar comment
@pippolo84
Copy link
Copy Markdown
Member Author

/test

@pippolo84
Copy link
Copy Markdown
Member Author

ci-e2e-upgrade flake tracked in #41520, rerunning

@pippolo84 pippolo84 added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Sep 18, 2025
@pippolo84 pippolo84 added this pull request to the merge queue Sep 18, 2025
Merged via the queue into cilium:main with commit 21331c8 Sep 18, 2025
69 checks passed
@pippolo84 pippolo84 deleted the pr/pippolo84/cluster-pool-k8s-sync-metrics branch September 18, 2025 10:35
@pippolo84 pippolo84 mentioned this pull request Sep 22, 2025
17 tasks
@pippolo84 pippolo84 added the backport/author The backport will be carried out by the author of the PR. label Sep 22, 2025
@giorio94
Copy link
Copy Markdown
Member

giorio94 commented Nov 4, 2025

Hey @pippolo84 👋 Backporter here. Kind reminder that this PR is marked for author backport. Please check if it still makes sense to backport it, or the labels should be dropped.

@pippolo84
Copy link
Copy Markdown
Member Author

Hey @pippolo84 👋 Backporter here. Kind reminder that this PR is marked for author backport. Please check if it still makes sense to backport it, or the labels should be dropped.

Will take a look in the next days, thanks for the heads up!

@giorio94
Copy link
Copy Markdown
Member

Hey @pippolo84 👋 Backporter here. Kind reminder that this PR is marked for author backport. Please check if it still makes sense to backport it, or the labels should be dropped.

@cilium-release-bot cilium-release-bot bot moved this to Released in cilium v1.19.0 Feb 3, 2026
@julianwiedmann julianwiedmann added affects/v1.16 This issue affects v1.16 branch and removed needs-backport/1.16 labels Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects/v1.16 This issue affects v1.16 branch area/ipam IP address management, including cloud IPAM area/metrics Impacts statistics / metrics gathering, eg via Prometheus. backport/author The backport will be carried out by the author of the PR. kind/bug This is a bug in the Cilium logic. needs-backport/1.17 This PR / issue needs backporting to the v1.17 branch needs-backport/1.18 This PR / issue needs backporting to the v1.18 branch ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.

Projects

No open projects
Status: Released

Development

Successfully merging this pull request may close these issues.

6 participants