Skip to content

Commit

Permalink
Generate url section in xray segment when net.peer.name is available
Browse files Browse the repository at this point in the history
  • Loading branch information
bjrara committed Dec 2, 2024
1 parent 9c1ddd2 commit 1342459
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions exporter/awsxrayexporter/internal/translator/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func makeHTTP(span ptrace.Span) (map[string]pcommon.Value, *awsxray.HTTPData) {
hasHTTPRequestURLAttributes = true
case conventions.AttributeNetPeerName:
urlParts[key] = value.Str()
hasHTTPRequestURLAttributes = true
case conventions.AttributeNetPeerPort:
urlParts[key] = value.Str()
if len(urlParts[key]) == 0 {
Expand Down
1 change: 1 addition & 0 deletions exporter/awsxrayexporter/internal/translator/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func TestClientSpanWithPeerAttributes(t *testing.T) {

assert.NotNil(t, httpData)
assert.NotNil(t, filtered)
assert.NotNil(t, httpData.Request.URL)

assert.Equal(t, "10.8.17.36", *httpData.Request.ClientIP)

Expand Down

0 comments on commit 1342459

Please sign in to comment.