import { TemplateVariable } from "./monitor-api-requests"; export interface MonitorParams { name?: string; type?: string; query?: string; message?: string; tags?: string[]; options?: { thresholds?: { critical?: number; [key: string]: unknown; }; [key: string]: unknown; }; [key: string]: unknown; } export type Monitor = Record; export interface ServerlessMonitor { name: string; threshold: number; query: (cloudFormationStackId: string, criticalThreshold: number) => string; message: string; type?: string; templateVariables?: TemplateVariable[]; } export type RecommendedMonitors = Record; /** * Adds the appropriate tags and required parameters that will be passed as part of the request body for creating and updating monitors * @param monitor - the Monitor object that is defined in the serverless.yml file * @param cloudFormationStackId - the CloudFormation stack ID * @param service - the Service * @param env - the Environment * @param recommendedMonitors - recommended monitors * @returns valid monitor parameters */ export declare function buildMonitorParams(monitor: Monitor, cloudFormationStackId: string, service: string, env: string, recommendedMonitors: RecommendedMonitors): MonitorParams; /** * Handles the Monitor API response and logs the appropriate error * @param response Monitor API Response * @param serverlessMonitorId Serverless Monitor ID * @param subdomain Subdomain to use for app URLs, e.g. "app" * @param site Which Datadog site to send data to, e.g. datadoghq.com * @returns true if the response is 200 OK. Throw an error for other HTTP status codes. */ export declare function handleMonitorsApiResponse(response: Response, serverlessMonitorId?: string, subdomain?: string, site?: string): Promise; /** * Creates, updates, and deletes the appropriate monitor configurations as defined in the serverless.yml file * @param subdomain - Subdomain to use for app URLs, e.g. "app" * @param site - Which Datadog site to send data to, e.g. datadoghq.com * @param monitors - Monitors defined in the serverless.yml file * @param monitorsApiKey - the API Key * @param monitorsAppKey - the Application Key * @param cloudFormationStackId - the CloudFormation stack ID * @param service - the Service * @param env - the Environment * @returns Log statements showing the monitors that have been successfully * created, updated, and deleted according to the configuration * defined in the plugin */ export declare function setMonitors(subdomain: string, site: string, monitors: Monitor[], monitorsApiKey: string, monitorsAppKey: string, cloudFormationStackId: string, service: string, env: string): Promise; /** Helper function that replaces the default threshold included in the query string with the new critical threshold configured by the customer * @param query - the query string * @param criticalThreshold - new critical threshold as defined by the customer * @returns the query string where the critical threshold is already replaced */ export declare function replaceCriticalThreshold(query: string, criticalThreshold: number): string; //# sourceMappingURL=monitors.d.ts.map