Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datadog macro removes DD_LAMBDA_HANDLER from container image lambdas #108

Closed
vieirai opened this issue Oct 17, 2023 · 1 comment · Fixed by #119
Closed

Datadog macro removes DD_LAMBDA_HANDLER from container image lambdas #108

vieirai opened this issue Oct 17, 2023 · 1 comment · Fixed by #119
Assignees
Labels
bug Something isn't working

Comments

@vieirai
Copy link

vieirai commented Oct 17, 2023

Expected Behavior

Datadog macro does not modify container image lambdas

Actual Behavior

Datadog macro modifies the environment variables of container image lambdas

Steps to Reproduce the Problem

  1. Have a SAM project with container image lambda and normal lambdas
  2. Add the datadog macro for transforming the normal lambdas
  3. Follow the steps in the docs to add the datadog extension to container image lambda
  4. Observe the DD_LAMBDA_HANDLER environment variable disappearing for the container image lambda

Specifications

For the Datadog Serverless Macro:

  • Deployment method and version (CloudFormation, SAM, CDK): SAM 1.98.0
  • Datadog CloudFormation Macro version: 0.8.0
  • Lambda function runtime (Python 3.7, Node 10, etc.): Python 3.9 & container image

Stacktrace

This is the error message we get from the container image lambda, as the DD_LAMBDA_HANDLER environment variable was removed.

[ERROR] HandlerError: DD_LAMBDA_HANDLER is not defined. Can't use prebuilt datadog handler
Traceback (most recent call last):
File "/var/lang/lib/python3.8/imp.py", line 234, in load_module
  return load_source(name, filename, file)
File "/var/lang/lib/python3.8/imp.py", line 171, in load_source
  module = _load(spec)
File "<frozen importlib._bootstrap>", line 702, in _load
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 843, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/var/lang/lib/python3.8/site-packages/datadog_lambda/handler.py", line 20, in <module>
  raise HandlerError(
@duncanista duncanista added the enhancement New feature or request label Jan 10, 2024
@duncanista duncanista added bug Something isn't working and removed enhancement New feature or request labels Jan 26, 2024
@duncanpharvey
Copy link
Contributor

Hi @vieirai, thanks for reporting this! We released a fix that resolves this error in v0.11.0.
https://github.com/DataDog/datadog-cloudformation-macro/releases/tag/serverless-macro-0.11.0

Please reopen this issue or open a new issue if you continue to encounter errors.

@duncanpharvey duncanpharvey linked a pull request Jan 29, 2024 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants