Skip to content

Commit

Permalink
Fix kubernetes decoration
Browse files Browse the repository at this point in the history
  • Loading branch information
mariomac committed Oct 4, 2024
1 parent 0c099ad commit 5e5a359
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/internal/discover/attacher.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,16 +258,21 @@ func (ta *TraceAttacher) monitorPIDs(tracer *ebpf.ProcessTracer, ie *ebpf.Instru
}
if ta.SpanSignalsShortcut != nil {
spans := make([]request.Span, 0, len(ie.ChildPids)+1)
// the forwarded signal must include
// - ServiceID, which includes several metadata about the process
// - PID namespace, to allow further kubernetes decoration
spans = append(spans, request.Span{
Type: request.EventTypeProcessAlive,
ServiceID: ie.FileInfo.Service,
Pid: request.PidInfo{Namespace: ie.FileInfo.Ns},
})
for _, pid := range ie.ChildPids {
service := ie.FileInfo.Service
service.ProcPID = int32(pid)
spans = append(spans, request.Span{
Type: request.EventTypeProcessAlive,
ServiceID: service,
Pid: request.PidInfo{Namespace: ie.FileInfo.Ns},
})
}
ta.SpanSignalsShortcut <- spans
Expand Down

0 comments on commit 5e5a359

Please sign in to comment.