diff --git a/beeline/middleware/awslambda/__init__.py b/beeline/middleware/awslambda/__init__.py index 7119ad9..7d7ee25 100644 --- a/beeline/middleware/awslambda/__init__.py +++ b/beeline/middleware/awslambda/__init__.py @@ -60,9 +60,9 @@ def _beeline_wrapper(event, context): with beeline.tracer(name=handler.__name__, trace_id=trace_id, parent_id=parent_id): beeline.add_context({ - "app.function_name": context.function_name or "", - "app.function_version": context.function_version or "", - "app.request_id": context.aws_request_id or "", + "app.function_name": getattr(context, 'function_name', ""), + "app.function_version": getattr(context, 'function_version', ""), + "app.request_id": getattr(context, 'aws_request_id', ""), "app.event": event, "meta.cold_start": COLD_START, })