UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

237 lines (236 loc) 7.07 kB
import * as pulumi from "@pulumi/pulumi"; /** * ## Example Usage * * ### Forecast Alert * * This alert uses a forecast. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const testAlertJob = new grafana.machinelearning.Job("test_alert_job", { * name: "Test Job", * metric: "tf_test_alert_job", * datasourceType: "prometheus", * datasourceUid: "abcd12345", * queryParams: { * expr: "grafanacloud_grafana_instance_active_user_count", * }, * }); * const testJobAlert = new grafana.machinelearning.Alert("test_job_alert", { * jobId: testAlertJob.id, * title: "Test Alert", * anomalyCondition: "any", * threshold: ">0.8", * window: "15m", * noDataState: "OK", * }); * ``` * * ### Outlier Alert * * This alert uses an outlier detector. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const testAlertOutlierDetector = new grafana.machinelearning.OutlierDetector("test_alert_outlier_detector", { * name: "Test Outlier", * metric: "tf_test_alert_outlier", * datasourceType: "prometheus", * datasourceUid: "AbCd12345", * queryParams: { * expr: "grafanacloud_grafana_instance_active_user_count", * }, * interval: 300, * algorithm: { * name: "dbscan", * sensitivity: 0.5, * config: { * epsilon: 1, * }, * }, * }); * const testOutlierAlert = new grafana.machinelearning.Alert("test_outlier_alert", { * outlierId: testAlertOutlierDetector.id, * title: "Test Alert", * window: "1h", * }); * ``` * * ## Import * * ```sh * terraform import grafana_machine_learning_alert.name "{{ id }}" * ``` */ export declare class Alert extends pulumi.CustomResource { /** * Get an existing Alert resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AlertState, opts?: pulumi.CustomResourceOptions): Alert; /** * Returns true if the given object is an instance of Alert. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Alert; /** * Annotations to add to the alert generated in Grafana. */ readonly annotations: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The condition for when to consider a point as anomalous. */ readonly anomalyCondition: pulumi.Output<string | undefined>; /** * How long values must be anomalous before firing an alert. */ readonly for: pulumi.Output<string>; /** * The forecast this alert belongs to. */ readonly jobId: pulumi.Output<string | undefined>; /** * Labels to add to the alert generated in Grafana. */ readonly labels: pulumi.Output<{ [key: string]: string; } | undefined>; /** * How the alert should be processed when no data is returned by the underlying series */ readonly noDataState: pulumi.Output<string | undefined>; /** * The forecast this alert belongs to. */ readonly outlierId: pulumi.Output<string | undefined>; /** * The threshold of points over the window that need to be anomalous to alert. */ readonly threshold: pulumi.Output<string | undefined>; /** * The title of the alert. */ readonly title: pulumi.Output<string>; /** * How much time to average values over */ readonly window: pulumi.Output<string>; /** * Create a Alert resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: AlertArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Alert resources. */ export interface AlertState { /** * Annotations to add to the alert generated in Grafana. */ annotations?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The condition for when to consider a point as anomalous. */ anomalyCondition?: pulumi.Input<string>; /** * How long values must be anomalous before firing an alert. */ for?: pulumi.Input<string>; /** * The forecast this alert belongs to. */ jobId?: pulumi.Input<string>; /** * Labels to add to the alert generated in Grafana. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * How the alert should be processed when no data is returned by the underlying series */ noDataState?: pulumi.Input<string>; /** * The forecast this alert belongs to. */ outlierId?: pulumi.Input<string>; /** * The threshold of points over the window that need to be anomalous to alert. */ threshold?: pulumi.Input<string>; /** * The title of the alert. */ title?: pulumi.Input<string>; /** * How much time to average values over */ window?: pulumi.Input<string>; } /** * The set of arguments for constructing a Alert resource. */ export interface AlertArgs { /** * Annotations to add to the alert generated in Grafana. */ annotations?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The condition for when to consider a point as anomalous. */ anomalyCondition?: pulumi.Input<string>; /** * How long values must be anomalous before firing an alert. */ for?: pulumi.Input<string>; /** * The forecast this alert belongs to. */ jobId?: pulumi.Input<string>; /** * Labels to add to the alert generated in Grafana. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * How the alert should be processed when no data is returned by the underlying series */ noDataState?: pulumi.Input<string>; /** * The forecast this alert belongs to. */ outlierId?: pulumi.Input<string>; /** * The threshold of points over the window that need to be anomalous to alert. */ threshold?: pulumi.Input<string>; /** * The title of the alert. */ title: pulumi.Input<string>; /** * How much time to average values over */ window?: pulumi.Input<string>; }