UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

217 lines (216 loc) 8.01 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages [Grafana Cloud Alert Enrichment](https://grafana.com/docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/alert-enrichment/). * * Alert enrichment is currently in public preview. Grafana Labs offers limited support, and breaking changes might occur prior to the feature being made generally available. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const enrichment = new grafana.alerting.v1beta1.AlertEnrichment("enrichment", { * metadata: { * uid: "test_enrichment", * }, * spec: { * title: "Comprehensive alert enrichment", * description: "Demonstrates many enrichment steps and configurations", * alertRuleUids: [ * "alert-rule-1", * "alert-rule-2", * ], * receivers: [ * "webhook", * "slack-critical", * ], * labelMatchers: [ * { * type: "=", * name: "severity", * value: "critical", * }, * { * type: "=~", * name: "team", * value: "alerting|alerting-team", * }, * ], * annotationMatchers: [{ * type: "!=", * name: "runbook_url", * value: "", * }], * steps: [ * { * assign: { * timeout: "30s", * annotations: { * priority: "high", * runbook_url: "https://runbooks.grafana.com/alert-handling", * }, * }, * }, * { * external: { * url: "https://some-api.grafana.com/alert-enrichment", * }, * }, * { * dataSource: { * timeout: "30s", * logsQuery: { * dataSourceType: "loki", * dataSourceUid: "loki-uid-123", * expr: "{job=\"my-app\"} |= \"error\"", * maxLines: 5, * }, * }, * }, * { * dataSource: { * timeout: "30s", * rawQuery: { * refId: "A", * request: JSON.stringify({ * datasource: { * type: "prometheus", * uid: "prometheus-uid-456", * }, * expr: "rate(http_requests_total[5m])", * refId: "A", * intervalMs: 1000, * maxDataPoints: 43200, * }), * }, * }, * }, * { * sift: {}, * }, * { * explain: { * annotation: "ai_explanation", * }, * }, * { * assistantInvestigations: {}, * }, * { * conditional: { * "if": { * labelMatchers: [{ * type: "=", * name: "severity", * value: "critical", * }], * }, * then: { * steps: [ * { * assign: { * annotations: { * escalation_level: "immediate", * }, * }, * }, * { * external: { * url: "https://irm.grafana.com/create-incident", * }, * }, * ], * }, * "else": { * steps: [{ * assign: { * annotations: { * escalation_level: "standard", * }, * }, * }], * }, * }, * }, * ], * }, * }); * ``` * * @deprecated grafana.alerting/alertenrichment.AlertEnrichment has been deprecated in favor of grafana.alerting/v1beta1/alertenrichment.AlertEnrichment */ export declare class AlertEnrichment extends pulumi.CustomResource { /** * Get an existing AlertEnrichment 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?: AlertEnrichmentState, opts?: pulumi.CustomResourceOptions): AlertEnrichment; /** * Returns true if the given object is an instance of AlertEnrichment. 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 AlertEnrichment; /** * The metadata of the resource. */ readonly metadata: pulumi.Output<outputs.alerting.AlertEnrichmentMetadata | undefined>; /** * Options for applying the resource. */ readonly options: pulumi.Output<outputs.alerting.AlertEnrichmentOptions | undefined>; /** * The spec of the resource. */ readonly spec: pulumi.Output<outputs.alerting.AlertEnrichmentSpec | undefined>; /** * Create a AlertEnrichment 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.alerting/alertenrichment.AlertEnrichment has been deprecated in favor of grafana.alerting/v1beta1/alertenrichment.AlertEnrichment */ constructor(name: string, args?: AlertEnrichmentArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering AlertEnrichment resources. */ export interface AlertEnrichmentState { /** * The metadata of the resource. */ metadata?: pulumi.Input<inputs.alerting.AlertEnrichmentMetadata>; /** * Options for applying the resource. */ options?: pulumi.Input<inputs.alerting.AlertEnrichmentOptions>; /** * The spec of the resource. */ spec?: pulumi.Input<inputs.alerting.AlertEnrichmentSpec>; } /** * The set of arguments for constructing a AlertEnrichment resource. */ export interface AlertEnrichmentArgs { /** * The metadata of the resource. */ metadata?: pulumi.Input<inputs.alerting.AlertEnrichmentMetadata>; /** * Options for applying the resource. */ options?: pulumi.Input<inputs.alerting.AlertEnrichmentOptions>; /** * The spec of the resource. */ spec?: pulumi.Input<inputs.alerting.AlertEnrichmentSpec>; }