UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

215 lines (214 loc) 7.76 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * An outlier detector monitors the results of a query and reports when its values are outside normal bands. * * The normal band is configured by choice of algorithm, its sensitivity and other configuration. * * Visit https://grafana.com/docs/grafana-cloud/machine-learning/outlier-detection/ for more details. * * ## Example Usage * * ### DBSCAN Outlier Detector * * This outlier detector uses the DBSCAN algorithm to detect outliers. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const myDbscanOutlierDetector = new grafana.machinelearning.OutlierDetector("my_dbscan_outlier_detector", { * name: "My DBSCAN outlier detector", * description: "My DBSCAN Outlier Detector", * metric: "tf_test_dbscan_job", * datasourceType: "prometheus", * datasourceUid: "AbCd12345", * queryParams: { * expr: "grafanacloud_grafana_instance_active_user_count", * }, * interval: 300, * algorithm: { * name: "dbscan", * sensitivity: 0.5, * config: { * epsilon: 1, * }, * }, * }); * ``` * * ### MAD Outlier Detector * * This outlier detector uses the Median Absolute Deviation (MAD) algorithm to detect outliers. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const myMadOutlierDetector = new grafana.machinelearning.OutlierDetector("my_mad_outlier_detector", { * name: "My MAD outlier detector", * description: "My MAD Outlier Detector", * metric: "tf_test_mad_job", * datasourceType: "prometheus", * datasourceUid: "AbCd12345", * queryParams: { * expr: "grafanacloud_grafana_instance_active_user_count", * }, * interval: 300, * algorithm: { * name: "mad", * sensitivity: 0.7, * }, * }); * ``` * * ## Import * * ```sh * $ pulumi import grafana:index/machineLearningOutlierDetector:MachineLearningOutlierDetector name "{{ id }}" * ``` * * @deprecated grafana.index/machinelearningoutlierdetector.MachineLearningOutlierDetector has been deprecated in favor of grafana.machinelearning/outlierdetector.OutlierDetector */ export declare class MachineLearningOutlierDetector extends pulumi.CustomResource { /** * Get an existing MachineLearningOutlierDetector 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?: MachineLearningOutlierDetectorState, opts?: pulumi.CustomResourceOptions): MachineLearningOutlierDetector; /** * Returns true if the given object is an instance of MachineLearningOutlierDetector. 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 MachineLearningOutlierDetector; /** * The algorithm to use and its configuration. See * https://grafana.com/docs/grafana-cloud/machine-learning/outlier-detection/ for details. */ readonly algorithm: pulumi.Output<outputs.MachineLearningOutlierDetectorAlgorithm>; /** * The type of datasource being queried. Currently allowed values are prometheus, graphite, loki, postgres, and datadog. */ readonly datasourceType: pulumi.Output<string>; /** * The uid of the datasource to query. */ readonly datasourceUid: pulumi.Output<string>; /** * A description of the outlier detector. */ readonly description: pulumi.Output<string | undefined>; /** * The data interval in seconds to monitor. */ readonly interval: pulumi.Output<number | undefined>; /** * The metric used to query the outlier detector results. */ readonly metric: pulumi.Output<string>; /** * The name of the outlier detector. */ readonly name: pulumi.Output<string>; /** * An object representing the query params to query Grafana with. */ readonly queryParams: pulumi.Output<{ [key: string]: string; }>; /** * Create a MachineLearningOutlierDetector 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. */ /** @deprecated grafana.index/machinelearningoutlierdetector.MachineLearningOutlierDetector has been deprecated in favor of grafana.machinelearning/outlierdetector.OutlierDetector */ constructor(name: string, args: MachineLearningOutlierDetectorArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering MachineLearningOutlierDetector resources. */ export interface MachineLearningOutlierDetectorState { /** * The algorithm to use and its configuration. See * https://grafana.com/docs/grafana-cloud/machine-learning/outlier-detection/ for details. */ algorithm?: pulumi.Input<inputs.MachineLearningOutlierDetectorAlgorithm>; /** * The type of datasource being queried. Currently allowed values are prometheus, graphite, loki, postgres, and datadog. */ datasourceType?: pulumi.Input<string>; /** * The uid of the datasource to query. */ datasourceUid?: pulumi.Input<string>; /** * A description of the outlier detector. */ description?: pulumi.Input<string>; /** * The data interval in seconds to monitor. */ interval?: pulumi.Input<number>; /** * The metric used to query the outlier detector results. */ metric?: pulumi.Input<string>; /** * The name of the outlier detector. */ name?: pulumi.Input<string>; /** * An object representing the query params to query Grafana with. */ queryParams?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; } /** * The set of arguments for constructing a MachineLearningOutlierDetector resource. */ export interface MachineLearningOutlierDetectorArgs { /** * The algorithm to use and its configuration. See * https://grafana.com/docs/grafana-cloud/machine-learning/outlier-detection/ for details. */ algorithm: pulumi.Input<inputs.MachineLearningOutlierDetectorAlgorithm>; /** * The type of datasource being queried. Currently allowed values are prometheus, graphite, loki, postgres, and datadog. */ datasourceType: pulumi.Input<string>; /** * The uid of the datasource to query. */ datasourceUid: pulumi.Input<string>; /** * A description of the outlier detector. */ description?: pulumi.Input<string>; /** * The data interval in seconds to monitor. */ interval?: pulumi.Input<number>; /** * The metric used to query the outlier detector results. */ metric: pulumi.Input<string>; /** * The name of the outlier detector. */ name?: pulumi.Input<string>; /** * An object representing the query params to query Grafana with. */ queryParams: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; }