Skip to content

metrics: clean up policy metrics when tracing policies are deleted#4500

Open
gr3chk wants to merge 1 commit intocilium:mainfrom
gr3chk:pr/gr3chk/policy-metrics-cleanup
Open

metrics: clean up policy metrics when tracing policies are deleted#4500
gr3chk wants to merge 1 commit intocilium:mainfrom
gr3chk:pr/gr3chk/policy-metrics-cleanup

Conversation

@gr3chk
Copy link
Copy Markdown

@gr3chk gr3chk commented Jan 10, 2026

Policy-labeled metric series are currently kept after a TracingPolicy is deleted, which can cause stale metrics to remain exported.

Register tracing-policy metrics for cleanup and removes their series from the registry when a policy is deleted, regardless of how the policy was created or removed.

Fixes: #2256

Description

Ensure policy-labeled metric series are properly cleaned up when a TracingPolicy is deleted, preventing stale metrics from remaining exported.

Changelog

Fix cleanup of policy-labeled metric series when tracing policies are deleted.

Policy-labeled metric series are currently kept after a TracingPolicy is
deleted, which can cause stale metrics to remain exported.

Register tracing-policy metrics for cleanup and removes their
series from the registry when a policy is deleted, regardless of how the
policy was created or removed.

Fixes: cilium#2256

Signed-off-by: David Grechkin <gr3chkin@gmail.com>
@gr3chk gr3chk requested a review from a team as a code owner January 10, 2026 12:48
@gr3chk gr3chk requested a review from jrfastab January 10, 2026 12:48
@kkourt kkourt added the needs-rebase This PR needs to be rebased because it has merge conflicts. label Apr 27, 2026
Copy link
Copy Markdown
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.

Hi @gr3chk,

Apologies for the delayed reply, The PR makes sense to me, but, unfortunately, it needs to be rebased. Are you interested in continuing your work on it?

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

Labels

needs-rebase This PR needs to be rebased because it has merge conflicts.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete metrics with policy label on policy delete

2 participants