feat(lambda-lite): detect Lambda Lite environment and write mini agent sentinel file#81
Draft
litianningdatadog wants to merge 3 commits intomainfrom
Draft
feat(lambda-lite): detect Lambda Lite environment and write mini agent sentinel file#81litianningdatadog wants to merge 3 commits intomainfrom
litianningdatadog wants to merge 3 commits intomainfrom
Conversation
Preparing for git worktree usage to enable isolated development workspaces. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Add `is_lambda_lite()` in http_utils to detect Lambda Lite via `AWS_LAMBDA_INITIALIZATION_TYPE=native-http`; includes unit tests for all env var states (native-http, on-demand, empty, unset) - Write `/tmp/datadog/mini_agent_ready` sentinel on startup when running in Lambda Lite mode so dd-trace Node.js can switch from LogExporter (stdout) to AgentExporter (HTTP :8126) - Refine release profile: use fat LTO, explicit symbol stripping, and `panic = "abort"` for smaller binary size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://datadoghq.atlassian.net/browse/SVLS-8571
What does this PR do?
Adds Lambda Lite detection to datadog-serverless-compat and uses it to write a sentinel file on startup that signals co-located Node.js tracers to switch transport modes.
AgentExporter (HTTP to :8126) instead of LogExporter (stdout).
Motivation
Lambda Lite (web function / snap-start mode) runs as a long-lived HTTP server rather than a short-lived invocation handler. The standard Lambda Extension path (/opt/extensions/datadog-agent) is not available in this environment, so dd-trace has no automatic signal that a local agent is present and defaults to shipping traces via stdout. Writing the sentinel file gives dd-trace the signal it needs to switch to the more efficient HTTP path without requiring any customer configuration.
Additional Notes
Describe how to test/QA your changes