Skip to content

Commit f470f31

Browse files
committed
Update README
1 parent e5bc122 commit f470f31

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,11 @@ If your Lambda function is triggered by API Gateway via [the non-proxy integrati
235235
If your Lambda function is deployed by the Serverless Framework, such a mapping template gets created by default.
236236

237237
## Log and Trace Correlations
238+
By default, the Datadog trace id gets automatically injected into the logs for correlation, if using `console` or a logging library supported for [automatic](https://docs.datadoghq.com/tracing/connect_logs_and_traces/?tab=nodejs#automatic-trace-id-injection) trace id injection.
238239

239-
To connect logs and traces, set the environment variable `DD_LOGS_INJECTION` to `True`. The log format of the AWS provided `LambdaLoggerHandler` will be overridden to inject `dd.trace_id` and `dd.span_id`. The default Datadog lambda log integration pipeline will automatically parse them and map the `dd.trace_id` into the reserved attribute [trace_id](https://docs.datadoghq.com/logs/processing/#trace-id-attribute).
240+
See instructions for [manual](https://docs.datadoghq.com/tracing/connect_logs_and_traces/?tab=nodejs#manual-trace-id-injection) trace id injection, if using other logging libraries. If you use a custom logger handler to log in json, you can manually inject the ids using the helper function `get_correlation_ids`.
240241

241-
If you use a custom logger handler to log in json, you can manually inject the ids using the helper function `get_correlation_ids`.
242+
Set the environment variable `DD_LOGS_INJECTION` to `false` to disable this feature.
242243

243244
```python
244245
from datadog_lambda.wrapper import datadog_lambda_wrapper

0 commit comments

Comments
 (0)