Datadog

The Datadog plugin lets formae manage Datadog resources: monitors, SLOs, downtimes, log indexes, pipelines, archives, dashboards, teams, roles, and synthetics tests.

Repository: formae-plugin-datadog

Installation

git clone https://github.com/platform-engineering-labs/formae-plugin-datadog.git
cd formae-plugin-datadog
make install

This builds the plugin and installs it to ~/.pel/formae/plugins/datadog/. The formae agent discovers installed plugins automatically on startup. Requires Go 1.26+.

Configuration

Target

Configure a Datadog target in your Forma file:

import "@formae/formae.pkl"
import "@datadog/datadog.pkl"

target: formae.Target = new formae.Target {
    label = "my-datadog"
    namespace = "DATADOG"
    config = new datadog.Config {
        apiKey = read("env:DD_API_KEY")
        appKey = read("env:DD_APP_KEY")
        site = read("env:DD_SITE")
    }
}

Credentials

Datadog needs both an API key and an application key. Set these before applying:

export DD_API_KEY="your-api-key"
export DD_APP_KEY="your-app-key"
export DD_SITE="datadoghq.com"  # or datadoghq.eu, us3.datadoghq.com, etc.

site defaults to datadoghq.com. Set it explicitly when working with EU or other regional tenants.

Examples

The plugin repo ships a basic example covering a CPU monitor, a matching SLO, and a recurring downtime window. Clone the repo and resolve Pkl dependencies before running:

git clone https://github.com/platform-engineering-labs/formae-plugin-datadog.git
cd formae-plugin-datadog
pkl project resolve examples/basic

Then apply it:

# Set credentials
export DD_API_KEY="your-api-key"
export DD_APP_KEY="your-app-key"
export DD_SITE="datadoghq.com"

# Evaluate the forma
formae eval examples/basic/main.pkl

# Apply resources
formae apply --mode reconcile --watch examples/basic/main.pkl

Supported Resources

Resource type Description
Datadog::Dashboard::Dashboard Dashboards with typed shell fields and widgets stored as raw JSON for faithful discovery
Datadog::IAM::Role Roles grouping permissions for users and service accounts
Datadog::IAM::Team Teams for organizing members and ownership
Datadog::Logs::Archive Long-term log archives to S3, GCS, or Azure
Datadog::Logs::Index Log indexes with retention, sampling, and exclusion filters
Datadog::Logs::Metric Log-based metrics generated from indexed logs
Datadog::Logs::Pipeline Log processing pipelines with processors stored as raw JSON
Datadog::Monitoring::DowntimeSchedule One-time or recurring downtime windows that suppress alerts
Datadog::Monitoring::Monitor Alert monitors for metrics, logs, events, and more
Datadog::Monitoring::SLO Service level objectives tracking metric or monitor-based targets
Datadog::Security::MonitoringRule Cloud SIEM detection rules with cases and signal generation
Datadog::Synthetics::Test API and browser synthetics tests with config stored as raw JSON

What's next

Release notes

See release notes for changes per version.