arazzo: 1.0.1
info:
title: Datadog Cleanup Stale Monitors
summary: List monitors by tag, then delete a matched stale monitor.
description: >-
A housekeeping pattern for retiring obsolete Datadog monitors. The workflow
lists monitors filtered by name and tags to identify a stale candidate,
then permanently deletes the first match, optionally forcing deletion even
when the monitor is referenced by SLOs or composite monitors. Every step
spells out its request inline so the flow can be read and executed without
opening the underlying OpenAPI description.
version: 1.0.0
x-realizes-capability-ids:
- BC-4220.20
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-4220.20
capability_name: Observability Management
spec: datadog-monitors-api-openapi.yml
confidence: 0.85
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: monitorsApi
url: ../openapi/datadog-monitors-api-openapi.yml
type: openapi
workflows:
- workflowId: cleanup-stale-monitors
summary: List monitors by tag then delete a matched stale one.
description: >-
Searches monitors using name and tag filters and then permanently deletes
the first matched monitor, optionally forcing the deletion.
inputs:
type: object
required:
- tags
properties:
name:
type: string
description: Filter monitors by name substring match.
tags:
type: string
description: Comma-separated list of tags to filter monitors by (e.g. team:retired).
force:
type: string
description: When set, forcefully deletes the monitor even if referenced by SLOs.
steps:
- stepId: listMonitors
description: >-
List monitors filtered by name and tags to identify the stale monitor
that should be retired.
operationId: listMonitors
parameters:
- name: name
in: query
value: $inputs.name
- name: tags
in: query
value: $inputs.tags
- name: page_size
in: query
value: 100
successCriteria:
- condition: $statusCode == 200
outputs:
staleMonitorId: $response.body#/0/id
staleMonitorName: $response.body#/0/name
- stepId: deleteMonitor
description: >-
Permanently delete the first matched stale monitor, optionally forcing
deletion when it is referenced by SLOs or composite monitors.
operationId: deleteMonitor
parameters:
- name: monitor_id
in: path
value: $steps.listMonitors.outputs.staleMonitorId
- name: force
in: query
value: $inputs.force
successCriteria:
- condition: $statusCode == 200
outputs:
deletedMonitorId: $response.body#/deleted_monitor_id
outputs:
deletedMonitorId: $steps.deleteMonitor.outputs.deletedMonitorId
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.