Enable secure random ID generation for AWS Lambda MicroVM environments#11622
Enable secure random ID generation for AWS Lambda MicroVM environments#11622litianningdatadog wants to merge 1 commit into
Conversation
|
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1c7afe3fa0
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…onments When AWS_LAMBDA_MICROVM_IMAGE_ARN is set, force SecureRandom for trace/span ID generation — the same treatment already applied for snap-start environments, where snapshot-resumed instances would otherwise produce predictable IDs. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
1c7afe3 to
0672981
Compare
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
https://datadoghq.atlassian.net/browse/SVLS-9287
Background
For Firecracker-based container technology, in order to reduce cold-start latency, the system snapshots the entire process memory of a warmed-up instance and reuses it to launch new ones. Every resumed instance starts from the same frozen memory image — including any userspace state that was initialized before the snapshot was taken.
Summary
secureRandomlogic to also activate when running in AWS Lambda MicroVM environments (detected via theAWS_LAMBDA_MICROVM_IMAGE_ARNenvironment variable)SecureRandom-based ID generation because memory snapshots can cause ID collisions with standard random sourcesConfigSecureRandomTestwith 5 JUnit 5 tests covering all activation paths (default, SnapStart, MicroVM ARN, empty ARN, config property)Test plan
./gradlew :internal-api:test --tests datadog.trace.api.ConfigSecureRandomTestpassessecureRandom = truewhenAWS_LAMBDA_MICROVM_IMAGE_ARNis set to a non-empty valuesecureRandom = false(default) whenAWS_LAMBDA_MICROVM_IMAGE_ARNis empty or unsetsecureRandom = true🤖 Generated with Claude Code