Skip to content

Commit

Permalink
tracing: Initialize metrics with labels
Browse files Browse the repository at this point in the history
Initialize tetragon_process_loader_stats with all possible event types.

Signed-off-by: Anna Kapuscinska <[email protected]>
  • Loading branch information
lambdanis committed Feb 28, 2024
1 parent 266ea3f commit 5302f27
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/grpc/tracing/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ var (
func InitMetrics(registry *prometheus.Registry) {
registry.MustRegister(LoaderStats)

// Initialize metrics with labels
for _, ty := range LoaderTypeStrings {
LoaderStats.WithLabelValues(ty).Add(0)
}

// NOTES:
// * Rename process_loader_stats metric (to e.g. process_loader_events_total) and count label (to e.g. event)?
}
Expand Down

0 comments on commit 5302f27

Please sign in to comment.