skillfed

datadog-cdk-constructs-v2

CDK Construct Library to automatically instrument Python and Node Lambda functions with Datadog using AWS CDK v2

datadog-cdk-constructs-v2 v4.2.0 267.6K downloads/30d#8,289 on PyPI74
Permissive license Apache-2.0 Active released

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-v2

uv

uv add datadog-cdk-constructs-v2

poetry

poetry add datadog-cdk-constructs-v2

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI ApprovedOperating System :: OS IndependentProgramming Language :: JavaScriptProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Typed

Tags

aws cdk datadog lambda instrumentationserverless monitoring with datadogcdk construct datadog integrationlambda tracing and metrics datadogaws cdk observabilitydatadog lambda layer automationcdk serverless monitoring
aws-cdkserverless-monitoringdatadog-integration

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

cdk-cloudformation-datadog-monitors-monitor

Provides an AWS CDK L1 construct for defining…

permissive · top 15,000 on PyPI

aws-cdk.aws-servicediscovery

Provides AWS CDK constructs for defining and…

permissive · top 15,000 on PyPI

cdk-aurora-globaldatabase

Provides AWS CDK constructs to deploy Amazon…

permissive · top 15,000 on PyPI

aws-cdk.aws-lambda

Defines AWS Lambda functions and layers as…

permissive · top 15,000 on PyPI

cdk-events-notify

An AWS CDK Construct Library that automatically…

permissive · top 15,000 on PyPI

aws-cdk.aws-ecs

Provides AWS CDK constructs for defining and…

permissive · top 15,000 on PyPI

aws-cdk.aws-cloudwatch

Defines CloudWatch metrics, alarms, and…

permissive · top 15,000 on PyPI

safe-init

Safe Init wraps AWS Lambda handlers to provide…

permissive · top 15,000 on PyPI

aws-cdk.aws-sam

Provides AWS CDK v1 constructs for defining…

permissive · top 15,000 on PyPI

ddtrace

ddtrace instruments Python applications to send…

permissive · top 1,000 on PyPI