Package: datadog-lambda
datadog-lambda-pythonDatadog Lambda Library for Python (3.8, 3.9, 3.10, 3.11, and 3.12) enablesenhanced Lambda metrics,distributed tracing, andcustom metric submissionfrom AWS Lambda functions.InstallationFollow theinstallation instructions, and view your function's enhanced metrics, traces and logs in Datadog.ConfigurationFollow theconfiguration instructionsto tag your telemetry, capture request/response payloads, filter or scrub sensitive information from logs or traces, and more.For additional tracing configuration options, check out theofficial documentation for Datadog trace client.Besides the environment variables supported by dd-trace-py, the datadog-lambda-python library added following environment variables.Environment VariablesDescriptionDefault ValueDD_ENCODE_AUTHORIZER_CONTEXTWhen set totruefor Lambda authorizers, the tracing context will be encoded into the response for propagation. Supported for NodeJS and Python.trueDD_DECODE_AUTHORIZER_CONTEXTWhen set totruefor Lambdas that are authorized via Lambda authorizers, it will parse and use the encoded tracing context (if found). Supported for NodeJS and Python.trueDD_COLD_START_TRACINGSet tofalseto disable Cold Start Tracing. Used in NodeJS and Python.trueDD_MIN_COLD_START_DURATIONSets the minimum duration (in milliseconds) for a module load event to be traced via Cold Start Tracing. Number.3DD_COLD_START_TRACE_SKIP_LIBoptionally skip creating Cold Start Spans for a comma-separated list of libraries. Useful to limit depth or skip known libraries.ddtrace.internal.compat,ddtrace.filtersDD_CAPTURE_LAMBDA_PAYLOADCaptures incoming and outgoing AWS Lambda payloadsin the Datadog APM spans for Lambda invocations.falseDD_CAPTURE_LAMBDA_PAYLOAD_MAX_DEPTHDetermines the level of detail captured from AWS Lambda payloads, which are then assigned as tags for theaws.lambdaspan. It specifies the nesting depth of the JSON payload structure to process. Once the specified maximum depth is reached, the tag's value is set to the stringified value of any nested elements beyond this level.For example, given the input payload:{"lv1" : {"lv2": {"lv3": "val"}}}If the depth is set to2, the resulting tag's key is set tofunction.request.lv1.lv2and the value is{\"lv3\": \"val\"}.If the depth is set to0, the resulting tag's key is set tofunction.requestand value is{\"lv1\":{\"lv2\":{\"lv3\": \"val\"}}}10Opening IssuesIf you encounter a bug with this package, we want to hear about it. Before opening a new issue, search the existing issues to avoid duplicates.When opening an issue, include the Datadog Lambda Library version, Python version, and stack trace if available. In addition, include the steps to reproduce when appropriate.You can also open an issue for a feature request.Lambda Profiling BetaDatadog'sContinuous Profileris now available in beta for Python in version 4.62.0 and layer version 62 and above. This optional feature is enabled by setting theDD_PROFILING_ENABLEDenvironment variable totrue. During the beta period, profiling is available at no additional cost.The Continuous Profiler works by spawning a thread which periodically wakes up and takes a snapshot of the CPU and Heap of all running python code. This can include the profiler itself. If you want the Profiler to ignore itself, setDD_PROFILING_IGNORE_PROFILERtotrue.Major Version Notes5.x / Layer version 86+Python3.7 support has beendeprecatedby AWS, and support removed from this library.4.x / Layer version 61+Python3.6 support has beendeprecatedby AWS, and support removed from this library.dd-traceupgraded from 0.61 to 1.4, full release notes are availablehereget_correlation_ids()has been changed toget_log_correlation_context(), which now returns a dictionary containing the activespan_id,trace_id, as well asserviceandenv.ContributingIf you find an issue with this package and have a fix, please feel free to open a pull request following theprocedures.CommunityFor product feedback and questions, join the#serverlesschannel in theDatadog community on Slack.LicenseUnless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2019 Datadog, Inc.