Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove tetragon_msg_op_total metric #2856

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions contrib/upgrade-notes/latest.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,5 @@ tetragon:
* `tetragon_ringbuf_perf_event_lost_total` -> `tetragon_observer_ringbuf_events_lost_total`
* `tetragon_ringbuf_queue_received_total` -> `tetragon_observer_ringbuf_queue_events_received_total`
* `tetragon_ringbuf_queue_lost_total` -> `tetragon_observer_ringbuf_queue_events_lost_total`
* `tetragon_msg_op_total` metric is removed. `tetragon_observer_ringbuf_queue_events_received_total` or
`tetragon_events_total` can be used as a replacement, depending on the use case.
8 changes: 0 additions & 8 deletions docs/content/en/docs/reference/metrics.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 0 additions & 19 deletions pkg/metrics/opcodemetrics/opcodemetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ import (
)

var (
MsgOpsCount = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: consts.MetricsNamespace,
Name: "msg_op_total",
Help: "The total number of times we encounter a given message opcode. For internal use only.",
ConstLabels: nil,
}, []string{"msg_op"})

LatencyStats = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: consts.MetricsNamespace,
Name: "handling_latency",
Expand All @@ -30,26 +23,14 @@ var (
)

func RegisterMetrics(group metrics.Group) {
group.MustRegister(MsgOpsCount)
group.MustRegister(LatencyStats)
}

func InitMetrics() {
// Initialize all metrics
for opcode := range ops.OpCodeStrings {
if opcode != ops.MSG_OP_UNDEF && opcode != ops.MSG_OP_TEST {
GetOpTotal(opcode).Add(0)
LatencyStats.WithLabelValues(fmt.Sprint(int32(opcode)))
}
}
}

// Get a new handle on a msgOpsCount metric for an OpCode
func GetOpTotal(opcode ops.OpCode) prometheus.Counter {
return MsgOpsCount.WithLabelValues(fmt.Sprint(int32(opcode)))
}

// Increment an msgOpsCount for an OpCode
func OpTotalInc(opcode ops.OpCode) {
GetOpTotal(opcode).Inc()
}
1 change: 0 additions & 1 deletion pkg/observer/observer.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ func (k *Observer) receiveEvent(data []byte) {
}

op, events, err := HandlePerfData(data)
opcodemetrics.OpTotalInc(ops.OpCode(op))
if err != nil {
// Increment error metrics
errormetrics.ErrorTotalInc(errormetrics.HandlerError)
Expand Down
Loading