KosmoKrator

monitoring

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.

10 functions 6 read 4 write API key auth

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 use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
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

Call Datadog Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call datadog.datadog_list_monitors '{
  "name": "example_name",
  "tags": "example_tags",
  "page": 1,
  "page_size": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:datadog datadog_list_monitors '{
  "name": "example_name",
  "tags": "example_tags",
  "page": 1,
  "page_size": 1
}' --json

Agent Discovery Commands

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

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Datadog.

datadog.datadog_list_monitors

Read read

List Datadog monitors. Optionally filter by name or tags. Returns monitor IDs, names, types, states, and query definitions.

Parameters
name, tags, page, page_size

Generic CLI call

kosmo integrations:call datadog.datadog_list_monitors '{"name":"example_name","tags":"example_tags","page":1,"page_size":1}' --json

Provider shortcut

kosmo integrations:datadog datadog_list_monitors '{"name":"example_name","tags":"example_tags","page":1,"page_size":1}' --json

datadog.datadog_get_monitor

Read read

Get full details of a specific Datadog monitor by ID. Returns the monitor query, thresholds, message, and current state.

Parameters
monitor_id

Generic CLI call

kosmo integrations:call datadog.datadog_get_monitor '{"monitor_id":1}' --json

Provider shortcut

kosmo integrations:datadog datadog_get_monitor '{"monitor_id":1}' --json

datadog.datadog_create_monitor

Write write

Create a new Datadog monitor. Specify the monitor type, query, name, and optional message and thresholds. Common types: "metric alert", "service check", "event alert".

Parameters
type, query, name, message, priority, options, tags

Generic CLI call

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

Provider shortcut

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

Write write

Update an existing Datadog monitor. Provide the monitor ID and the fields to update (name, query, message, options, tags, etc.).

Parameters
monitor_id, type, query, name, message, priority, options, tags

Generic CLI call

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

Provider shortcut

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

Write write

Delete a Datadog monitor by ID. This action is permanent and cannot be undone.

Parameters
monitor_id

Generic CLI call

kosmo integrations:call datadog.datadog_delete_monitor '{"monitor_id":1}' --json

Provider shortcut

kosmo integrations:datadog datadog_delete_monitor '{"monitor_id":1}' --json

datadog.datadog_query_metrics

Read read

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.

Parameters
from, to, query

Generic CLI call

kosmo integrations:call datadog.datadog_query_metrics '{"from":1,"to":1,"query":"example_query"}' --json

Provider shortcut

kosmo integrations:datadog datadog_query_metrics '{"from":1,"to":1,"query":"example_query"}' --json

datadog.datadog_list_dashboards

Read read

List all Datadog dashboards. Returns dashboard IDs, titles, descriptions, and modification dates.

Parameters
none

Generic CLI call

kosmo integrations:call datadog.datadog_list_dashboards '{}' --json

Provider shortcut

kosmo integrations:datadog datadog_list_dashboards '{}' --json

datadog.datadog_get_dashboard

Read read

Get full details of a specific Datadog dashboard by ID. Returns the dashboard layout, widgets, and template variables.

Parameters
dashboard_id

Generic CLI call

kosmo integrations:call datadog.datadog_get_dashboard '{"dashboard_id":"example_dashboard_id"}' --json

Provider shortcut

kosmo integrations:datadog datadog_get_dashboard '{"dashboard_id":"example_dashboard_id"}' --json

datadog.datadog_post_event

Write write

Post an event to the Datadog event stream. Specify title, text, priority, tags, and alert type. Events appear in the event timeline.

Parameters
title, text, priority, tags, alert_type, date_happened, source_type_name, host, aggregation_key

Generic CLI call

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

Provider shortcut

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

Read read

Get the currently authenticated Datadog user. Useful for verifying credentials and identifying the connected account.

Parameters
none

Generic CLI call

kosmo integrations:call datadog.datadog_get_current_user '{}' --json

Provider shortcut

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

List Datadog monitors. Optionally filter by name or tags. Returns monitor IDs, names, types, states, and query definitions.

Operation
Read read
Schema command
kosmo integrations:schema datadog.datadog_list_monitors --json
ParameterTypeRequiredDescription
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

Get full details of a specific Datadog monitor by ID. Returns the monitor query, thresholds, message, and current state.

Operation
Read read
Schema command
kosmo integrations:schema datadog.datadog_get_monitor --json
ParameterTypeRequiredDescription
monitor_id integer yes The ID of the monitor to retrieve.

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".

Operation
Write write
Schema command
kosmo integrations:schema datadog.datadog_create_monitor --json
ParameterTypeRequiredDescription
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

Update an existing Datadog monitor. Provide the monitor ID and the fields to update (name, query, message, options, tags, etc.).

Operation
Write write
Schema command
kosmo integrations:schema datadog.datadog_update_monitor --json
ParameterTypeRequiredDescription
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

Delete a Datadog monitor by ID. This action is permanent and cannot be undone.

Operation
Write write
Schema command
kosmo integrations:schema datadog.datadog_delete_monitor --json
ParameterTypeRequiredDescription
monitor_id integer yes The ID of the monitor to delete.

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.

Operation
Read read
Schema command
kosmo integrations:schema datadog.datadog_query_metrics --json
ParameterTypeRequiredDescription
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

List all Datadog dashboards. Returns dashboard IDs, titles, descriptions, and modification dates.

Operation
Read read
Schema command
kosmo integrations:schema datadog.datadog_list_dashboards --json
ParameterTypeRequiredDescription
No parameters.

datadog.datadog_get_dashboard

Get full details of a specific Datadog dashboard by ID. Returns the dashboard layout, widgets, and template variables.

Operation
Read read
Schema command
kosmo integrations:schema datadog.datadog_get_dashboard --json
ParameterTypeRequiredDescription
dashboard_id string yes The ID of the dashboard to retrieve.

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.

Operation
Write write
Schema command
kosmo integrations:schema datadog.datadog_post_event --json
ParameterTypeRequiredDescription
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

Get the currently authenticated Datadog user. Useful for verifying credentials and identifying the connected account.

Operation
Read read
Schema command
kosmo integrations:schema datadog.datadog_get_current_user --json
ParameterTypeRequiredDescription
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.