diff --git a/public/app/features/alerting/unified/utils/cloud-alertmanager-notifier-types.ts b/public/app/features/alerting/unified/utils/cloud-alertmanager-notifier-types.ts index e8100e9aba9..9c45bac800d 100644 --- a/public/app/features/alerting/unified/utils/cloud-alertmanager-notifier-types.ts +++ b/public/app/features/alerting/unified/utils/cloud-alertmanager-notifier-types.ts @@ -322,8 +322,12 @@ export const cloudNotifierTypes: Array> = [ 'The maximum number of alerts to include in a single webhook message. Alerts above this threshold are truncated. When leaving this at its default value of 0, all alerts are included.', { placeholder: '0', + inputType: 'number', validationRule: '(^\\d+$|^$)', - setValueAs: (value) => (typeof value === 'string' ? parseInt(value, 10) : 0), + setValueAs: (value) => { + const integer = Number(value); + return Number.isFinite(integer) ? integer : 0; + }, } ), httpConfigOption,