Skip to content

Commit

Permalink
eventcachemetrics: Initialize metrics with labels
Browse files Browse the repository at this point in the history
Initialize tetragon_event_cache_retries_total with all possible entry types.

Initialize tetragon_event_cache_<entry_type>_errors_total with all possible
event types.

Initialize tetragon_event_cache_errors_total with all (one) possible errors and
all possible event types.

Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
  • Loading branch information
lambdanis committed Feb 26, 2024
1 parent 79dd881 commit dcc08f4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pkg/metrics/eventcachemetrics/eventcachemetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,18 @@ func InitMetrics(registry *prometheus.Registry) {
registerMetrics(registry)

// Initialize metrics with labels
for e := range cacheEntryTypeLabelValues {
EventCacheRetries(e)
}
for e := range tetragon.EventType_name {
if tetragon.EventType(e) != tetragon.EventType_UNDEF && tetragon.EventType(e) != tetragon.EventType_TEST {
ProcessInfoError(tetragon.EventType(e)).Add(0)
PodInfoError(tetragon.EventType(e)).Add(0)
ParentInfoError(tetragon.EventType(e)).Add(0)
}
}
// TODO:
// event_cache_process_info_errors_total: list all possible event types
// event_cache_pod_info_errors_total: list all possible event types
// event_cache_errors_total: list all possible errors
// event_cache_retries_total: list all possible entry types
// event_cache_parent_info_errors_total: list all possible event types

// NOTES:
// * Consider merging some metrics together (e.g. keep one errors metric with event_type and error labels)
Expand Down

0 comments on commit dcc08f4

Please sign in to comment.