Open rknechtel opened 1 month ago
I got it working here is what I did: Updated to latest CloudFormation Template: https://datadog-cloudformation-template.s3.amazonaws.com/aws/forwarder/latest.yaml
git cloned the repo.
Updated the requirements.txt
:
Original in requirements.txt:
datadog-lambda==5.87.0
ddtrace==2.6.5
Updated: datadog-lambda==6.98.0 ddtrace>=2.10.0
Built lambda code: python3.11 -m venv ~/projects/DataDog/datadog-serverless-functions/aws/logs_monitoring/v-env source ~/projects/DataDog/datadog-serverless-functions/aws/logs_monitoring/v-env/bin/activate ~/projects/DataDog/datadog-serverless-functions/aws/logs_monitoring/v-env/bin/pip3.11 install -r requirements.txt
Copied: init.py customized_log_group.py enhanced_lambda_metrics.py forwarder.py lambda_function.py requirements.txt settings.py setup.py telemetry.py template.yaml
To: /projects/DataDog/datadog-serverless-functions/aws/logs_monitoring/v-env/lib/python3.11/site-packages
Then zipped up everything in that directory and deployed it to the lambda. Now my CloudWatch Logs are getting to DataDog Log Explorer.
Describe what happened: Using latest release of AWS DataDog Forwarder Lambda code, all lambda calls are failing due to the use of an old urllib3 version.
Log Group: /aws/lambda/DatadogIntegration-ForwarderStack-H16PMQ-Forwarder-PYitVeIgHSnt
Errors in my CloudWatch logs
When trying to create Lambda code from source when I run
pip3 install -r requirements.txt
I see this error: ERROR: opentelemetry-api 1.27.0 has requirement importlib-metadata<=8.4.0,>=6.0, but you'll have importlib-metadata 8.5.0 which is incompatible. ERROR: datadog-lambda 5.87.0 has requirement urllib3<2.0.0; python_version < "3.11", but you'll have urllib3 2.2.3 which is incompatible.The requirements.txt has these:
datadog-lambda==5.87.0
urllib3>=1.26.19,<3.0
The urlib3 allows versions up to 3.0 but the datadog-lambda version only allows urllib versions up to 2.0 - which is where the CloudWatch log errors are coming from (urllib3 2.0).
I made updates to the requirements.txt locally and then built the code. I made the following changes: Latest version of datadog-lambda: 6.98.0
Original in requirements.txt: datadog-lambda==5.87.0 ddtrace==2.6.5
Updated: datadog-lambda==6.98.0 ddtrace>=2.10.0
It will build then. But when uploading that code to the Lambda I still get the errors.
Describe what you expected: Lambda should work with a new urllib3 version.
Steps to reproduce the issue: deploy latest release code (aws-dd-forwarder-3.123.0.zip) to DataDog AWS lambda (DatadogIntegration-ForwarderStack-H16PMQ-Forwarder-PYitVeIgHSnt).
Look in CloudWatch logs for error.