From b00ad86e41520133ec893631c4d665f7f58aa0d0 Mon Sep 17 00:00:00 2001 From: Vlad Ionescu Date: Fri, 9 Aug 2019 11:48:12 +0000 Subject: [PATCH 1/2] Test --- beeline/middleware/awslambda/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/beeline/middleware/awslambda/__init__.py b/beeline/middleware/awslambda/__init__.py index bfd2768..7119ad9 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": context.function_name or "", + "app.function_version": context.function_version or "", + "app.request_id": context.aws_request_id or "", "app.event": event, "meta.cold_start": COLD_START, }) From c49b0cd784913c5549253378c1d405ab97d95a2a Mon Sep 17 00:00:00 2001 From: Vlad Ionescu Date: Fri, 9 Aug 2019 11:59:10 +0000 Subject: [PATCH 2/2] Grace --- beeline/middleware/awslambda/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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, })