Skip to content

Commit

Permalink
add namespace to server and peer name across namespaces in name resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
esara committed Oct 29, 2024
1 parent 9d3e595 commit bb154d2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/export/otel/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,16 @@ func (tr *tracesOTELReceiver) acceptSpan(span *request.Span) bool {
func traceAttributes(span *request.Span, optionalAttrs map[attr.Name]struct{}) []attribute.KeyValue {
var attrs []attribute.KeyValue

// add namespace to server and peer name across namespaces
if span.OtherNamespace != "" && span.OtherNamespace != span.ServiceID.Namespace {
if span.HostName != "" {
span.HostName = span.HostName + "." + span.OtherNamespace
}
if span.PeerName != "" {
span.PeerName = span.PeerName + "." + span.OtherNamespace
}
}

switch span.Type {
case request.EventTypeHTTP:
attrs = []attribute.KeyValue{
Expand Down

0 comments on commit bb154d2

Please sign in to comment.