alibaba / alibaba/kubeskoop

[discuss] about genrating evt of packetloss

Open
#299 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
698
Forks
91
Avg merge
32m
Merged PRs (30d)
1

Description

Hi, I see in packetloss, if sth is wrong in `GetSymsByStack()` , the evt won't be sent to the sink because we `continue` to skip the next steps :
```go
stacks, err := bpfutil.GetSymsByStack(uint32(event.StackId), p.objs.InspPlStack)
if err != nil {
log.Warnf("%s failed get sym by stack, err: %v", probeName, err)
continue
}
```

It means we finaly miss record this event. Actually in my production env, I do encounter this problem, I get some packetloss metric but no event.
So how about not `continue`,
```go
stacks, err := bpfutil.GetSymsByStack(uint32(event.StackId), p.objs.InspPlStack)
if err != nil {
log.Warnf("%s failed get sym by stack, err: %v", probeName, err)
// continue
evt.Message = "unknown"
} else {
var strs []string
for _, sym := range stacks {
if _, ok := ignoreSymbolList[sym.GetName()]; ok {
goto anotherLoop
}
strs = append(strs, sym.GetExpr())
}
evt.Message = strings.Join(strs, "\n")
}

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the packetloss handling around GetSymsByStack() and trace how the event reaches the sink. Verify the behavior when symbol lookup fails: packetloss events should still be emitted with the fallback message described in the issue, while successful lookups should retain their existing message.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
networking, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.