-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
metrics: Add policy_namespace label to per-policy memory metric
This fixes a metrics collection error that was occurring in case there were multiple namespaced policies with the same name. The metrics collector is iterating over all policies and reports tetragon_tracingpolicy_kernel_memory_bytes metric for each of them. The metric used to be labeled only with the policy name, so in case there was a second policy with the same name, the collector reported a duplicate what causes the entire metrics collection job to fail. Adding a policy_namespace label should prevent duplicates. There is an underlying assumption that each policy returned by ListTracingPolicies has a unique (name, namespace) tuple - if it's not the case, then metrics collection might fail again. Also, I'm not sure if per-policy memory metrics should be reported for policies in states different than loaded. Currently they are - I didn't change that behaviour, but it's now covered by tests. Fixes: a5301b8 ("pkg/metrics: add metrics for policy kernel memory us") Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
- Loading branch information
Showing
3 changed files
with
36 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters