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

fix: Abort instrumenting Lambda if runtime is unsupported #348

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

lym953
Copy link
Contributor

@lym953 lym953 commented Dec 6, 2024

What does this PR do?

  1. If Lambda runtime is unsupported, e.g. if it's an unresolved token, then abort instrumenting this Lambda function.
  2. Change the required AWS CDK version from 2.134.0 to 2.146.0, so the unresolved token case can be tested.

Motivation

Right now, even if Node runtime is not supported, we still proceed with the rest of the steps of instrumentation. As a result, Lambda execution may fail because it can't find a Datadog wrapper that's supposed to be in the Lambda layer.

More in #314

Testing Guidelines

Steps

  1. Make changes on the example TypeScript Lambda stack, so it uses an unresolved runtime 793365b
  2. Deploy the stack

Result

  1. A warning message is created:
image
  1. Lambda function doesn't have the two layers installed
  2. Lambda could run with no error
image

Additional Notes

Types of Changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog

@lym953 lym953 force-pushed the yiming.luo/fix-nodejs-latest-8 branch 2 times, most recently from 25f7faf to 3fb378f Compare December 6, 2024 21:33
@lym953 lym953 changed the base branch from main to yiming.luo/aws-cdk-v146 December 6, 2024 21:34
@lym953 lym953 force-pushed the yiming.luo/fix-nodejs-latest-8 branch from 3fb378f to a712bd9 Compare December 6, 2024 21:35
@lym953 lym953 marked this pull request as ready for review December 6, 2024 21:36
@lym953 lym953 requested a review from a team as a code owner December 6, 2024 21:36
Base automatically changed from yiming.luo/aws-cdk-v146 to main December 6, 2024 21:57
@lym953 lym953 force-pushed the yiming.luo/fix-nodejs-latest-8 branch from a712bd9 to 9f1ada4 Compare December 6, 2024 22:37
@lym953
Copy link
Contributor Author

lym953 commented Dec 6, 2024

/merge

@dd-devflow
Copy link

dd-devflow bot commented Dec 6, 2024

Devflow running: /merge

View all feedbacks in Devflow UI.


2024-12-06 22:38:14 UTC ℹ️ MergeQueue: pull request added to the queue

The median merge time in main is 9m.

@dd-mergequeue dd-mergequeue bot merged commit 4895acf into main Dec 6, 2024
14 checks passed
@dd-mergequeue dd-mergequeue bot deleted the yiming.luo/fix-nodejs-latest-8 branch December 6, 2024 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants