@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
209 lines (208 loc) • 8.37 kB
TypeScript
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
* terraform import grafana_machine_learning_outlier_detector.name "{{ id }}"
* ```
*/
export declare class OutlierDetector extends pulumi.CustomResource {
/**
* Get an existing OutlierDetector 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?: OutlierDetectorState, opts?: pulumi.CustomResourceOptions): OutlierDetector;
/**
* Returns true if the given object is an instance of OutlierDetector. 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 OutlierDetector;
/**
* 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.machineLearning.OutlierDetectorAlgorithm>;
/**
* The type of datasource being queried. Currently allowed values are prometheus, grafana-prometheus-datasource, grafana-amazonprometheus-datasource, loki, grafana-loki-datasource, graphite, grafana-graphite-datasource, grafana-datadog-datasource, postgres, grafana-postgresql-datasource, doitintl-bigquery-datasource, grafana-bigquery-datasource, grafana-snowflake-datasource, influxdb, grafana-influxdb-datasource, grafana-splunk-datasource, elasticsearch, grafana-elasticsearch-datasource, and grafana-mongodb-datasource.
*/
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 OutlierDetector 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: OutlierDetectorArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering OutlierDetector resources.
*/
export interface OutlierDetectorState {
/**
* The algorithm to use and its configuration. See https://grafana.com/docs/grafana-cloud/machine-learning/outlier-detection/ for details.
*/
algorithm?: pulumi.Input<inputs.machineLearning.OutlierDetectorAlgorithm>;
/**
* The type of datasource being queried. Currently allowed values are prometheus, grafana-prometheus-datasource, grafana-amazonprometheus-datasource, loki, grafana-loki-datasource, graphite, grafana-graphite-datasource, grafana-datadog-datasource, postgres, grafana-postgresql-datasource, doitintl-bigquery-datasource, grafana-bigquery-datasource, grafana-snowflake-datasource, influxdb, grafana-influxdb-datasource, grafana-splunk-datasource, elasticsearch, grafana-elasticsearch-datasource, and grafana-mongodb-datasource.
*/
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 OutlierDetector resource.
*/
export interface OutlierDetectorArgs {
/**
* The algorithm to use and its configuration. See https://grafana.com/docs/grafana-cloud/machine-learning/outlier-detection/ for details.
*/
algorithm: pulumi.Input<inputs.machineLearning.OutlierDetectorAlgorithm>;
/**
* The type of datasource being queried. Currently allowed values are prometheus, grafana-prometheus-datasource, grafana-amazonprometheus-datasource, loki, grafana-loki-datasource, graphite, grafana-graphite-datasource, grafana-datadog-datasource, postgres, grafana-postgresql-datasource, doitintl-bigquery-datasource, grafana-bigquery-datasource, grafana-snowflake-datasource, influxdb, grafana-influxdb-datasource, grafana-splunk-datasource, elasticsearch, grafana-elasticsearch-datasource, and grafana-mongodb-datasource.
*/
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>;
}>;
}