Open pviolette3 opened 4 days ago
Thanks for reporting! I think DD_SERVICE
, DD_ENV
, and DD_VERSION
should be set in this case. I'm going to track this issue internally. For now, you can set a dummy extension_layer_version
to have the environment variables set.
Internal ticket: https://datadoghq.atlassian.net/browse/SVLS-5931
Expected Behavior
Given below code, with
lambda_handlers
running Docker images,the env, service, and version should correspond to the DD_ENV, DD_SERVICE, and DD_VERSION environment variables added to the lambda handlers.
It does seem that passing a dummy extension_layer_version=65 does add them again.
Actual Behavior
DD_SERVICE, DD_ENV, and DD_VERSION the variables seem not to get added if you don't pass
extension_layer_version
, and these are typically how one may find the relevant traces.Noted here in the code that the constructs do not add these variables if the extension layer is unspecified: https://github.com/DataDog/datadog-cdk-constructs/blob/main/src/env.ts#L127-L140
It seems this may be intended behavior, but I am not sure why.
https://github.com/DataDog/datadog-cdk-constructs/issues/185 seems related.
Steps to Reproduce the Problem
NOTE: Traces are showing up fine. It's just that the 3 common fields I'd search for in APM Traces are not tagged (ie searching by service, env, or version) so it appears as if it doesn't work.
Specifications
COPY --from=public.ecr.aws/datadog/lambda-extension:65 /opt/. /opt/
based onpublic.ecr.aws/lambda/python:3.10
)Node version: v20.12.0 (CDK)
datadog-cdk-constructs-v2==1.18.0
Stacktrace
There is no crash; this behavior may be WAI.
Would anyone be able to share?
BTW - thank you Datadog team for a great product. It is so useful :)