Skip to content

Commit f7aa81b

Browse files
authored
fix(aap): stop crashing on .NET runtimes by not rerouting on wrapper (#803)
# What? Disable AAP for .NET runtimes, AAP and LWA won't work correctly for .NET runtimes, proxying still gets enabled, it's just not used because we don't reroute. # Motivation Rust proxy lowercases headers based on the standard for HTTP, most runtimes don't care about this, besides .NET. This has been fixed in aws/aws-lambda-dotnet#2094 But it's yet to be released, so the issue: aws/aws-lambda-dotnet#2093 remains open
1 parent a6bd17d commit f7aa81b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

scripts/datadog_wrapper

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ DD_SERVERLESS_APPSEC_ENABLED=$(echo "$DD_SERVERLESS_APPSEC_ENABLED" | tr '[:uppe
2121

2222
if [ "$DD_EXPERIMENTAL_ENABLE_PROXY" == "true" ] || [[ "$DD_SERVERLESS_APPSEC_ENABLED" =~ ^(1|t|true)$ ]]
2323
then
24-
debug_log "Enabling Datadog's Runtime API proxy"
25-
debug_log "The original AWS_LAMBDA_RUNTIME_API value is $AWS_LAMBDA_RUNTIME_API"
24+
if [[ "$AWS_EXECUTION_ENV" == *"dotnet"* ]]; then
25+
debug_log "Skipping proxy rerouting for .NET functions due to runtime issue, LWA and AAP won't work correctly."
26+
else
27+
debug_log "Enabling Datadog's Runtime API proxy"
28+
debug_log "The original AWS_LAMBDA_RUNTIME_API value is $AWS_LAMBDA_RUNTIME_API"
2629

27-
# Replace the Runtime API address with the proxy address of the extension
28-
export AWS_LAMBDA_RUNTIME_API="127.0.0.1:9000"
30+
# Replace the Runtime API address with the proxy address of the extension
31+
export AWS_LAMBDA_RUNTIME_API="127.0.0.1:9000"
2932

30-
debug_log "Rerouting AWS_LAMBDA_RUNTIME_API to the Datadog extension at $AWS_LAMBDA_RUNTIME_API"
33+
debug_log "Rerouting AWS_LAMBDA_RUNTIME_API to the Datadog extension at $AWS_LAMBDA_RUNTIME_API"
34+
fi
3135
fi
3236

3337
if [[ "$DD_SERVERLESS_APPSEC_ENABLED" =~ ^(1|t|true)$ ]]

0 commit comments

Comments
 (0)