diff --git a/probe/endpoint/conntrack.go b/probe/endpoint/conntrack.go index 92678878e..82bd55787 100644 --- a/probe/endpoint/conntrack.go +++ b/probe/endpoint/conntrack.go @@ -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 diff --git a/probe/endpoint/ebpf.go b/probe/endpoint/ebpf.go index 2a1e1aefe..83350bc95 100644 --- a/probe/endpoint/ebpf.go +++ b/probe/endpoint/ebpf.go @@ -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() }