diff --git a/beeline/middleware/awslambda/__init__.py b/beeline/middleware/awslambda/__init__.py index bfd2768..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, - "app.function_version": context.function_version, - "app.request_id": context.aws_request_id, + "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, })