open-telemetry / opentelemetry-js-contrib

OpenTelemetry instrumentation for JavaScript modules
https://opentelemetry.io
Apache License 2.0
643 stars 484 forks source link

[opentelemetry-instrumentation-aws-lambda] Context handling does not follow Semantic Conventions for Instrumenting AWS Lambda #1726

Open ithompson-gp opened 9 months ago

ithompson-gp commented 9 months ago

Issue

According to official trace semantic conventions for Instrumenting AWS Lambda, given an AWS Lambda - generated - sampled trace context (_X_AMZN_TRACE_ID), this context must be supplied - via instrumentation - as a Span Link when initialising a Span encapsulating the - wrapped - function handler being invoked.

This expected functionality is explained in detail in the same semantic conventions doc in the AWS X-Ray Environment Span Link section.

Which plugin?

Where in code?

Actions?

Given the inconsistencies between Lambda trace conventions and code being shipped, is there a timeline for solving these inconsistencies?

srprash commented 9 months ago

Hi @ithompson-gp There's already an open PR regarding this FaaS specification: https://github.com/open-telemetry/opentelemetry-js-contrib/pull/1411

There is ongoing discussions on accepting the PR since it is a breaking change for Lambda customers.

ithompson-gp commented 9 months ago

@srprash Has there been any move to merge this (https://github.com/open-telemetry/opentelemetry-js-contrib/pull/1411)? As an end-user, we would like conventions to be respected, and move forward with developing Span Link as a means to represent causal relationships in an async EDA. This is a true blocker to any FaaS adoption of OpenTelemetry (lack of Span Link in end systems and the development on the OTEL side to integrate with Messaging SIG)