amazon-web-servicesaws-lambdaamazon-kinesisaws-xray

processes do not map together in service map


So I have two AWS processes (lambda, which feeds to a stream, and then the stream consumer) that I have tied together in x-ray. I have the lambda pull its traceId and have it submit it to the stream as part of the body.

Now my consumer, pulls that id, starts a segment, and then sets the traceId. This works fine in the trace details, and I can see them tied together. However, when I look at the service map, they are still two separate entities. So the Id is always a rootId, and I don't ever see a parent, could this be part of the problem?

Thanks


Solution

  • FYI https://docs.aws.amazon.com/xray/latest/devguide/xray-concepts.html#xray-concepts-tracingheader

    trace context contains 3 important parts: trace id(Root in xray trace header), parent segment id(parent) and sampled flag(sampled). Manually propagate trace context through your stream is great, make sure:

    1. inject xray trace header(contains trace id, parent segment id and sampled flag) to stream from producer end.
    2. extract xray trace header from stream from consumer end.
    3. set trace id, parent and sampled flag to consumer segment. Sampled flag may no need, depends on your implementation.