-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tetragon: Add events buffer queue metrics
Adding following metric counters for events buffer queue: eventsQueueReceived - number of records received from perf event reader go routine eventsQueueLost - number of records lost because the RBQueue channel was full Signed-off-by: Jiri Olsa <jolsa@kernel.org>
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright Authors of Tetragon | ||
|
||
package eventsqueuemetrics | ||
|
||
import ( | ||
"github.com/cilium/tetragon/pkg/metrics/consts" | ||
"github.com/prometheus/client_golang/prometheus" | ||
) | ||
|
||
var ( | ||
eventsQueueReceived = prometheus.NewGaugeVec(prometheus.GaugeOpts{ | ||
Namespace: consts.MetricsNamespace, | ||
Name: "eventsqueue_stats_received", | ||
Help: "The total number of Tetragon events queue received.", | ||
ConstLabels: nil, | ||
}, nil) | ||
eventsQueueLost = prometheus.NewGaugeVec(prometheus.GaugeOpts{ | ||
Namespace: consts.MetricsNamespace, | ||
Name: "eventsqueue_stats_lost", | ||
Help: "The total number of Tetragon events queue lost.", | ||
ConstLabels: nil, | ||
}, nil) | ||
) | ||
|
||
func InitMetrics(registry *prometheus.Registry) { | ||
registry.MustRegister(eventsQueueReceived) | ||
registry.MustRegister(eventsQueueLost) | ||
} | ||
|
||
func ReceivedInc() { | ||
eventsQueueReceived.WithLabelValues().Inc() | ||
} | ||
|
||
func LostInc() { | ||
eventsQueueLost.WithLabelValues().Inc() | ||
} |
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