@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
198 lines (197 loc) • 6.99 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* Manages Knowledge Graph Alert Configurations through Grafana API.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* // Basic alert configuration with silencing
* const prometheusRemoteStorageFailures = new grafana.assert.NotificationAlertsConfig("prometheus_remote_storage_failures", {
* name: "PrometheusRemoteStorageFailures",
* matchLabels: {
* alertname: "PrometheusRemoteStorageFailures",
* alertgroup: "prometheus.alerts",
* asserts_env: "prod",
* },
* silenced: true,
* });
* // High severity alert with specific job and context matching
* const errorBuildupNotify = new grafana.assert.NotificationAlertsConfig("error_buildup_notify", {
* name: "ErrorBuildupNotify",
* matchLabels: {
* alertname: "ErrorBuildup",
* job: "acai",
* asserts_request_type: "inbound",
* asserts_request_context: "/auth",
* },
* silenced: false,
* });
* // Alert with additional labels and custom duration
* const paymentTestAlert = new grafana.assert.NotificationAlertsConfig("payment_test_alert", {
* name: "PaymentTestAlert",
* matchLabels: {
* alertname: "PaymentTestAlert",
* additional_labels: "asserts_severity=~\"critical\"",
* alertgroup: "alex-k8s-integration-test.alerts",
* },
* alertLabels: {
* testing: "onetwothree",
* },
* duration: "5m",
* silenced: false,
* });
* // Latency alert for shipping service
* const highShippingLatency = new grafana.assert.NotificationAlertsConfig("high_shipping_latency", {
* name: "high shipping latency",
* matchLabels: {
* alertname: "LatencyP99ErrorBuildup",
* job: "shipping",
* asserts_request_type: "inbound",
* },
* silenced: false,
* });
* // CPU throttling alert with warning severity
* const cpuThrottlingSustained = new grafana.assert.NotificationAlertsConfig("cpu_throttling_sustained", {
* name: "CPUThrottlingSustained",
* matchLabels: {
* alertname: "CPUThrottlingSustained",
* additional_labels: "asserts_severity=~\"warning\"",
* },
* silenced: true,
* });
* // Ingress error rate alert
* const ingressError = new grafana.assert.NotificationAlertsConfig("ingress_error", {
* name: "ingress error",
* matchLabels: {
* alertname: "ErrorRatioBreach",
* job: "ingress-nginx-controller-metrics",
* asserts_request_type: "inbound",
* },
* silenced: false,
* });
* // MySQL Galera cluster alert
* const mysqlGaleraNotReady = new grafana.assert.NotificationAlertsConfig("mysql_galera_not_ready", {
* name: "MySQLGaleraNotReady",
* matchLabels: {
* alertname: "MySQLGaleraNotReady",
* },
* silenced: false,
* });
* ```
*
* ## Import
*
* ```sh
* terraform import grafana_asserts_notification_alerts_config.name "{{ name }}"
* ```
*/
export declare class NotificationAlertsConfig extends pulumi.CustomResource {
/**
* Get an existing NotificationAlertsConfig 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?: NotificationAlertsConfigState, opts?: pulumi.CustomResourceOptions): NotificationAlertsConfig;
/**
* Returns true if the given object is an instance of NotificationAlertsConfig. 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 NotificationAlertsConfig;
/**
* Labels to add to alerts generated by this configuration.
*/
readonly alertLabels: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Duration for which the condition must be true before firing (e.g., '5m', '30s'). Maps to 'for' in Asserts API.
*/
readonly duration: pulumi.Output<string | undefined>;
/**
* Labels to match for this alert configuration.
*/
readonly matchLabels: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* The name of the alert configuration.
*/
readonly name: pulumi.Output<string>;
/**
* Whether this alert configuration is silenced. Defaults to `false`.
*/
readonly silenced: pulumi.Output<boolean | undefined>;
/**
* Create a NotificationAlertsConfig 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?: NotificationAlertsConfigArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering NotificationAlertsConfig resources.
*/
export interface NotificationAlertsConfigState {
/**
* Labels to add to alerts generated by this configuration.
*/
alertLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Duration for which the condition must be true before firing (e.g., '5m', '30s'). Maps to 'for' in Asserts API.
*/
duration?: pulumi.Input<string>;
/**
* Labels to match for this alert configuration.
*/
matchLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The name of the alert configuration.
*/
name?: pulumi.Input<string>;
/**
* Whether this alert configuration is silenced. Defaults to `false`.
*/
silenced?: pulumi.Input<boolean>;
}
/**
* The set of arguments for constructing a NotificationAlertsConfig resource.
*/
export interface NotificationAlertsConfigArgs {
/**
* Labels to add to alerts generated by this configuration.
*/
alertLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Duration for which the condition must be true before firing (e.g., '5m', '30s'). Maps to 'for' in Asserts API.
*/
duration?: pulumi.Input<string>;
/**
* Labels to match for this alert configuration.
*/
matchLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The name of the alert configuration.
*/
name?: pulumi.Input<string>;
/**
* Whether this alert configuration is silenced. Defaults to `false`.
*/
silenced?: pulumi.Input<boolean>;
}