Skip to content

Commit

Permalink
Fix net peer attributes values in client spans (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
stoewer authored Nov 30, 2022
1 parent af84d3f commit 38aef5f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/tracegen/templated.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ func (g *TemplatedGenerator) generateNetworkAttributes(tmpl *internalSpanTemplat

if parent != nil && parent.Kind() == ptrace.SpanKindClient {
ip, _ := span.Attributes().Get("net.sock.host.addr")
putIfNotExists(parent.Attributes(), "net.sock.peer.addr", ip)
putIfNotExists(parent.Attributes(), "net.sock.peer.addr", ip.Str())
name, _ := span.Attributes().Get("net.host.name")
putIfNotExists(parent.Attributes(), "net.peer.name", name)
putIfNotExists(parent.Attributes(), "net.peer.name", name.Str())
}
}
}
Expand Down

0 comments on commit 38aef5f

Please sign in to comment.