CONNECT APP
Build with Datadog
Developer Tools
- API key
MCP
Give your agent Datadog tools
Every Datadog action is exposed as an MCP tool on Pipedream's remote server. Point a client at it with your end user's ID and Connect resolves that user's Datadog account for each tool call — you store no tokens.
// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "datadog",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// e.g. run Get Account Info:
const result = await mcp.callTool({
name: "datadog-get-account-info",
arguments: {},
})# access_token: mint a short-lived token with the Connect SDK — see the MCP guide
headers = {
"Authorization": f"Bearer {access_token}",
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", # any stable ID for this user in your system
"x-pd-app-slug": "datadog",
}
async with streamablehttp_client("https://remote.mcp.pipedream.net/v3", headers=headers) as (read, write, _):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
# e.g. run Get Account Info:
result = await session.call_tool("datadog-get-account-info", {})API PROXY
Call the Datadog API directly
For an endpoint with no pre-built tool, the Connect proxy forwards your request to the Datadog API with the connected user's credentials attached. You store no tokens and write no refresh logic.
const resp = await pd.proxy.get({
externalUserId: "{external_user_id}", // any stable ID for this user in your system
accountId: "apn_xxxxxxx",
url: "https://api.example.com/v1/me",
})
// Any allowed Datadog endpoint works here. Pipedream attaches the
// connected account's credentials to the outgoing request.# The path segment is the target URL, URL-safe base64 encoded:
# https://api.example.com/v1/me
curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9hcGkuZXhhbXBsZS5jb20vdjEvbWU?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
-H "Authorization: Bearer {access_token}" \
-H "x-pd-environment: production"SDK
Run Datadog actions from your backend
Connect a user's Datadog account once, then run Get Account Info on their behalf from your own code — TypeScript, Python, or plain HTTP.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "datadog-get-account-info",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
datadog: { authProvisionId: "apn_xxxxxxx" },
},
})from pipedream import Pipedream
pd = Pipedream(
client_id="{oauth_client_id}",
client_secret="{oauth_client_secret}",
project_id="{project_id}",
project_environment="production",
)
result = pd.actions.run(
id="datadog-get-account-info",
external_user_id="{external_user_id}", # any stable ID for this user in your system
configured_props={
"datadog": {"authProvisionId": "apn_xxxxxxx"},
},
)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "datadog-get-account-info",
"configured_props": {
"datadog": { "authProvisionId": "apn_xxxxxxx" }
}
}'TOOLS
Datadog actions
On-demand operations your product or agent can configure and run on behalf of a connected user.
-
Get Account Info
actionDetect the Datadog region for the connected account. Call this FIRST before any other Datadog tool if you do not already know the region. Returns the region domain (e.g.datadoghq.com) which must be passed as theregionparameter to Search Logs, Search Monitors, Get Metric Data, and all other Datadog tools. See the docsRead-onlyv1.0.2 -
Get Account Region
actionDetect the Datadog region for the connected account by validating the API key against each regional endpoint. Use this to discover the correct region before calling other Datadog actions. See the docsRead-onlyv0.0.1 -
Get Metric Data
actionQuery time-series metric data for analyzing trends and system performance. Query syntax:avg:system.cpu.user{*},sum:requests.count{env:prod} by {host},max:system.mem.used{service:web}. Bothfromandtoare POSIX timestamps in seconds. Use Search Metrics first to discover available metric names. Use Search Hosts to find valid host tags for scoping. After finding anomalies, use Search Logs to investigate related entries. See the docsRead-onlyv1.0.2 -
List Logs
actionGet a list of logs matching a filter query. Uses the GET endpoint with a higher rate limit (3600/hr vs 300/hr). See the docsRead-onlyv0.0.1 -
Post Metric Data
actionPost custom time-series metric data points to Datadog. Data appears in dashboards, monitors, and can be queried via Get Metric Data. Points: JSON object where keys are Unix timestamps (seconds) and values are numeric, e.g.{"1640995200": 1.0}. Use Search Metrics to verify a metric name exists, or post to a new name to create it. This is a WRITE operation that creates or appends data to a metric time series. See the docsWritev1.0.2 -
Search Dashboards
actionList and search Datadog dashboards. Returns dashboard IDs, titles, URLs, and metadata. Dashboard URL:https://app.{region}/dashboard/{id}where region comes from Get Account Info. Use alongside Search Services to find dashboards related to a specific service. See the docsRead-onlyv1.0.2 -
Search Events
actionSearch Datadog events: monitor state changes, deployment markers, error spikes, and infrastructure events. Filter bysources(e.g.nagios,docker),tags(e.g.env:prod,service:web), andpriority(normalorlow). Time range defaults to last 24h (POSIX timestamps in seconds). To investigate a monitor alert, use Search Monitors first, then search events for the relevant time range. Follow up with Search Logs for deeper investigation. See the docsRead-onlyv1.0.2 -
Search Hosts
actionSearch monitored infrastructure hosts. Filter by tag (env:production), name (host:web-01), or partial match. Sort bycpu,iowait,load,status, orapps. Host names from results can scope queries in Get Metric Data (e.g.avg:system.cpu.user{host:web-01}), filter logs in Search Logs (host:web-01), or filter metrics in Search Metrics. Max 1000 results. See the docsRead-onlyv1.0.2 -
Search Incidents
actionSearch Datadog incidents by state, severity, and metadata. Query syntax:state:active,state:resolved,severity:SEV-1. After finding an incident, investigate with: Search Logs for the incident time window, Get Metric Data for relevant metrics, Search Events for related monitor alerts, and Search Services for ownership info. See the docsRead-onlyv1.0.2 -
Search Logs
actionSearch Datadog logs matching a query with support for facets and time ranges. Uses log search syntax:service:web-app status:error,@http.status_code:>=400, boolean operators (AND, OR, NOT), and wildcards. Setfromtonow-1hfor recent logs. Use Search Metrics to discover metric names or Search Hosts to find host names for filtering. To investigate an incident, use Search Incidents first, then search logs for that time window and service. See the docsRead-onlyv1.0.2 -
Search Metrics
actionDiscovery tool: list available Datadog metric names, optionally filtered by host. Returns metric name strings (e.g.system.cpu.user,aws.ec2.cpuutilization) for use in Get Metric Data queries with the syntaxaggregation:metric.name{tags}. Use Search Hosts to find valid host names for thehostfilter. See the docsRead-onlyv1.0.2 -
Search Monitors
actionSearch Datadog monitors (alerting rules) including status, thresholds, and conditions. Query syntax:tag:env:production,type:metric,status:Alert. Tags filter: comma-separated (e.g.env:prod,team:backend). After finding a monitor, use Search Events to see recent state changes, or Get Metric Data to query the underlying metric it tracks. Returns monitor ID, name, type, query, status, and tags. See the docsRead-onlyv1.0.2 -
Search Services
actionList services from Datadog's Service Catalog with ownership, metadata, and team info. Use to discover service names for filtering in Search Logs (service:my-app) or finding monitors via Search Monitors (tag:service:my-app). Returns service definitions including links, docs, and on-call. See the docsRead-onlyv1.0.2
EVENTS
Datadog triggers
Event sources your backend can deploy for users and receive through a webhook.
MULTI-APP
Use Datadog with other popular apps
Most products don't stop at one integration. Pair Datadog with the other apps your users rely on, and ship use cases that span both.
- App slug
- datadog
- Authentication
- API key
- Categories
- Developer Tools
- Actions
- 13
- Triggers
- 1
- API proxy
- Available