mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-18 03:46:45 +00:00
Add metrics for conntrack and ebpf errors
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/armon/go-metrics"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/typetypetype/conntrack"
|
||||
)
|
||||
@@ -148,6 +149,7 @@ func (c *conntrackWalker) run() {
|
||||
return
|
||||
}
|
||||
if f.Err != nil {
|
||||
metrics.IncrCounter([]string{"conntrack", "errors"}, 1)
|
||||
log.Errorf("conntrack event error: %v", f.Err)
|
||||
stop()
|
||||
return
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
"github.com/armon/go-metrics"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"github.com/weaveworks/common/fs"
|
||||
"github.com/weaveworks/scope/probe/endpoint/procspy"
|
||||
@@ -159,6 +160,9 @@ func (t *EbpfTracker) TCPEventV4(e tracer.TcpV4) {
|
||||
// https://github.com/weaveworks/scope/issues/2334
|
||||
log.Errorf("tcp tracer received event with timestamp %v even though the last timestamp was %v. Stopping the eBPF tracker.", e.Timestamp, t.lastTimestampV4)
|
||||
t.stop()
|
||||
metrics.IncrCounterWithLabels([]string{"ebpf", "errors"}, 1, []metrics.Label{
|
||||
{Name: "kind", Value: "timestamp-out-of-order"},
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -181,6 +185,9 @@ func (t *EbpfTracker) TCPEventV6(e tracer.TcpV6) {
|
||||
// LostV4 handles IPv4 TCP event misses from the eBPF tracer.
|
||||
func (t *EbpfTracker) LostV4(count uint64) {
|
||||
log.Errorf("tcp tracer lost %d events. Stopping the eBPF tracker", count)
|
||||
metrics.IncrCounterWithLabels([]string{"ebpf", "errors"}, 1, []metrics.Label{
|
||||
{Name: "kind", Value: "lost-events"},
|
||||
})
|
||||
t.stop()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user