From b66dfd66d5fbd72f7f96fc43bf0625506abb90ce Mon Sep 17 00:00:00 2001 From: Joshua Fenton Date: Fri, 7 Jun 2024 20:12:31 +1000 Subject: [PATCH] Add reference to the Mangum project for adapted logic --- .../src/opentelemetry/instrumentation/aws_lambda/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py index e19ca56f47..7aac783712 100644 --- a/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py +++ b/instrumentation/opentelemetry-instrumentation-aws-lambda/src/opentelemetry/instrumentation/aws_lambda/__init__.py @@ -350,6 +350,8 @@ def headers(self) -> dict: Returns: Headers for the Application Load Balancer event. """ + # This approach was adapted from the Mangum project: + # https://github.com/jordaneremieff/mangum headers: List[Tuple[bytes, bytes]] = [] if "multiValueHeaders" in self._event: @@ -673,6 +675,8 @@ def get_event_wrapper(event: LambdaEvent, context: Any) -> EventWrapper: default_wrapper = EventWrapper(event=event, context=context) + # The logic behind this flow was adapted from work done by the Mangum project: + # https://github.com/jordaneremieff/mangum if not event: return default_wrapper elif "requestContext" in event and "elb" in event["requestContext"]: