Skip to main content
All connectors

Datadog

datadoghq.com

  • MCP servers: use Datadog tools from ChatGPT, Claude and other MCP clients.
  • Tasks: call Datadog from Python in an automation.

About Datadog

Datadog combines infrastructure monitoring, logs, application traces and incident investigation. Connect an API key and scoped application key from the same Datadog site. Both keys are encrypted and selected explicitly for each Task. Available data depends on the account plan, retention and permissions. Use Python Tasks to investigate monitors, dashboards, logs, metrics, events, incidents, hosts, notebooks, spans and software catalog entities. This connector reads data through native REST APIs. Provider writes and hosted MCP access are not included.

Build a Datadog MCP server with qbash

Connect Datadog to qbash, pick tools such as validate credentials, list monitors and get monitor, and publish them on a hosted MCP server.

MCP clients such as ChatGPT, Claude, Claude Code, Codex, Cursor, Grok and Muse Code all connect to the same remote endpoint.

Build Tasks with Datadog

A qbash Task is a Python script that calls Datadog alongside model calls and other connectors. qbash deploys each Task to a managed runtime with version history, run logs and credentials shared across your organization.

Run it on a schedule, call it through an API or webhook, or start it from an MCP client.

Datadog Task SDK methods (20)

Call these from Python with qbash.integrations.datadog.

qbash.integrations.datadog.validate_credentials(...)

Validate the selected API key and application key for this site.

validate_credentials()

Returns

{"api_key_valid": bool, "application_key_valid": bool}

Notes

Requires a valid API key and application key and a key pair from the selected site. Calls both documented validation endpoints and returns only boolean validation results. No automatic retries.

qbash.integrations.datadog.list_monitors(...)

List one page of monitors.

list_monitors(name: str | None = None, tags: str | None = None, monitor_tags: str | None = None, group_states: str | None = None, with_downtimes: bool | None = None, limit: int | None = None, cursor: str | None = None)

Parameters

  • name: str | None = None

    Optional Datadog filter.

  • tags: str | None = None

    Optional Datadog filter.

  • monitor_tags: str | None = None

    Optional Datadog filter.

  • group_states: str | None = None

    Optional Datadog filter.

  • with_downtimes: bool | None = None

    with downtimes.

  • limit: int | None = None

    Page size from 1 to 1000 (incidents: at most 100). Defaults to 50.

  • cursor: str | None = None

    next_cursor from the previous call. Keep the site, filters, time range and limit unchanged.

Returns

{"items": list[dict], "next_cursor": str | None, "meta": dict}

Notes

Requires monitors_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.

qbash.integrations.datadog.get_monitor(...)

Read a monitor definition and its current state.

get_monitor(monitor_id: str, group_states: str | None = None, with_downtimes: bool | None = None, with_assets: bool | None = None)

Parameters

  • monitor_id: strrequired

    Datadog monitor id from the matching list operation.

  • group_states: str | None = None

    Optional Datadog filter.

  • with_downtimes: bool | None = None

    with downtimes.

  • with_assets: bool | None = None

    with assets.

Returns

dict

Notes

Requires monitors_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries.

qbash.integrations.datadog.search_monitors(...)

Search monitors by status, type, tags or name.

search_monitors(query: str | None = None, sort: str | None = None, limit: int | None = None, cursor: str | None = None)

Parameters

  • query: str | None = None

    Optional Datadog filter.

  • sort: str | None = None

    Sort field and direction, such as name,asc.

  • limit: int | None = None

    Page size from 1 to 1000 (incidents: at most 100). Defaults to 50.

  • cursor: str | None = None

    next_cursor from the previous call. Keep the site, filters, time range and limit unchanged.

Returns

{"items": list[dict], "next_cursor": str | None, "meta": dict}

Notes

Requires monitors_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.

qbash.integrations.datadog.list_dashboards(...)

List custom-created or cloned dashboards, excluding preset dashboards.

list_dashboards(limit: int | None = None, cursor: str | None = None)

Parameters

  • limit: int | None = None

    Page size from 1 to 1000 (incidents: at most 100). Defaults to 50.

  • cursor: str | None = None

    next_cursor from the previous call. Keep the site, filters, time range and limit unchanged.

Returns

{"items": list[dict], "next_cursor": str | None, "meta": dict}

Notes

Requires dashboards_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.

qbash.integrations.datadog.get_dashboard(...)

Read a dashboard definition and widgets.

get_dashboard(dashboard_id: str)

Parameters

  • dashboard_id: strrequired

    Datadog dashboard id from the matching list operation.

Returns

dict

Notes

Requires dashboards_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries.

qbash.integrations.datadog.search_logs(...)

Search one page of logs and retain provider warnings about partial results.

search_logs(query: str | None = None, from_: str | None = None, to: str | None = None, sort: str | None = None, indexes: list[str] | None = None, storage_tier: str | None = None, limit: int | None = None, cursor: str | None = None)

Parameters

  • query: str | None = None

    Datadog logs search syntax. Defaults to * at the provider.

  • from_: str | None = None

    Start time: ISO 8601, Unix milliseconds or date math such as now-15m.

  • to: str | None = None

    End time, such as now.

  • sort: str | None = None

    timestamp or -timestamp.

  • indexes: list[str] | None = None

    Indexes to search. Omit for all indexes.

  • storage_tier: str | None = None

    indexes, online-archives or flex. Check the plan before querying another tier.

  • limit: int | None = None

    Page size from 1 to 1000 (incidents: at most 100). Defaults to 50.

  • cursor: str | None = None

    next_cursor from the previous call. Keep the site, filters, time range and limit unchanged.

Returns

{"items": list[dict], "next_cursor": str | None, "meta": dict}

Notes

Requires logs_read_data and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.

qbash.integrations.datadog.aggregate_logs(...)

Compute log counts, statistics or grouped timeseries.

aggregate_logs(query: str | None = None, from_: str | None = None, to: str | None = None, indexes: list[str] | None = None, storage_tier: str | None = None, compute: list[dict], group_by: list[dict] | None = None, cursor: str | None = None)

Parameters

  • query: str | None = None

    Datadog logs search syntax. Defaults to * at the provider.

  • from_: str | None = None

    Start time: ISO 8601, Unix milliseconds or date math such as now-15m.

  • to: str | None = None

    End time, such as now.

  • indexes: list[str] | None = None

    Indexes to search. Omit for all indexes.

  • storage_tier: str | None = None

    indexes, online-archives or flex. Check the plan before querying another tier.

  • compute: list[dict]required

    Aggregations to compute. Each entry requires aggregation.

    • aggregation: strrequired

      count, cardinality, pc75, pc90, pc95, pc98, pc99, sum, min, max, avg or median.

    • metric: str | None = None

      Measure name, required by aggregations other than count.

    • type: str | None = None

      total or timeseries.

    • interval: str | None = None

      Timeseries interval, such as 5m.

  • group_by: list[dict] | None = None

    Optional facet grouping. Each entry requires facet. Combined bucket limits must not exceed 10000.

    • facet: strrequired

      Facet to group by.

    • limit: int | None = None

      Maximum buckets for this facet.

    • sort: dict | None = None

      Provider grouping sort object.

      • aggregation: str | None = None

        Optional Datadog filter.

      • metric: str | None = None

        Optional Datadog filter.

      • order: str | None = None

        asc or desc.

      • type: str | None = None

        alphabetical or measure.

  • cursor: str | None = None

    next_cursor from the previous aggregation. Keep the query and computes unchanged. Logs aggregation can page at most 1000 results.

Returns

{"data": dict | list[dict], "meta": dict | None, "next_cursor": str | None}

Notes

Requires logs_read_data and a key pair from the selected site. Returns the provider aggregation object. next_cursor is copied from meta.page.after. Logs buckets are in data.buckets. Span buckets are in data[]. Retains provider meta, including timeout status and partial-result warnings. A successful response does not guarantee complete results. No automatic retries.

qbash.integrations.datadog.list_metrics(...)

List active metric names since a Unix timestamp in seconds.

list_metrics(from_: int, host: str | None = None, tag_filter: str | None = None)

Parameters

  • from_: intrequired

    Earliest metric submission time, in Unix seconds.

  • host: str | None = None

    Optional Datadog filter.

  • tag_filter: str | None = None

    Tag filter. Cannot be combined with host.

Returns

{"items": list[dict], "next_cursor": str | None, "meta": dict}

Notes

Requires metrics_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.

qbash.integrations.datadog.query_metrics(...)

Query metric timeseries over a time range in Unix seconds.

query_metrics(from_: int, to: int, query: str)

Parameters

  • from_: intrequired

    Start time in Unix seconds.

  • to: intrequired

    End time in Unix seconds.

  • query: strrequired

    Datadog metric query, such as avg:system.cpu.user{*}.

Returns

dict

Notes

Requires timeseries_query and a key pair from the selected site. Provider query object, including series and pointlist. Point timestamps use milliseconds and may have null values. Datadog can choose the rollup interval. Inspect status and series before interpreting empty results. No automatic retries.

qbash.integrations.datadog.list_events(...)

Search one page of events using the v2 Events API.

list_events(query: str | None = None, from_: str | None = None, to: str | None = None, sort: str | None = None, limit: int | None = None, cursor: str | None = None)

Parameters

  • query: str | None = None

    Datadog events search query.

  • from_: str | None = None

    Minimum event timestamp in milliseconds.

  • to: str | None = None

    Maximum event timestamp in milliseconds.

  • sort: str | None = None

    timestamp or -timestamp.

  • limit: int | None = None

    Page size from 1 to 1000 (incidents: at most 100). Defaults to 50.

  • cursor: str | None = None

    next_cursor from the previous call. Keep the site, filters, time range and limit unchanged.

Returns

{"items": list[dict], "next_cursor": str | None, "meta": dict}

Notes

Requires events_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.

qbash.integrations.datadog.get_event(...)

Read one event using its v2 event UID.

get_event(event_id: str)

Parameters

  • event_id: strrequired

    The v2 UID at items[].attributes.attributes.evt.uid from list_events, not the top-level result id.

Returns

dict

Notes

Requires events_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries.

qbash.integrations.datadog.list_incidents(...)

List one page of incidents.

list_incidents(limit: int | None = None, cursor: str | None = None)

Parameters

  • limit: int | None = None

    Page size from 1 to 1000 (incidents: at most 100). Defaults to 50.

  • cursor: str | None = None

    next_cursor from the previous call. Keep the site, filters, time range and limit unchanged.

Returns

{"items": list[dict], "next_cursor": str | None, "meta": dict}

Notes

Requires incident_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.

qbash.integrations.datadog.get_incident(...)

Read an incident by UUID.

get_incident(incident_id: str)

Parameters

  • incident_id: strrequired

    Datadog incident id from the matching list operation.

Returns

dict

Notes

Requires incident_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries.

qbash.integrations.datadog.list_hosts(...)

List hosts matching a Datadog host filter.

list_hosts(filter: str | None = None, sort_field: str | None = None, sort_dir: str | None = None, from_: int | None = None, include_muted_hosts_data: bool | None = None, include_hosts_metadata: bool | None = None, limit: int | None = None, cursor: str | None = None)

Parameters

  • filter: str | None = None

    Optional Datadog filter.

  • sort_field: str | None = None

    Optional Datadog filter.

  • sort_dir: str | None = None

    asc or desc.

  • from_: int | None = None

    Earliest host activity, in Unix seconds.

  • include_muted_hosts_data: bool | None = None

    include muted hosts data.

  • include_hosts_metadata: bool | None = None

    include hosts metadata.

  • limit: int | None = None

    Page size from 1 to 1000 (incidents: at most 100). Defaults to 50.

  • cursor: str | None = None

    next_cursor from the previous call. Keep the site, filters, time range and limit unchanged.

Returns

{"items": list[dict], "next_cursor": str | None, "meta": dict}

Notes

Requires hosts_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.

qbash.integrations.datadog.list_notebooks(...)

Find notebooks by name or author.

list_notebooks(query: str | None = None, author_handle: str | None = None, exclude_author_handle: str | None = None, sort_field: str | None = None, sort_dir: str | None = None, include_cells: bool | None = None, is_template: bool | None = None, limit: int | None = None, cursor: str | None = None)

Parameters

  • query: str | None = None

    Optional Datadog filter.

  • author_handle: str | None = None

    Optional Datadog filter.

  • exclude_author_handle: str | None = None

    Optional Datadog filter.

  • sort_field: str | None = None

    modified, name or created.

  • sort_dir: str | None = None

    asc or desc.

  • include_cells: bool | None = None

    include cells.

  • is_template: bool | None = None

    is template.

  • limit: int | None = None

    Page size from 1 to 1000 (incidents: at most 100). Defaults to 50.

  • cursor: str | None = None

    next_cursor from the previous call. Keep the site, filters, time range and limit unchanged.

Returns

{"items": list[dict], "next_cursor": str | None, "meta": dict}

Notes

Requires notebooks_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.

qbash.integrations.datadog.get_notebook(...)

Read a notebook and its cells.

get_notebook(notebook_id: str)

Parameters

  • notebook_id: strrequired

    Datadog notebook id from the matching list operation.

Returns

dict

Notes

Requires notebooks_read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries.

qbash.integrations.datadog.search_spans(...)

Search retained APM spans and retain warnings about partial results.

search_spans(query: str | None = None, from_: str | None = None, to: str | None = None, sort: str | None = None, limit: int | None = None, cursor: str | None = None)

Parameters

  • query: str | None = None

    Datadog spans search syntax. Defaults to * at the provider.

  • from_: str | None = None

    Start time: ISO 8601, Unix milliseconds or date math such as now-15m.

  • to: str | None = None

    End time, such as now.

  • sort: str | None = None

    timestamp or -timestamp.

  • limit: int | None = None

    Page size from 1 to 1000 (incidents: at most 100). Defaults to 50.

  • cursor: str | None = None

    next_cursor from the previous call. Keep the site, filters, time range and limit unchanged.

Returns

{"items": list[dict], "next_cursor": str | None, "meta": dict}

Notes

Requires APM Read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.

qbash.integrations.datadog.aggregate_spans(...)

Compute counts, statistics or grouped timeseries over retained APM spans.

aggregate_spans(query: str | None = None, from_: str | None = None, to: str | None = None, compute: list[dict], group_by: list[dict] | None = None)

Parameters

  • query: str | None = None

    Datadog spans search syntax. Defaults to * at the provider.

  • from_: str | None = None

    Start time: ISO 8601, Unix milliseconds or date math such as now-15m.

  • to: str | None = None

    End time, such as now.

  • compute: list[dict]required

    Aggregations to compute. Each entry requires aggregation.

    • aggregation: strrequired

      count, cardinality, pc75, pc90, pc95, pc98, pc99, sum, min, max, avg or median.

    • metric: str | None = None

      Measure name, required by aggregations other than count.

    • type: str | None = None

      total or timeseries.

    • interval: str | None = None

      Timeseries interval, such as 5m.

  • group_by: list[dict] | None = None

    Optional facet grouping. Each entry requires facet. Combined bucket limits must not exceed 10000.

    • facet: strrequired

      Facet to group by.

    • limit: int | None = None

      Maximum buckets for this facet.

    • sort: dict | None = None

      Provider grouping sort object.

      • aggregation: str | None = None

        Optional Datadog filter.

      • metric: str | None = None

        Optional Datadog filter.

      • order: str | None = None

        asc or desc.

      • type: str | None = None

        alphabetical or measure.

Returns

{"data": dict | list[dict], "meta": dict | None, "next_cursor": str | None}

Notes

Requires apm_read and a key pair from the selected site. Returns the provider aggregation object. Span aggregation has no pagination. next_cursor is always None. Logs buckets are in data.buckets. Span buckets are in data[]. Retains provider meta, including timeout status and partial-result warnings. A successful response does not guarantee complete results. No automatic retries.

qbash.integrations.datadog.list_entities(...)

Find software catalog entities by name, kind, owner or reference.

list_entities(name: str | None = None, kind: str | None = None, owner: str | None = None, ref: str | None = None, include_discovered: bool | None = None, limit: int | None = None, cursor: str | None = None)

Parameters

  • name: str | None = None

    Optional Datadog filter.

  • kind: str | None = None

    Optional Datadog filter.

  • owner: str | None = None

    Optional Datadog filter.

  • ref: str | None = None

    Optional Datadog filter.

  • include_discovered: bool | None = None

    include discovered.

  • limit: int | None = None

    Page size from 1 to 1000 (incidents: at most 100). Defaults to 50.

  • cursor: str | None = None

    next_cursor from the previous call. Keep the site, filters, time range and limit unchanged.

Returns

{"items": list[dict], "next_cursor": str | None, "meta": dict}

Notes

Requires Software Catalog Read and a key pair from the selected site. Returns Datadog's resource object. v2 resources retain the data envelope and attributes. No automatic retries. Returns one page with items, next_cursor and provider meta. Pass next_cursor as cursor until None. Numeric pagination may require a final empty page. Metric names are wrapped as {name: str} and have no pagination. Read meta.status and meta.warnings: timeouts or warnings can mean partial results. No automatic pagination. Retention, indexing and product access limit available data.

Task SDK reference

Connect Datadog to qbash

Sign up, connect your Datadog account, and use its tools across qbash.

Sign up free