-
Notifications
You must be signed in to change notification settings - Fork 319
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: ringbufqueuemetrics.Received - number of records received from perf event reader go routine ringbufqueuemetrics.Lost - number of records lost because the RB Queue channel was full Signed-off-by: Jiri Olsa <jolsa@kernel.org>
- Loading branch information
Showing
3 changed files
with
34 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
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,29 @@ | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// Copyright Authors of Tetragon | ||
|
||
package ringbufqueuemetrics | ||
|
||
import ( | ||
"github.com/cilium/tetragon/pkg/metrics/consts" | ||
"github.com/prometheus/client_golang/prometheus" | ||
) | ||
|
||
var ( | ||
Received = prometheus.NewCounter(prometheus.CounterOpts{ | ||
Namespace: consts.MetricsNamespace, | ||
Name: "ringbuf_queue_received_total", | ||
Help: "The total number of Tetragon events ring buffer queue received.", | ||
ConstLabels: nil, | ||
}) | ||
Lost = prometheus.NewCounter(prometheus.CounterOpts{ | ||
Namespace: consts.MetricsNamespace, | ||
Name: "ringbuf_queue_lost_total", | ||
Help: "The total number of Tetragon events ring buffer queue lost.", | ||
ConstLabels: nil, | ||
}) | ||
) | ||
|
||
func InitMetrics(registry *prometheus.Registry) { | ||
registry.MustRegister(Received) | ||
registry.MustRegister(Lost) | ||
} |
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