opentelemetry-lambda icon indicating copy to clipboard operation
opentelemetry-lambda copied to clipboard

Context propagation differences

Open mat-rumian opened this issue 4 years ago • 0 comments

I've observed many differences in case of context propagation between instrumentations and type of invoke.

Reqs:

  • AWS XRAY Disabled on lambdas
  • OTEL_TRACES_SAMPLER = always_on
Instrumentation INSTRUMENTED CALL - CLIENT XRAY PROPAGATION SET INSTRUMENTED CALL - CLIENT NO XRAY NOT INSTRUMENTED CALL
Python (invoke) Single trace, context propagated Two traces are created, context not propagated, lambda trace root span pointing to the unknown parent Single trace, root span pointing to unknown parent
NodeJS (invoke) Single trace, context propagated Two traces created, context not propagated, lambda trace root span pointing to the unknown parent Single trace, root span pointing to unknown parent
Java Wrapper (invoke) Single trace, context propagated Two traces create (client, lambda), lambda trace root span is correct. There's no unknown parent span. Single trace created, root span doesn't have a parent
------------- ------------- ------------- -------------
Python (API CURL) Single trace, context propagated, but lambda span points to unknown parent Two traces are created, context not propagated, lambda trace root span pointing to the unknown parent Single trace, root span pointing to unknown parent
NodeJS (API CURL) Single trace, context propagated, but lambda span points to unknown parent Single trace, context propagated Single trace, root span pointing to unknown parent
Java Wrapper (API CURL) Single trace, context propagated, but lambda span points to unknown parent Single trace, context propagated Single trace created, root span doesn't have a parent

I think the way it should work for OT in this case should be:

  • not instrumented call to the lambda should generate single trace without parent in root span (e.g. if OTEL_TRACES_SAMPLER=always_on)
  • instrumented call to the lambda should generate single trace with context propagated

mat-rumian avatar Sep 24 '21 12:09 mat-rumian