I'm using some TypeScript lambda deployments, with active tracing turned on in AWS, also using OTEL SDK and restate OTEL hook in the lambda function
I'm noticing that the AWS Lambda service is creating its own Trace ID because it appears to ignore the traceparent header that Restate Server sends in the invocation event, so the lambda function sees the environment variable _X_AMZN_TRACE_ID which has a differing trace ID to the traceparent
This leads to a "broken" trace, where I see one trace (in AWS traces) for the AWS side of invoking my function, and a separate trace for Restate Server and my deployment's service handlers, as the OTEL SDK in the deployment is using the W3C trace propagation and picking up the traceparent header in the event
I believe if the lambda invocation request from Restate Server was to also provide an additional header X-Amzn-Trace-Id with the right formatting, then AWS active tracing should adopt this and problem solved?
Also I believe there is a distinction between the header being in the event payload VS being an actual HTTP header in the request to the AWS platform, because I've tried manually invoking a lambda that has the Xray header name in the event, and no luck, whereas I've seen online that others are seeing results when they instrument their AWS-SDK with Xray and do a lambda-invoke that way, for example.
I'm using some TypeScript lambda deployments, with active tracing turned on in AWS, also using OTEL SDK and restate OTEL hook in the lambda function
I'm noticing that the AWS Lambda service is creating its own Trace ID because it appears to ignore the
traceparentheader that Restate Server sends in the invocation event, so the lambda function sees the environment variable_X_AMZN_TRACE_IDwhich has a differing trace ID to the traceparentThis leads to a "broken" trace, where I see one trace (in AWS traces) for the AWS side of invoking my function, and a separate trace for Restate Server and my deployment's service handlers, as the OTEL SDK in the deployment is using the W3C trace propagation and picking up the
traceparentheader in the eventI believe if the lambda invocation request from Restate Server was to also provide an additional header
X-Amzn-Trace-Idwith the right formatting, then AWS active tracing should adopt this and problem solved?Also I believe there is a distinction between the header being in the event payload VS being an actual HTTP header in the request to the AWS platform, because I've tried manually invoking a lambda that has the Xray header name in the event, and no luck, whereas I've seen online that others are seeing results when they instrument their AWS-SDK with Xray and do a lambda-invoke that way, for example.