-
Notifications
You must be signed in to change notification settings - Fork 46
Closed
Description
Expected Behavior
The datadog datalayer doesn't try to get the correlation ids if tracing is off.
Actual Behavior
The datadog datalayer tries to get the correlation ids if tracing is off, and throws a KeyError.
Steps to Reproduce the Problem
- Create an aws lambda
- Set the
DD_LAMBDA_HANDLER
tothe _lambda_function
- Set the lambda handler to
datadog_lambda.handler.handler
- Set
DD_ENABLE_TRACE
to "false".
Specifications
- Datadog Lambda Layer version: 4.66 & 4.72.0
- Python version: 3.7, 3.9
Stacktrace
023-05-16 08:56:14 Traceback (most recent call last):
2023-05-16 08:56:14 File "/opt/python/lib/python3.9/site-packages/datadog_lambda/wrapper.py", line 234, in _before
2023-05-16 08:56:14 set_correlation_ids()
2023-05-16 08:56:14 File "/opt/python/lib/python3.9/site-packages/datadog_lambda/tracing.py", line 513, in set_correlation_ids
2023-05-16 08:56:14 span.trace_id = int(context[TraceHeader.TRACE_ID])
2023-05-16 08:56:14 KeyError: 'x-datadog-trace-id'
Metadata
Metadata
Assignees
Labels
No labels