Skip to content

Commit c798506

Browse files
committed
fix(datadog): stop dropping downtime targeting inputs in the block mapping
create_downtime accepts monitorTags, timezone and muteFirstRecoveryNotification, but the block exposed no inputs for them and never forwarded them. Monitor-tag targeting silently fell back to the `*` tag, so a downtime meant for one team's monitors muted every monitor in scope. Adds the three advanced sub-blocks and wires them through. Also routes list_downtimes' currentOnly through toSwitchBoolean. A switch yields the strings 'true'/'false', and 'false' is truthy, so turning the toggle off still sent current_only=true. Every other switch in the block already used the helper; this was the last raw one.
1 parent 80f8d05 commit c798506

1 file changed

Lines changed: 45 additions & 1 deletion

File tree

apps/sim/blocks/blocks/datadog.ts

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,38 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`,
729729
condition: { field: 'operation', value: 'datadog_create_downtime' },
730730
mode: 'advanced',
731731
},
732+
{
733+
id: 'downtimeMonitorTags',
734+
title: 'Monitor Tags',
735+
type: 'short-input',
736+
placeholder: 'team:backend,priority:high',
737+
condition: { field: 'operation', value: 'datadog_create_downtime' },
738+
mode: 'advanced',
739+
wandConfig: {
740+
enabled: true,
741+
prompt: `Generate a comma-separated list of Datadog monitor tags based on the user's description.
742+
Each tag uses the "key:value" form.
743+
Examples: "team:backend,priority:high", "env:production", "service:checkout"
744+
745+
Return ONLY the comma-separated tag list - no explanations, no extra text.`,
746+
placeholder: 'Describe which monitors to target...',
747+
},
748+
},
749+
{
750+
id: 'downtimeTimezone',
751+
title: 'Timezone',
752+
type: 'short-input',
753+
placeholder: 'UTC or America/New_York',
754+
condition: { field: 'operation', value: 'datadog_create_downtime' },
755+
mode: 'advanced',
756+
},
757+
{
758+
id: 'downtimeMuteFirstRecovery',
759+
title: 'Mute First Recovery Notification',
760+
type: 'switch',
761+
condition: { field: 'operation', value: 'datadog_create_downtime' },
762+
mode: 'advanced',
763+
},
732764

733765
// List Downtimes inputs
734766
{
@@ -1953,10 +1985,13 @@ Return ONLY the search query string - no explanations.`,
19531985
start: params.downtimeStart ? Number(params.downtimeStart) : undefined,
19541986
end: params.downtimeEnd ? Number(params.downtimeEnd) : undefined,
19551987
monitorId: params.downtimeMonitorId,
1988+
monitorTags: params.downtimeMonitorTags || undefined,
1989+
timezone: params.downtimeTimezone || undefined,
1990+
muteFirstRecoveryNotification: toSwitchBoolean(params.downtimeMuteFirstRecovery),
19561991
}
19571992

19581993
case 'datadog_list_downtimes':
1959-
return { ...baseParams, currentOnly: params.currentOnly }
1994+
return { ...baseParams, currentOnly: toSwitchBoolean(params.currentOnly) }
19601995

19611996
case 'datadog_cancel_downtime':
19621997
return { ...baseParams, downtimeId: params.downtimeId }
@@ -2253,6 +2288,15 @@ Return ONLY the search query string - no explanations.`,
22532288
downtimeStart: { type: 'number', description: 'Downtime start time' },
22542289
downtimeEnd: { type: 'number', description: 'Downtime end time' },
22552290
downtimeMonitorId: { type: 'string', description: 'Monitor ID for downtime' },
2291+
downtimeMonitorTags: {
2292+
type: 'string',
2293+
description: 'Comma-separated monitor tags to target',
2294+
},
2295+
downtimeTimezone: { type: 'string', description: 'Display timezone for the downtime' },
2296+
downtimeMuteFirstRecovery: {
2297+
type: 'boolean',
2298+
description: 'Mute the first recovery notification',
2299+
},
22562300
currentOnly: { type: 'boolean', description: 'Filter to current downtimes' },
22572301
downtimeId: { type: 'string', description: 'Downtime ID to cancel' },
22582302
listMonitorName: { type: 'string', description: 'Filter monitors by name' },

0 commit comments

Comments
 (0)