Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS X-Ray traceId handling in router #3445

Open
laszlorostas opened this issue Jul 14, 2023 · 5 comments
Open

AWS X-Ray traceId handling in router #3445

laszlorostas opened this issue Jul 14, 2023 · 5 comments

Comments

@laszlorostas
Copy link
Contributor

We want to examine the router as a trace in aws x-ray. Currently, only one format of traceid is possible for the router.

It would be nice if, say, a custom traceid solution could be brought via a rhai script

@bnjjj
Copy link
Contributor

bnjjj commented Jul 20, 2023

Have you ever tried to use request propagation mentioned here ?

@laszlorostas
Copy link
Contributor Author

I know it, but as far as I know, the traceid format that the router generates for them is the same. But a completely unique traceId format, such as UUID or X-ray format, is discarded by the router.

@abernix
Copy link
Member

abernix commented Aug 15, 2023

I'm curious if @bnjjj was referring to the section of the documentation that suggests using a custom header, which exists on that page (link to highlighted part):

      # If you have your own way to generate a trace id and you want to pass it via a custom request header
      request:
        header_name: my-trace-id

For example, what if you did:

      # If you have your own way to generate a trace id and you want to pass it via a custom request header
      request:
        header_name: X-Amzn-Trace-Id

Is that sufficient?

@scottmace
Copy link
Contributor

The X-Amzn-Trace-ID header format is not directly compatible with the OpenTelemetry TraceID format. Specifying it as the header_name above results in a "cannot generate custom trace_id" error.

The AWS X-Ray Propagator used in that PR handles converting back and forth between the X-Amzn-Trace-ID header and a valid OpenTelemetry Trace ID:

https://github.com/open-telemetry/opentelemetry-rust/blob/41e8d63652b323866c03981b4b2ca62b9b8d6d44/opentelemetry-aws/src/lib.rs#L74

@o0Ignition0o
Copy link
Contributor

CC @BrynCooke @bnjjj we might need to update the configuration in the #3226 efforts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants