Datadog monitors List
Certified
List Datadog monitors
Datadog monitors List
List Datadog monitors
Lists the monitors of the organization, with their overall_state and filters them by name, tag or group state. Needs the API key and an application key with the monitors_read scope.
The monitors are read page by page until maxMonitors are collected or Datadog has no more. The filters are applied by Datadog, so groupStates selects the monitors that have a group in one of those states, which is not always the overall_state of the monitor: check overall_state in the output when it matters.
type: io.kestra.plugin.datadog.monitors.ListExamples
Check that no production monitor is in alert before a deployment
id: datadog_pre_deploy_check
namespace: company.observability
tasks:
- id: alerting
type: io.kestra.plugin.datadog.monitors.List
apiKey: "{{ secret('DATADOG_API_KEY') }}"
appKey: "{{ secret('DATADOG_APP_KEY') }}"
monitorTags:
- "env:prod"
groupStates:
- alert
- id: gate
type: io.kestra.plugin.core.execution.Assert
errorMessage: "{{ outputs.alerting.size }} production monitor(s) are in alert"
conditions:
- "{{ outputs.alerting.size == 0 }}"
Installation
Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:
kestractl plugins get io.kestra.plugin:plugin-datadog --compatible-for $KESTRA_VERSION For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.
Properties
apiKey *string
Datadog API key
The organization API key. Use a Kestra secret, e.g. {{ secret('DATADOG_API_KEY') }}.
apiUrl string
API base URL
Replaces https://api.<site> when set, for a proxy, a private link or a test server. Leave it empty for the public API. logs.Send does not use it: it calls the log intake, which has its own address (intakeUrl).
appKey string
Datadog application key
An application key. Datadog asks for it on every call that reads data or manages monitors and downtimes, so the tasks that only send data (events.Create, metrics.Submit, logs.Send) work without it. Create it with the scopes the task needs. Use a Kestra secret, e.g. {{ secret('DATADOG_APP_KEY') }}.
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150fetchType string
FETCHSTOREFETCHFETCH_ONENONEHow to return the monitors
FETCH returns all the monitors in the output, FETCH_ONE the first one only, STORE writes them to internal storage as an Ion file and returns its uri, NONE returns only size. Use STORE for a large result: the output of a task is kept in the execution.
groupStates array
Group states filter
Returns the monitors that have a group in one of these states: alert, warn, no data or ok.
maxMonitors integerstring
1000Maximum number of monitors
Stops after this many monitors, between 1 and 10000.
monitorTags array
Monitor tags filter
Returns the monitors that carry all these monitor tags (the tags in the monitor definition, not the ones that come from the scope), for example env: prod.
name string
Name filter
Returns the monitors whose name contains this text.
site string
Datadog site
The Datadog site of the organization, the domain you see in the Datadog URL: datadoghq.com (US1, the default), us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com or ddog-gov.com. A key only works on the site of the organization that created it.
Outputs
monitors array
Monitors
With FETCH, the monitors as Datadog returns them: id, name, type, query, overall_state, overall_state_modified, tags, message and options.
row object
First monitor
With FETCH_ONE, the first monitor.
size integer
Number of monitors
The number of monitors found, whatever the fetchType.
uri string
uriInternal storage URI
With STORE, the Ion file that holds the monitors, one per line.