Skip to content

Commit 1dbbc30

Browse files
docs: Add Lambda Managed Instance mode documentation (#951)
docs: Add Lambda Managed Instance mode documentation https://datadoghq.atlassian.net/browse/SVLS-8083 ## Overview Add comprehensive documentation for Lambda Managed Instance support (v90+): - Overview of Managed Instance mode and how it differs from standard Lambda - Automatic detection and optimization behavior - Background continuous flushing architecture with zero per-invocation overhead - Key differences comparison table (invocation model, flushing, use cases) - Getting started guide for users Also clarifies that custom continuous flush intervals are respected in Managed Instance mode (not completely ignored as previously stated). ## Testing n/a
1 parent 56d4a07 commit 1dbbc30

File tree

2 files changed

+43
-3
lines changed

2 files changed

+43
-3
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,46 @@ APM Tracing is supported for Python, NodeJS, Go, Java, and .NET runtimes.
2929

3030
We'd love to hear your feedback on the next-generation Lambda Extension. You can open a GitHub issue here using the `version/next` tag, find us on the [Datadog Community Slack](https://chat.datadoghq.com/) in the #serverless channel, or reach out to me directly at [email protected].
3131

32+
## Lambda Managed Instance Support
33+
34+
The Datadog Lambda Extension (v90+) now supports **AWS Lambda Managed Instances**, a deployment mode where Lambda functions run on EC2 instances managed by AWS with multi-concurrent invocation handling. This is ideal for steady-state, high-volume workloads where optimizing costs with predictable capacity is desired.
35+
36+
### What is Lambda Managed Instance Mode?
37+
38+
Lambda Managed Instances run your functions on EC2 instances (managed by AWS) where one execution environment can handle multiple invocations simultaneously, unlike traditional Lambda's one-invocation-per-environment model. This requires setting up a **capacity provider** - a configuration that defines VPC settings, instance requirements, and scaling parameters.
39+
40+
Learn more:
41+
- [Introducing AWS Lambda Managed Instances: Serverless simplicity with EC2 flexibility](https://aws.amazon.com/blogs/aws/introducing-aws-lambda-managed-instances-serverless-simplicity-with-ec2-flexibility/)
42+
- [Lambda Managed Instances - AWS Lambda Developer Guide](https://docs.aws.amazon.com/lambda/latest/dg/lambda-managed-instances.html)
43+
44+
### How the Extension Supports Managed Instances
45+
46+
The Datadog Extension automatically detects when running in Managed Instance mode (via the `AWS_LAMBDA_INITIALIZATION_TYPE` environment variable) and optimizes its behavior:
47+
48+
- **Background Flushing**: A dedicated background task continuously flushes observability data at regular intervals (default: 30 seconds), completely independent of invocation processing
49+
- **Zero Per-Invocation Overhead**: All flush operations are non-blocking and run concurrently with your function invocations
50+
- **Optimized Event Handling**: The extension processes telemetry events directly from the Lambda Telemetry API without blocking on invocation lifecycle calls
51+
- **Enhanced Monitoring**: Generates managed-instance-specific metrics and statistics
52+
53+
### Key Differences from Standard Lambda
54+
55+
| Aspect | Managed Instance Mode | Standard (On-Demand) Mode |
56+
|--------|----------------------|---------------------------|
57+
| **Invocation Model** | Multi-concurrent invocations per environment | Single invocation per environment |
58+
| **Data Flushing** | Continuous background flushing (non-blocking) | Configurable flush strategies |
59+
| **Flush Overhead** | Zero overhead per invocation | Small overhead based on flush strategy |
60+
| **Configuration** | Always continuous (custom intervals respected) | Flush strategy is configurable |
61+
| **Use Case** | Steady-state, high-volume workloads | General serverless workloads |
62+
63+
### Getting Started
64+
65+
1. Set up your Lambda function with a [capacity provider](https://docs.aws.amazon.com/lambda/latest/dg/lambda-managed-instances.html)
66+
2. Install the Datadog Lambda Extension (v90+) as usual
67+
3. The extension will automatically detect Managed Instance mode and optimize its behavior
68+
4. Monitor your telemetry in Datadog as normal
69+
70+
No additional configuration is required - the extension handles everything automatically when it detects the Managed Instance environment.
71+
3272
## Upgrading
3373

3474
To upgrade, update the Datadog Extension version in your Lambda layer configurations or Dockerfile (for Lambda functions deployed as container images). View the latest [releases](https://github.com/DataDog/datadog-lambda-extension/releases) and corresponding changelogs before upgrading.

bottlecap/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Step 3: Test your change running `./runBottlecap.sh`
2424
Bottlecap supports several flush strategies that control when and how observability data (metrics, logs, traces) is sent to Datadog. The strategy is configured via the `DD_SERVERLESS_FLUSH_STRATEGY` environment variable.
2525

2626
**Important**: Flush strategies behave differently depending on the Lambda execution mode:
27-
- **Managed Instance**: Uses continuous background flushing (flush strategies are ignored)
27+
- **Managed Instance**: Always uses continuous background flushing (only custom continuous intervals are respected)
2828
- **On-Demand**: Uses configurable flush strategies
2929

3030
### Managed Instance Mode vs On-Demand Mode
@@ -37,7 +37,7 @@ Lambda Managed Instances run your functions on EC2 instances (managed by AWS) wi
3737
- A dedicated background task continuously flushes data at regular intervals (default: 30 seconds)
3838
- All flushes are **non-blocking** and run concurrently with invocation processing
3939
- Prevents resource buildup by skipping a flush cycle if the previous flush is still in progress
40-
- `DD_SERVERLESS_FLUSH_STRATEGY` is **ignored** in this mode
40+
- Only `DD_SERVERLESS_FLUSH_STRATEGY=continuously,<ms>` is respected; all other strategies are overridden to continuous with default interval
4141
- **Shutdown Behavior**:
4242
- Background flusher waits for pending flushes to complete before shutdown
4343
- Final flush ensures all remaining data is sent before the execution environment terminates
@@ -164,7 +164,7 @@ Located in `bottlecap/src/bin/bottlecap/main.rs`:
164164
| **Scaling** | Asynchronous, CPU-based scaling | Reactive scaling with cold starts |
165165
| **Pricing** | EC2 instance-based | Per-request duration-based |
166166
| **Flush Trigger** | Background interval timer | Invocation lifecycle + interval |
167-
| **Strategy Config** | Ignored (always continuous) | Configurable via env var |
167+
| **Strategy Config** | Always continuous (custom intervals respected) | Configurable via env var |
168168
| **Main Loop** | Event bus processing | `/next` + event bus processing |
169169
| **Shutdown Detection** | Separate task monitors `/next` | Main loop receives from `/next` |
170170

0 commit comments

Comments
 (0)