Datadog Block
Query metrics, logs, and manage incidents in Datadog
The Datadog block brings observability data into your workflows. Use it to query metrics and logs, list monitors and dashboards, and create or list incidents so automation can react to the health of your infrastructure.
Overview
| Property | Value |
|---|---|
| Type | datadog |
| Category | tools |
| Color | #632CA6 |
When to Use
- Pull time-series metrics (e.g.
avg:system.cpu.user{*}) into a workflow for alerting or reporting. - Search Datadog logs over a time window to drive downstream analysis or notifications.
- List active monitors to check the current health state of services.
- Automatically create an incident when an upstream block detects a failure.
- List existing incidents to summarize or reconcile ongoing issues.
- Enumerate dashboards for inventory, auditing, or linking purposes.
Configuration
Operation
Required. Selects which Datadog API action to perform. Available options:
| Label | ID |
|---|---|
| Query Metrics | datadog_query_metrics |
| Query Logs | datadog_query_logs |
| List Monitors | datadog_list_monitors |
| Create Incident | datadog_create_incident |
| List Incidents | datadog_list_incidents |
| List Dashboards | datadog_list_dashboards |
API Key
Required. Your Datadog API key, stored as a secret (apiKey).
Application Key
Required. Your Datadog application key, stored as a secret (appKey).
Site
The Datadog site/region for all API calls. Defaults to datadoghq.com when not specified. Available options:
| Label | ID |
|---|---|
| US1 (datadoghq.com) | datadoghq.com |
| US3 (us3.datadoghq.com) | us3.datadoghq.com |
| EU (datadoghq.eu) | datadoghq.eu |
| US5 (us5.datadoghq.com) | us5.datadoghq.com |
Query
The query expression to evaluate. Shown only for the datadog_query_metrics and datadog_query_logs operations. For metrics use Datadog metric syntax (e.g. avg:system.cpu.user{*}); for logs use the log search query syntax (e.g. service:myapp status:error).
From (Unix timestamp)
Start of the time range as a Unix epoch timestamp in seconds. Shown only for datadog_query_metrics and datadog_query_logs.
To (Unix timestamp)
End of the time range as a Unix epoch timestamp in seconds. Shown only for datadog_query_metrics and datadog_query_logs.
Inputs & Outputs
Inputs (subBlock ids passed to the block at runtime):
operation(string) — Operation to perform (one of the operation IDs above)apiKey(string) — API keyappKey(string) — Application keysite(string) — Datadog sitequery(string) — Query expression (metrics or logs operations only)from(string) — Start time as Unix epoch seconds (metrics or logs operations only)to(string) — End time as Unix epoch seconds (metrics or logs operations only)
Outputs (fields available on the block's result, depending on the operation chosen):
series(json) — Metrics series returned by Query Metricslogs(json) — Log events returned by Query Logsmonitors(json) — Monitor list returned by List Monitorsincidents(json) — Incident list returned by List Incidentsdashboards(json) — Dashboard list returned by List Dashboardsid(string) — Incident ID returned by Create Incidenttitle(string) — Incident title returned by Create Incidentstatus(string) — Incident status returned by Create Incidentcreated(string, optional) — Creation timestamp returned by Create Incidentcursor(string, optional) — Pagination cursor returned by Query Logs and List Incidentsfrom(number, optional) — Query start time echoed by Query Metricsto(number, optional) — Query end time echoed by Query Metricsquery(string) — The query string used, echoed by Query Metrics
Tools
Each operation maps to a dedicated tool registered in the tool registry:
- Datadog Query Metrics (
datadog_query_metrics) — Queries the Datadog v1 metrics API for a given metric expression over a Unix time range. Returnsseries,from,to, andquery. - Datadog Query Logs (
datadog_query_logs) — Searches the Datadog v2 logs events API for log entries matching a query string over a time range. Returns up to 50logsper call plus acursorfor pagination. - Datadog List Monitors (
datadog_list_monitors) — Retrieves all monitors defined in the Datadog account via the v1 monitor API. Returnsmonitors. - Datadog Create Incident (
datadog_create_incident) — Creates a new incident in Datadog via the v2 incidents API using the suppliedtitle. Returnsid,title,status, andcreated. - Datadog List Incidents (
datadog_list_incidents) — Lists all incidents in the Datadog account via the v2 incidents API. Returnsincidentsand an optionalcursorfor pagination. - Datadog List Dashboards (
datadog_list_dashboards) — Lists all dashboards in the Datadog account via the v1 dashboard API. Returnsdashboards.
YAML Example
datadog_1:
type: datadog
name: "Datadog"
inputs:
operation: "datadog_query_metrics"
apiKey: "{{DATADOG_API_KEY}}"
appKey: "{{DATADOG_APP_KEY}}"
site: "datadoghq.com"
query: "avg:system.cpu.user{*}"
from: "1700000000"
to: "1700003600"
connections:
outgoing:
- target: next-block-id