analytics
Datadog CLI for AI Agents
Use the Datadog CLI from KosmoKrator to call Datadog tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Datadog CLI Setup
Datadog can be configured headlessly with `kosmokrator integrations:configure datadog`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure datadog --set api_key="$DATADOG_API_KEY" --set app_key="$DATADOG_APP_KEY" --enable --read allow --write ask --json
kosmokrator integrations:doctor datadog --json
kosmokrator integrations:status --json Credentials
Authentication type: API key api_key. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
api_key | DATADOG_API_KEY | Secret secret | yes | API Key |
app_key | DATADOG_APP_KEY | Secret secret | yes | Application Key |
site | DATADOG_SITE | Select select | no | Datadog Site |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call datadog.datadog_list_monitors '{"name":"example_name","tags":"example_tags","page":1,"page_size":1}' --json kosmo integrations:datadog datadog_list_monitors '{"name":"example_name","tags":"example_tags","page":1,"page_size":1}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs datadog --json
kosmo integrations:docs datadog.datadog_list_monitors --json
kosmo integrations:schema datadog.datadog_list_monitors --json
kosmo integrations:search "Datadog" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
datadog.datadog_list_monitors
List Datadog monitors. Optionally filter by name or tags. Returns monitor IDs, names, types, states, and query definitions.
read - Parameters
- name, tags, page, page_size
kosmo integrations:call datadog.datadog_list_monitors '{"name":"example_name","tags":"example_tags","page":1,"page_size":1}' --json kosmo integrations:datadog datadog_list_monitors '{"name":"example_name","tags":"example_tags","page":1,"page_size":1}' --json datadog.datadog_get_monitor
Get full details of a specific Datadog monitor by ID. Returns the monitor query, thresholds, message, and current state.
read - Parameters
- monitor_id
kosmo integrations:call datadog.datadog_get_monitor '{"monitor_id":1}' --json kosmo integrations:datadog datadog_get_monitor '{"monitor_id":1}' --json datadog.datadog_create_monitor
Create a new Datadog monitor. Specify the monitor type, query, name, and optional message and thresholds. Common types: "metric alert", "service check", "event alert".
write - Parameters
- type, query, name, message, priority, options, tags
kosmo integrations:call datadog.datadog_create_monitor '{"type":"example_type","query":"example_query","name":"example_name","message":"example_message","priority":1,"options":"example_options","tags":"example_tags"}' --json kosmo integrations:datadog datadog_create_monitor '{"type":"example_type","query":"example_query","name":"example_name","message":"example_message","priority":1,"options":"example_options","tags":"example_tags"}' --json datadog.datadog_update_monitor
Update an existing Datadog monitor. Provide the monitor ID and the fields to update (name, query, message, options, tags, etc.).
write - Parameters
- monitor_id, type, query, name, message, priority, options, tags
kosmo integrations:call datadog.datadog_update_monitor '{"monitor_id":1,"type":"example_type","query":"example_query","name":"example_name","message":"example_message","priority":1,"options":"example_options","tags":"example_tags"}' --json kosmo integrations:datadog datadog_update_monitor '{"monitor_id":1,"type":"example_type","query":"example_query","name":"example_name","message":"example_message","priority":1,"options":"example_options","tags":"example_tags"}' --json datadog.datadog_delete_monitor
Delete a Datadog monitor by ID. This action is permanent and cannot be undone.
write - Parameters
- monitor_id
kosmo integrations:call datadog.datadog_delete_monitor '{"monitor_id":1}' --json kosmo integrations:datadog datadog_delete_monitor '{"monitor_id":1}' --json datadog.datadog_query_metrics
Query Datadog metrics between two timestamps. Use Datadog query syntax (e.g., "avg:system.cpu.user{env:production} by {host}"). Returns time series data points.
read - Parameters
- from, to, query
kosmo integrations:call datadog.datadog_query_metrics '{"from":1,"to":1,"query":"example_query"}' --json kosmo integrations:datadog datadog_query_metrics '{"from":1,"to":1,"query":"example_query"}' --json datadog.datadog_list_dashboards
List all Datadog dashboards. Returns dashboard IDs, titles, descriptions, and modification dates.
read - Parameters
- none
kosmo integrations:call datadog.datadog_list_dashboards '{}' --json kosmo integrations:datadog datadog_list_dashboards '{}' --json datadog.datadog_get_dashboard
Get full details of a specific Datadog dashboard by ID. Returns the dashboard layout, widgets, and template variables.
read - Parameters
- dashboard_id
kosmo integrations:call datadog.datadog_get_dashboard '{"dashboard_id":"example_dashboard_id"}' --json kosmo integrations:datadog datadog_get_dashboard '{"dashboard_id":"example_dashboard_id"}' --json datadog.datadog_post_event
Post an event to the Datadog event stream. Specify title, text, priority, tags, and alert type. Events appear in the event timeline.
write - Parameters
- title, text, priority, tags, alert_type, date_happened, source_type_name, host, aggregation_key
kosmo integrations:call datadog.datadog_post_event '{"title":"example_title","text":"example_text","priority":"example_priority","tags":"example_tags","alert_type":"example_alert_type","date_happened":1,"source_type_name":"example_source_type_name","host":"example_host"}' --json kosmo integrations:datadog datadog_post_event '{"title":"example_title","text":"example_text","priority":"example_priority","tags":"example_tags","alert_type":"example_alert_type","date_happened":1,"source_type_name":"example_source_type_name","host":"example_host"}' --json datadog.datadog_get_current_user
Get the currently authenticated Datadog user. Useful for verifying credentials and identifying the connected account.
read - Parameters
- none
kosmo integrations:call datadog.datadog_get_current_user '{}' --json kosmo integrations:datadog datadog_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
datadog.datadog_list_monitors 4 parameters
kosmo integrations:schema datadog.datadog_list_monitors --json | Parameter | Type | Required | Description |
|---|---|---|---|
name | string | no | Filter monitors by name (substring match). |
tags | string | no | Comma-separated list of tags to filter by (e.g., "env:production,service:api"). |
page | integer | no | Page number for pagination (default: 0). |
page_size | integer | no | Number of monitors per page (default: 30). |
datadog.datadog_get_monitor 1 parameters
kosmo integrations:schema datadog.datadog_get_monitor --json | Parameter | Type | Required | Description |
|---|---|---|---|
monitor_id | integer | yes | The ID of the monitor to retrieve. |
datadog.datadog_create_monitor 7 parameters
kosmo integrations:schema datadog.datadog_create_monitor --json | Parameter | Type | Required | Description |
|---|---|---|---|
type | string | yes | Monitor type: "metric alert", "service check", "event alert", "query alert", "composite", "log alert", "rum alert", etc. |
query | string | yes | The monitor query (e.g., "avg(last_5m):avg:system.cpu.user{host:my-host} > 90"). |
name | string | no | Display name for the monitor. |
message | string | no | Notification message. Supports @mention syntax (e.g., "@slack-my-channel"). |
priority | integer | no | Monitor priority level (1-5, where 1 is highest). |
options | object | no | JSON-encoded monitor options: thresholds, notify_no_data, no_data_timeframe, renotify_interval, escalation_message, etc. |
tags | array | no | List of tags to assign to the monitor (e.g., ["env:production", "service:api"]). |
datadog.datadog_update_monitor 8 parameters
kosmo integrations:schema datadog.datadog_update_monitor --json | Parameter | Type | Required | Description |
|---|---|---|---|
monitor_id | integer | yes | The ID of the monitor to update. |
type | string | no | Updated monitor type. |
query | string | no | Updated monitor query. |
name | string | no | Updated display name. |
message | string | no | Updated notification message. |
priority | integer | no | Updated priority level (1-5). |
options | object | no | JSON-encoded monitor options (thresholds, notify_no_data, etc.). |
tags | array | no | Updated list of tags. |
datadog.datadog_delete_monitor 1 parameters
kosmo integrations:schema datadog.datadog_delete_monitor --json | Parameter | Type | Required | Description |
|---|---|---|---|
monitor_id | integer | yes | The ID of the monitor to delete. |
datadog.datadog_query_metrics 3 parameters
kosmo integrations:schema datadog.datadog_query_metrics --json | Parameter | Type | Required | Description |
|---|---|---|---|
from | integer | yes | Start time as Unix timestamp in seconds (e.g., 1710000000). Use current time minus seconds for relative ranges. |
to | integer | yes | End time as Unix timestamp in seconds. Use current time for "now". |
query | string | yes | Datadog metric query string (e.g., "avg:system.cpu.user{env:production} by {host}"). |
datadog.datadog_list_dashboards 0 parameters
kosmo integrations:schema datadog.datadog_list_dashboards --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
datadog.datadog_get_dashboard 1 parameters
kosmo integrations:schema datadog.datadog_get_dashboard --json | Parameter | Type | Required | Description |
|---|---|---|---|
dashboard_id | string | yes | The ID of the dashboard to retrieve. |
datadog.datadog_post_event 9 parameters
kosmo integrations:schema datadog.datadog_post_event --json | Parameter | Type | Required | Description |
|---|---|---|---|
title | string | yes | Event title. |
text | string | yes | Event body text. Supports Markdown. |
priority | string | no | Event priority: "normal" or "low". Defaults to "normal". |
tags | array | no | List of tags for the event (e.g., ["env:production", "service:api"]). |
alert_type | string | no | Alert type: "info", "warning", "error", or "success". Defaults to "info". |
date_happened | integer | no | Unix timestamp for when the event occurred. Defaults to now. |
source_type_name | string | no | Source type name (e.g., "my_app"). |
host | string | no | Host name to associate with the event. |
aggregation_key | string | no | Key to group related events together. |
datadog.datadog_get_current_user 0 parameters
kosmo integrations:schema datadog.datadog_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults with
integrations:configure. Add --force only for trusted automation that should bypass that policy.