import { Region } from '../index.js'; import { AlertChannel, AlertChannelRef } from './alert-channel.js'; import { AlertEscalation } from './alert-escalation-policy.js'; import { CheckGroupRef } from './check-group-ref.js'; import { CheckGroupV1 } from './check-group-v1.js'; import { CheckGroupV2 } from './check-group-v2.js'; import { Frequency } from './frequency.js'; import { IncidentTrigger } from './incident.js'; import { PrivateLocation, PrivateLocationRef } from './private-location.js'; import { ExponentialRetryStrategy, FixedRetryStrategy, LinearRetryStrategy, NoRetriesRetryStrategy, SingleRetryRetryStrategy } from './retry-strategy.js'; import { Check, CheckProps, CheckRetryStrategy } from './check.js'; import { Diagnostics } from './diagnostics.js'; /** * Retry strategies supported by monitors. */ export type MonitorRetryStrategy = LinearRetryStrategy | ExponentialRetryStrategy | FixedRetryStrategy | SingleRetryRetryStrategy | NoRetriesRetryStrategy; export interface MonitorProps extends CheckProps { /** * The name of the monitor. */ name: string; /** * Determines whether the monitor will run periodically or not after being deployed. */ activated?: boolean; /** * Determines if any notifications will be sent out when a check fails and/or recovers. */ muted?: boolean; /** * An array of one or more data center locations where to run this monitor. */ locations?: (keyof Region)[]; /** * An array of one or more private locations where to run the check. * PrivateLocation instances or slug name strings are allowed. * * `string` slug names are **only** allowed for private locations that do * **not** belong to the project. Use PrivateLocation instances for private * locations created within the project. */ privateLocations?: (string | PrivateLocation | PrivateLocationRef)[]; /** * Tags for organizing and filtering checks. */ tags?: string[]; /** * How often the check should run in minutes. */ frequency?: number | Frequency; /** * The CheckGroup that this monitor is part of. * * Note that despite their name, CheckGroups can also contain monitors. */ group?: CheckGroupV1 | CheckGroupV2 | CheckGroupRef; /** * List of alert channels to notify when the monitor fails or recovers. * If you don't set at least one, we won't be able to alert you. * * See https://www.checklyhq.com/docs/alerting-and-retries/alert-channels/#alert-channels * to learn more about alert channels. */ alertChannels?: (AlertChannel | AlertChannelRef)[]; /** * Determines the alert escalation policy for the monitor. */ alertEscalationPolicy?: AlertEscalation; /** * Determines whether the monitor is deployable. * * When `true`, the monitor will not be deployed, otherwise, the monitor * will be deployed. */ testOnly?: boolean; /** * Sets a retry policy for the monitor. Use RetryStrategyBuilder to create a * suitable retry strategy. * * If neither the monitor nor a project or group default sets one, the * monitor does not retry. * * @example * ```typescript * // Single retry * RetryStrategyBuilder.singleRetry() * * // No retries * RetryStrategyBuilder.noRetries() * ``` */ retryStrategy?: MonitorRetryStrategy; /** * Determines whether the monitor should create and resolve an incident * based on its alert configuration. * * See https://www.checklyhq.com/docs/communicate/status-pages/incidents/#incident-automation * to learn more about automated incidents. */ triggerIncident?: IncidentTrigger; } export declare abstract class Monitor extends Check { constructor(logicalId: string, props: MonitorProps); protected validateDoubleCheck(diagnostics: Diagnostics): Promise; protected defaultRetryStrategy(): CheckRetryStrategy; }