Skip to content

Conversation

@AritraDey-Dev
Copy link
Member

Fixes #2798

Description

This PR migrates Prometheus metrics to use pkg/metrics helpers.

Changelog

Migrated metrics to use pkg/metrics helpers 

@AritraDey-Dev AritraDey-Dev requested a review from a team as a code owner October 21, 2025 20:24
@netlify
Copy link

netlify bot commented Oct 21, 2025

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit ffae65b
🔍 Latest deploy log https://app.netlify.com/projects/tetragon/deploys/68f7ee853607420008993da5
😎 Deploy Preview https://deploy-preview-4222--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@AritraDey-Dev AritraDey-Dev force-pushed the metrics/migrate-to-helpers branch from c61d544 to ffae65b Compare October 21, 2025 20:35
@AritraDey-Dev AritraDey-Dev requested a review from mtardy as a code owner October 21, 2025 20:35
Copy link
Contributor

@kkourt kkourt left a comment

Choose a reason for hiding this comment

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

Small comment from my side: can you please add some context about the changes in the commit message? It would be good to get an idea of what this change does and why it is needed without having to see the GH issue.

@AritraDey-Dev AritraDey-Dev force-pushed the metrics/migrate-to-helpers branch from ffae65b to 6fadafc Compare October 22, 2025 14:08
@AritraDey-Dev AritraDey-Dev requested a review from kkourt October 22, 2025 14:27
@mtardy
Copy link
Member

mtardy commented Oct 24, 2025

Hey, could you wrap your commit description (use gq in vim for that for example)?

Also could the commit description contains more of the "why" of the change instead of the what (that should come from the title already), see more https://tetragon.io/docs/contribution-guide/submitting-a-pull-request/#write-a-commit-message.

Thank you :)

@mtardy mtardy added the release-note/misc This PR makes changes that have no direct user impact. label Oct 24, 2025
@AritraDey-Dev AritraDey-Dev force-pushed the metrics/migrate-to-helpers branch from 6fadafc to d8a3f92 Compare October 24, 2025 12:58
Copy link
Contributor

@kkourt kkourt left a comment

Choose a reason for hiding this comment

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

Thanks!

LGTM, but this is really tricky to review because to check for correctness, you need to check, for example, that the Inc() method uses the same type as the one we use to generate the constrained labels. I wonder if there is a way to avoid this duplication, but it's not obvious to me how.

@AritraDey-Dev AritraDey-Dev force-pushed the metrics/migrate-to-helpers branch from d8a3f92 to a2a8c9b Compare October 30, 2025 10:47
The pkg/metrics helpers provide critical functionality that raw
prometheus.New*Vec functions lack: automatic metric cleanup for
deleted pods, cardinality constraints, configurable high-cardinality
labels, and automatic documentation generation. Migrating to these
helpers ensures consistent metric management across the codebase and
prevents unbounded cardinality growth.

Fixes cilium#2798

Signed-off-by: Aritra Dey <[email protected]>
@AritraDey-Dev AritraDey-Dev force-pushed the metrics/migrate-to-helpers branch from a2a8c9b to 2e3d8e3 Compare October 30, 2025 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/misc This PR makes changes that have no direct user impact.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate metrics to use pkg/metrics helpers

3 participants