open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.08k stars 2.38k forks source link

Missing url from X-Ray segment #35375

Open bjrara opened 1 month ago

bjrara commented 1 month ago

Component(s)

exporter/awsxray

What happened?

Description

URL is missing from X-Ray client segment.

A trace span is generated with the following attributes, but after converting to X-Ray segment, the url is not shown properly in the trace.

Input

otel-collector  | Span #5
otel-collector  |     Trace ID       : 66eb757066b5d7c915edd0c70e66a400
otel-collector  |     Parent ID      : 7781c24cc117e0f7
otel-collector  |     ID             : 17b1db5775e39506
otel-collector  |     Name           : HTTP POST
otel-collector  |     Kind           : Client
otel-collector  |     Start time     : 2024-09-19 00:50:56.546713821 +0000 UTC
otel-collector  |     End time       : 2024-09-19 00:50:57.290126759 +0000 UTC
otel-collector  |     Status code    : Unset
otel-collector  |     Status message :
otel-collector  | Attributes:
otel-collector  |      -> http.method: Str(POST)
otel-collector  |      -> http.scheme: Str(https)
otel-collector  |      -> http.target: Str(/api/v1/%hidden_info%)
otel-collector  |      -> net.peer.name: Str(%hidden_info%)
otel-collector  |      -> net.peer.port: Int(443)
otel-collector  |      -> http.status_code: Int(200)

Output

{
  "id": "17b1db5775e39506",
  "name": "%hidden_info%",
  "start_time": 1726707056.5467138,
  "end_time": 1726707057.2901268,
  "fault": false,
  "error": false,
  "throttle": false,
  "http": {
    "request": {
      "method": "POST"
    },
    "response": {
      "status": 200,
      "content_length": 0
    }
  },
  "aws": {
    "xray": {
      "auto_instrumentation": false,
      "sdk_version": "1.2.1",
      "sdk": "opentelemetry for ruby"
    }
  },
  "namespace": "remote"
}

Steps to Reproduce

Expected Result

Segment contains http url.

Actual Result

Segment doesn't contain http url.

Collector version

Latest

Environment information

Environment

OS: (e.g., "Ubuntu 20.04") Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

github-actions[bot] commented 1 month ago

Pinging code owners:

bjrara commented 1 month ago

Currently, it only generates http url section when the following attributes are found [source]:

  1. http.url
  2. url.full
  3. http.host
  4. http.server_name
  5. host.name
  6. net.host.name
  7. net.peer.ip
  8. network.peer.address
  9. server.address

It's unclear why net.peer.name was not respected when deciding the url generation.