Add Java support for AWS Lambdas#6278
Conversation
|
|
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🔗 Commit SHA: 75ab8d8 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
cbeauchesne
left a comment
There was a problem hiding this comment.
Could you do a search for the term python_lambda everywhere in the code, and if needed, add java_lambda? If you have any doubt, ping me, we'll go threw this list together.
| readonly DEFAULT_cpp_httpd=httpd | ||
| readonly DEFAULT_cpp_nginx=nginx | ||
| readonly DEFAULT_python_lambda=apigw-rest | ||
| readonly DEFAULT_java_lambda=apigw-rest |
There was a problem hiding this comment.
Weblog names must be unique, can you pick another one?
|
You can run |
834b011 to
15a6f81
Compare
cbeauchesne
left a comment
There was a problem hiding this comment.
You'll need to adapt ./utils/script/load_binary.sh to support java_lambda.
Since the underlying details may be not that obvious, we can meet to discuss what will happen with all of that. You can DM me to see that.
3e41651 to
d89cb50
Compare
cbeauchesne
left a comment
There was a problem hiding this comment.
The failure is not related, I'm fixing it.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75ab8d8280
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| event.getQueryStringParameters(), | ||
| event.getHeaders(), |
There was a problem hiding this comment.
Read multi-value ALB request fields
Handle the ALB multi-value trigger by consuming multiValueQueryStringParameters and multiValueHeaders when present. In the checked lambda-proxy path (utils/build/docker/lambda_proxy/alb.py), build_alb_event(..., multi=True) only sets those multi-value fields, so using event.getQueryStringParameters() and event.getHeaders() here drops query/header data for java-alb-multi requests; that can break parameter-driven endpoints and prevent the user-agent tag enrichment used for request/span matching.
Useful? React with 👍 / 👎.
| APIGatewayProxyResponseEvent response = new APIGatewayProxyResponseEvent(); | ||
| response.setStatusCode(statusCode); | ||
| response.setBody(body); | ||
| response.setHeaders(headers != null ? headers : new HashMap<>()); |
There was a problem hiding this comment.
Populate multiValueHeaders for ALB multi responses
Return multiValueHeaders for REST/ALB responses in the multi-value ALB flow. I checked utils/build/docker/lambda_proxy/alb.py, and parse_alb_lambda_output(..., multi=True) reads resp["multiValueHeaders"] (not headers), but this branch only sets headers; for java-alb-multi, response headers are therefore lost (and can fail if the serializer omits multiValueHeaders entirely), impacting header/cookie-sensitive behavior.
Useful? React with 👍 / 👎.
Motivation
We are adding AppSec support for AWS Lambdas in Java and need system-tests to validate it.
Changes
A new library was created: java_lambda as it as been done for python_lambda, with 5 weblogs for each lambda trigger-type, and a new manifest.
Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present