Skip to content

Commit

Permalink
username fix (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
ishleenk17 authored Jul 8, 2024
1 parent 99cc650 commit 996ceaa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions remappers/hostmetrics/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@ func addProcessResources(resource pcommon.Resource, startTime time.Time) func(pm
owner, _ := resource.Attributes().Get("process.owner")
if owner.Str() != "" {
dp.Attributes().PutStr("user.name", owner.Str())
} else {
dp.Attributes().PutStr("user.name", "undefined")
}
exec, _ := resource.Attributes().Get("process.executable.path")
if exec.Str() != "" {
Expand All @@ -291,6 +293,8 @@ func addProcessResources(resource pcommon.Resource, startTime time.Time) func(pm
cmdline, _ := resource.Attributes().Get("process.command_line")
if cmdline.Str() != "" {
dp.Attributes().PutStr("system.process.cmdline", cmdline.Str())
} else {
dp.Attributes().PutStr("system.process.cmdline", "undefined")
}
dp.Attributes().PutStr("system.process.cpu.start_time", startTimeStr)
// Adding dummy value to process.state as "undefined", since this field is not
Expand Down

0 comments on commit 996ceaa

Please sign in to comment.