UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

155 lines (154 loc) 4.64 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Data source for retrieving all SLOs. * * * [Official documentation](https://grafana.com/docs/grafana-cloud/alerting-and-irm/slo/) * * [API documentation](https://grafana.com/docs/grafana-cloud/alerting-and-irm/slo/api/) * * [Additional Information On Alerting Rule Annotations and Labels](https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/#templating/) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const test = new grafana.slo.SLO("test", { * name: "Terraform Testing", * description: "Terraform Description", * queries: [{ * freeform: { * query: "sum(rate(apiserver_request_total{code!=\"500\"}[$__rate_interval])) / sum(rate(apiserver_request_total[$__rate_interval]))", * }, * type: "freeform", * }], * objectives: [{ * value: 0.995, * window: "30d", * }], * destinationDatasource: { * uid: "grafanacloud-prom", * }, * labels: [{ * key: "custom", * value: "value", * }], * alerting: { * fastburn: { * annotations: [{ * key: "name", * value: "Critical - SLO Burn Rate Alert", * }], * labels: [{ * key: "type", * value: "slo", * }], * }, * slowburn: { * annotations: [{ * key: "name", * value: "Warning - SLO Burn Rate Alert", * }], * labels: [{ * key: "type", * value: "slo", * }], * }, * }, * }); * const slos = grafana.slo.getSlos({}); * ``` */ export declare function getSlos(args?: GetSlosArgs, opts?: pulumi.InvokeOptions): Promise<GetSlosResult>; /** * A collection of arguments for invoking getSlos. */ export interface GetSlosArgs { /** * List of all SLOs. */ slos?: inputs.slo.GetSlosSlo[]; } /** * A collection of values returned by getSlos. */ export interface GetSlosResult { /** * The ID of this datasource. This is a constant value. */ readonly id: string; /** * List of all SLOs. */ readonly slos?: outputs.slo.GetSlosSlo[]; } /** * Data source for retrieving all SLOs. * * * [Official documentation](https://grafana.com/docs/grafana-cloud/alerting-and-irm/slo/) * * [API documentation](https://grafana.com/docs/grafana-cloud/alerting-and-irm/slo/api/) * * [Additional Information On Alerting Rule Annotations and Labels](https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/#templating/) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const test = new grafana.slo.SLO("test", { * name: "Terraform Testing", * description: "Terraform Description", * queries: [{ * freeform: { * query: "sum(rate(apiserver_request_total{code!=\"500\"}[$__rate_interval])) / sum(rate(apiserver_request_total[$__rate_interval]))", * }, * type: "freeform", * }], * objectives: [{ * value: 0.995, * window: "30d", * }], * destinationDatasource: { * uid: "grafanacloud-prom", * }, * labels: [{ * key: "custom", * value: "value", * }], * alerting: { * fastburn: { * annotations: [{ * key: "name", * value: "Critical - SLO Burn Rate Alert", * }], * labels: [{ * key: "type", * value: "slo", * }], * }, * slowburn: { * annotations: [{ * key: "name", * value: "Warning - SLO Burn Rate Alert", * }], * labels: [{ * key: "type", * value: "slo", * }], * }, * }, * }); * const slos = grafana.slo.getSlos({}); * ``` */ export declare function getSlosOutput(args?: GetSlosOutputArgs, opts?: pulumi.InvokeOutputOptions): pulumi.Output<GetSlosResult>; /** * A collection of arguments for invoking getSlos. */ export interface GetSlosOutputArgs { /** * List of all SLOs. */ slos?: pulumi.Input<pulumi.Input<inputs.slo.GetSlosSloArgs>[]>; }