datadog-cdk-constructs-v2
CDK Construct Library to automatically instrument Python and Node Lambda functions with Datadog using AWS CDK v2
What it is and what it does
This package is an AWS CDK construct library that wraps Datadog's Lambda instrumentation layers and configuration into reusable, declarative CDK components. Instead of manually attaching Datadog Lambda layers, managing API keys, and configuring log subscriptions in your CDK stack, you instantiate a DatadogLambda construct, pass it your Lambda functions, and the construct handles layer installation, tracing setup, and log forwarding automatically.
It supports Lambda functions across multiple runtimes (Python, Node.js, Java, Go, Ruby, .NET) and also provides constructs for ECS Fargate services. The library integrates with AWS Secrets Manager for secure API key storage, supports custom tagging and environment variables, and can automatically enable source code integration if your Datadog GitHub integration is configured. It's designed for teams using AWS CDK v2 who want to add Datadog observability to serverless workloads without boilerplate.
Use it for:
- Automatically instrument all Lambda functions in a CDK stack with Datadog tracing and custom metrics in a single construct call.
- Centrally manage Datadog API keys and layer versions across multiple Lambda functions deployed via CDK.
- Enable distributed tracing and log correlation for serverless applications by adding the construct to your stack.
- Set up Datadog log forwarding from CloudWatch log groups without manually creating subscriptions.
- Deploy ECS Fargate services with built-in Datadog monitoring through a dedicated construct.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides AWS CDK constructs to automatically instrument Lambda functions and ECS Fargate services with Datadog monitoring, configuring metrics, traces, and logs collection without manual layer management.
Yes. This is a production-stable, actively maintained library (latest release 43 days ago, no known vulnerabilities) that significantly reduces boilerplate for Datadog-instrumented serverless deployments on AWS CDK. Install it if you are already using AWS CDK v2 and want Datadog observability; it saves configuration effort and enforces consistent instrumentation across your Lambda and Fargate workloads. The Apache-2.0 license imposes no restrictions.
Install
datadog-cdk-constructs-v2 on PyPI
pip
pip install datadog-cdk-constructs-v2uv
uv add datadog-cdk-constructs-v2poetry
poetry add datadog-cdk-constructs-v2Installing datadog-cdk-constructs-v2
Before you install
Low install friction with a pure-Python wheel. Actively maintained with a recent release 43 days ago. Requires aws-cdk-lib, constructs, jsii, and publication as runtime dependencies—all standard CDK ecosystem packages.
License in practice
Licensed under Apache-2.0 (permissive). You can use, modify, and distribute this package freely in commercial and private projects, with no copyleft obligations beyond retaining the license notice.
Quickstart
pip install datadog-cdk-constructs-v2
from datadog_cdk_constructs_v2 import DatadogLambda, DatadogDefaultLayerVersions
import os
datadog = DatadogLambda(
self,
"Datadog",
extension_layer_version=DatadogDefaultLayerVersions.EXTENSION,
api_key=os.getenv("DD_API_KEY"),
)
datadog.add_lambda_functions([my_lambda_function])
Requires Python 3.10 or later. You must have aws-cdk-lib and constructs installed, and a valid Datadog API key passed via environment variable or CDK parameter.
Verify before relying
- Whether the package supports all Lambda runtimes mentioned (Python, Node.js, Java, Go, Ruby, .NET) equally well from the CDK side, or if some have limitations.
- Performance overhead or cold-start impact of the Datadog Lambda layers when applied via this construct.
- Whether ECS Fargate support is production-ready or still in beta relative to Lambda support.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — aws-cdk-lib, constructs, jsii, publication |
| Maintenance | actively maintained — 43 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 267,620/month — #8,289 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: datadog_cdk_constructs_v2-4.2.0-py3-none-any.whl
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
cdk-cloudformation-datadog-monitors-monitorProvides an AWS CDK L1 construct for defining…
permissive · top 15,000 on PyPI
aws-cdk.aws-servicediscoveryProvides AWS CDK constructs for defining and…
permissive · top 15,000 on PyPI
cdk-aurora-globaldatabaseProvides AWS CDK constructs to deploy Amazon…
permissive · top 15,000 on PyPI
aws-cdk.aws-lambdaDefines AWS Lambda functions and layers as…
permissive · top 15,000 on PyPI
cdk-events-notifyAn AWS CDK Construct Library that automatically…
permissive · top 15,000 on PyPI
aws-cdk.aws-ecsProvides AWS CDK constructs for defining and…
permissive · top 15,000 on PyPI
aws-cdk.aws-cloudwatchDefines CloudWatch metrics, alarms, and…
permissive · top 15,000 on PyPI
safe-initSafe Init wraps AWS Lambda handlers to provide…
permissive · top 15,000 on PyPI
aws-cdk.aws-samProvides AWS CDK v1 constructs for defining…
permissive · top 15,000 on PyPI
ddtraceddtrace instruments Python applications to send…
permissive · top 1,000 on PyPI