Grafana v0.5.1 published on Wednesday, Jun 12, 2024 by pulumiverse
grafana.getSlos
Explore with Pulumi AI
Datasource for retrieving all SLOs.
- Official documentation
- API documentation
- Additional Information On Alerting Rule Annotations and Labels
Example Usage
Coming soon!
Coming soon!
Coming soon!
Coming soon!
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.SLO;
import com.pulumi.grafana.SLOArgs;
import com.pulumi.grafana.inputs.SLOAlertingArgs;
import com.pulumi.grafana.inputs.SLODestinationDatasourceArgs;
import com.pulumi.grafana.inputs.SLOLabelArgs;
import com.pulumi.grafana.inputs.SLOObjectiveArgs;
import com.pulumi.grafana.inputs.SLOQueryArgs;
import com.pulumi.grafana.inputs.SLOQueryFreeformArgs;
import com.pulumi.grafana.GrafanaFunctions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var test = new SLO("test", SLOArgs.builder()
.alertings(SLOAlertingArgs.builder()
.fastburns(SLOAlertingFastburnArgs.builder()
.annotation(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.label(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build())
.slowburns(SLOAlertingSlowburnArgs.builder()
.annotation(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.label(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
.build())
.build())
.description("Terraform Description")
.destinationDatasource(SLODestinationDatasourceArgs.builder()
.uid("grafanacloud-prom")
.build())
.labels(SLOLabelArgs.builder()
.key("custom")
.value("value")
.build())
.objectives(SLOObjectiveArgs.builder()
.value(0.995)
.window("30d")
.build())
.queries(SLOQueryArgs.builder()
.freeform(SLOQueryFreeformArgs.builder()
.query("sum(rate(apiserver_request_total{code!=\"500\"}[$__rate_interval])) / sum(rate(apiserver_request_total[$__rate_interval]))")
.build())
.type("freeform")
.build())
.build());
final var slos = GrafanaFunctions.getSlos();
}
}
resources:
test:
type: grafana:SLO
properties:
alertings:
- fastburns:
- annotation:
- key: name
value: Critical - SLO Burn Rate Alert
label:
- key: type
value: slo
slowburns:
- annotation:
- key: name
value: Warning - SLO Burn Rate Alert
label:
- key: type
value: slo
description: Terraform Description
destinationDatasource:
uid: grafanacloud-prom
labels:
- key: custom
value: value
objectives:
- value: 0.995
window: 30d
queries:
- freeform:
query: sum(rate(apiserver_request_total{code!="500"}[$__rate_interval])) / sum(rate(apiserver_request_total[$__rate_interval]))
type: freeform
variables:
slos:
fn::invoke:
Function: grafana:getSlos
Arguments: {}
Using getSlos
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getSlos(opts?: InvokeOptions): Promise<GetSlosResult>
function getSlosOutput(opts?: InvokeOptions): Output<GetSlosResult>
def get_slos(opts: Optional[InvokeOptions] = None) -> GetSlosResult
def get_slos_output(opts: Optional[InvokeOptions] = None) -> Output[GetSlosResult]
func GetSlos(ctx *Context, opts ...InvokeOption) (*GetSlosResult, error)
func GetSlosOutput(ctx *Context, opts ...InvokeOption) GetSlosResultOutput
> Note: This function is named GetSlos
in the Go SDK.
public static class GetSlos
{
public static Task<GetSlosResult> InvokeAsync(InvokeOptions? opts = null)
public static Output<GetSlosResult> Invoke(InvokeOptions? opts = null)
}
public static CompletableFuture<GetSlosResult> getSlos(InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: grafana:index/getSlos:getSlos
arguments:
# arguments dictionary
getSlos Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Slos
List<Pulumiverse.
Grafana. Outputs. Get Slos Slo> - Returns a list of all SLOs"
- Id string
- The provider-assigned unique ID for this managed resource.
- Slos
[]Get
Slos Slo - Returns a list of all SLOs"
- id String
- The provider-assigned unique ID for this managed resource.
- slos
List<Get
Slos Slo> - Returns a list of all SLOs"
- id string
- The provider-assigned unique ID for this managed resource.
- slos
Get
Slos Slo[] - Returns a list of all SLOs"
- id str
- The provider-assigned unique ID for this managed resource.
- slos
Sequence[Get
Slos Slo] - Returns a list of all SLOs"
- id String
- The provider-assigned unique ID for this managed resource.
- slos List<Property Map>
- Returns a list of all SLOs"
Supporting Types
GetSlosSlo
- Alertings
List<Pulumiverse.
Grafana. Inputs. Get Slos Slo Alerting> - Configures the alerting rules that will be generated for each time window associated with the SLO. Grafana SLOs can generate alerts when the short-term error budget burn is very high, the long-term error budget burn rate is high, or when the remaining error budget is below a certain threshold. Annotations and Labels support templating.
- Description string
- Description is a free-text field that can provide more context to an SLO.
- Destination
Datasources List<Pulumiverse.Grafana. Inputs. Get Slos Slo Destination Datasource> - Destination Datasource sets the datasource defined for an SLO
- Labels
List<Pulumiverse.
Grafana. Inputs. Get Slos Slo Label> - Additional labels that will be attached to all metrics generated from the query. These labels are useful for grouping SLOs in dashboard views that you create by hand. Labels must adhere to Prometheus label name schema - "^[a-zA-Z_][a-zA-Z0-9_]*$"
- Name string
- Name should be a short description of your indicator. Consider names like "API Availability"
- Objectives
List<Pulumiverse.
Grafana. Inputs. Get Slos Slo Objective> - Over each rolling time window, the remaining error budget will be calculated, and separate alerts can be generated for each time window based on the SLO burn rate or remaining error budget.
- Queries
List<Pulumiverse.
Grafana. Inputs. Get Slos Slo Query> - Query describes the indicator that will be measured against the objective. Freeform Query types are currently supported.
- Uuid string
- A unique, random identifier. This value will also be the name of the resource stored in the API server. This value is read-only.
- Alertings
[]Get
Slos Slo Alerting - Configures the alerting rules that will be generated for each time window associated with the SLO. Grafana SLOs can generate alerts when the short-term error budget burn is very high, the long-term error budget burn rate is high, or when the remaining error budget is below a certain threshold. Annotations and Labels support templating.
- Description string
- Description is a free-text field that can provide more context to an SLO.
- Destination
Datasources []GetSlos Slo Destination Datasource - Destination Datasource sets the datasource defined for an SLO
- Labels
[]Get
Slos Slo Label - Additional labels that will be attached to all metrics generated from the query. These labels are useful for grouping SLOs in dashboard views that you create by hand. Labels must adhere to Prometheus label name schema - "^[a-zA-Z_][a-zA-Z0-9_]*$"
- Name string
- Name should be a short description of your indicator. Consider names like "API Availability"
- Objectives
[]Get
Slos Slo Objective - Over each rolling time window, the remaining error budget will be calculated, and separate alerts can be generated for each time window based on the SLO burn rate or remaining error budget.
- Queries
[]Get
Slos Slo Query - Query describes the indicator that will be measured against the objective. Freeform Query types are currently supported.
- Uuid string
- A unique, random identifier. This value will also be the name of the resource stored in the API server. This value is read-only.
- alertings
List<Get
Slos Slo Alerting> - Configures the alerting rules that will be generated for each time window associated with the SLO. Grafana SLOs can generate alerts when the short-term error budget burn is very high, the long-term error budget burn rate is high, or when the remaining error budget is below a certain threshold. Annotations and Labels support templating.
- description String
- Description is a free-text field that can provide more context to an SLO.
- destination
Datasources List<GetSlos Slo Destination Datasource> - Destination Datasource sets the datasource defined for an SLO
- labels
List<Get
Slos Slo Label> - Additional labels that will be attached to all metrics generated from the query. These labels are useful for grouping SLOs in dashboard views that you create by hand. Labels must adhere to Prometheus label name schema - "^[a-zA-Z_][a-zA-Z0-9_]*$"
- name String
- Name should be a short description of your indicator. Consider names like "API Availability"
- objectives
List<Get
Slos Slo Objective> - Over each rolling time window, the remaining error budget will be calculated, and separate alerts can be generated for each time window based on the SLO burn rate or remaining error budget.
- queries
List<Get
Slos Slo Query> - Query describes the indicator that will be measured against the objective. Freeform Query types are currently supported.
- uuid String
- A unique, random identifier. This value will also be the name of the resource stored in the API server. This value is read-only.
- alertings
Get
Slos Slo Alerting[] - Configures the alerting rules that will be generated for each time window associated with the SLO. Grafana SLOs can generate alerts when the short-term error budget burn is very high, the long-term error budget burn rate is high, or when the remaining error budget is below a certain threshold. Annotations and Labels support templating.
- description string
- Description is a free-text field that can provide more context to an SLO.
- destination
Datasources GetSlos Slo Destination Datasource[] - Destination Datasource sets the datasource defined for an SLO
- labels
Get
Slos Slo Label[] - Additional labels that will be attached to all metrics generated from the query. These labels are useful for grouping SLOs in dashboard views that you create by hand. Labels must adhere to Prometheus label name schema - "^[a-zA-Z_][a-zA-Z0-9_]*$"
- name string
- Name should be a short description of your indicator. Consider names like "API Availability"
- objectives
Get
Slos Slo Objective[] - Over each rolling time window, the remaining error budget will be calculated, and separate alerts can be generated for each time window based on the SLO burn rate or remaining error budget.
- queries
Get
Slos Slo Query[] - Query describes the indicator that will be measured against the objective. Freeform Query types are currently supported.
- uuid string
- A unique, random identifier. This value will also be the name of the resource stored in the API server. This value is read-only.
- alertings
Sequence[Get
Slos Slo Alerting] - Configures the alerting rules that will be generated for each time window associated with the SLO. Grafana SLOs can generate alerts when the short-term error budget burn is very high, the long-term error budget burn rate is high, or when the remaining error budget is below a certain threshold. Annotations and Labels support templating.
- description str
- Description is a free-text field that can provide more context to an SLO.
- destination_
datasources Sequence[GetSlos Slo Destination Datasource] - Destination Datasource sets the datasource defined for an SLO
- labels
Sequence[Get
Slos Slo Label] - Additional labels that will be attached to all metrics generated from the query. These labels are useful for grouping SLOs in dashboard views that you create by hand. Labels must adhere to Prometheus label name schema - "^[a-zA-Z_][a-zA-Z0-9_]*$"
- name str
- Name should be a short description of your indicator. Consider names like "API Availability"
- objectives
Sequence[Get
Slos Slo Objective] - Over each rolling time window, the remaining error budget will be calculated, and separate alerts can be generated for each time window based on the SLO burn rate or remaining error budget.
- queries
Sequence[Get
Slos Slo Query] - Query describes the indicator that will be measured against the objective. Freeform Query types are currently supported.
- uuid str
- A unique, random identifier. This value will also be the name of the resource stored in the API server. This value is read-only.
- alertings List<Property Map>
- Configures the alerting rules that will be generated for each time window associated with the SLO. Grafana SLOs can generate alerts when the short-term error budget burn is very high, the long-term error budget burn rate is high, or when the remaining error budget is below a certain threshold. Annotations and Labels support templating.
- description String
- Description is a free-text field that can provide more context to an SLO.
- destination
Datasources List<Property Map> - Destination Datasource sets the datasource defined for an SLO
- labels List<Property Map>
- Additional labels that will be attached to all metrics generated from the query. These labels are useful for grouping SLOs in dashboard views that you create by hand. Labels must adhere to Prometheus label name schema - "^[a-zA-Z_][a-zA-Z0-9_]*$"
- name String
- Name should be a short description of your indicator. Consider names like "API Availability"
- objectives List<Property Map>
- Over each rolling time window, the remaining error budget will be calculated, and separate alerts can be generated for each time window based on the SLO burn rate or remaining error budget.
- queries List<Property Map>
- Query describes the indicator that will be measured against the objective. Freeform Query types are currently supported.
- uuid String
- A unique, random identifier. This value will also be the name of the resource stored in the API server. This value is read-only.
GetSlosSloAlerting
- Annotations
List<Pulumiverse.
Grafana. Inputs. Get Slos Slo Alerting Annotation> - Annotations will be attached to all alerts generated by any of these rules.
- Fastburns
List<Pulumiverse.
Grafana. Inputs. Get Slos Slo Alerting Fastburn> - Alerting Rules generated for Fast Burn alerts
- Labels
List<Pulumiverse.
Grafana. Inputs. Get Slos Slo Alerting Label> - Labels will be attached to all alerts generated by any of these rules.
- Slowburns
List<Pulumiverse.
Grafana. Inputs. Get Slos Slo Alerting Slowburn> - Alerting Rules generated for Slow Burn alerts
- Annotations
[]Get
Slos Slo Alerting Annotation - Annotations will be attached to all alerts generated by any of these rules.
- Fastburns
[]Get
Slos Slo Alerting Fastburn - Alerting Rules generated for Fast Burn alerts
- Labels
[]Get
Slos Slo Alerting Label - Labels will be attached to all alerts generated by any of these rules.
- Slowburns
[]Get
Slos Slo Alerting Slowburn - Alerting Rules generated for Slow Burn alerts
- annotations
List<Get
Slos Slo Alerting Annotation> - Annotations will be attached to all alerts generated by any of these rules.
- fastburns
List<Get
Slos Slo Alerting Fastburn> - Alerting Rules generated for Fast Burn alerts
- labels
List<Get
Slos Slo Alerting Label> - Labels will be attached to all alerts generated by any of these rules.
- slowburns
List<Get
Slos Slo Alerting Slowburn> - Alerting Rules generated for Slow Burn alerts
- annotations
Get
Slos Slo Alerting Annotation[] - Annotations will be attached to all alerts generated by any of these rules.
- fastburns
Get
Slos Slo Alerting Fastburn[] - Alerting Rules generated for Fast Burn alerts
- labels
Get
Slos Slo Alerting Label[] - Labels will be attached to all alerts generated by any of these rules.
- slowburns
Get
Slos Slo Alerting Slowburn[] - Alerting Rules generated for Slow Burn alerts
- annotations
Sequence[Get
Slos Slo Alerting Annotation] - Annotations will be attached to all alerts generated by any of these rules.
- fastburns
Sequence[Get
Slos Slo Alerting Fastburn] - Alerting Rules generated for Fast Burn alerts
- labels
Sequence[Get
Slos Slo Alerting Label] - Labels will be attached to all alerts generated by any of these rules.
- slowburns
Sequence[Get
Slos Slo Alerting Slowburn] - Alerting Rules generated for Slow Burn alerts
- annotations List<Property Map>
- Annotations will be attached to all alerts generated by any of these rules.
- fastburns List<Property Map>
- Alerting Rules generated for Fast Burn alerts
- labels List<Property Map>
- Labels will be attached to all alerts generated by any of these rules.
- slowburns List<Property Map>
- Alerting Rules generated for Slow Burn alerts
GetSlosSloAlertingAnnotation
GetSlosSloAlertingFastburn
- Annotations
List<Pulumiverse.
Grafana. Inputs. Get Slos Slo Alerting Fastburn Annotation> - Annotations to attach only to Fast Burn alerts.
- Labels
List<Pulumiverse.
Grafana. Inputs. Get Slos Slo Alerting Fastburn Label> - Labels to attach only to Fast Burn alerts.
- Annotations
[]Get
Slos Slo Alerting Fastburn Annotation - Annotations to attach only to Fast Burn alerts.
- Labels
[]Get
Slos Slo Alerting Fastburn Label - Labels to attach only to Fast Burn alerts.
- annotations
List<Get
Slos Slo Alerting Fastburn Annotation> - Annotations to attach only to Fast Burn alerts.
- labels
List<Get
Slos Slo Alerting Fastburn Label> - Labels to attach only to Fast Burn alerts.
- annotations
Get
Slos Slo Alerting Fastburn Annotation[] - Annotations to attach only to Fast Burn alerts.
- labels
Get
Slos Slo Alerting Fastburn Label[] - Labels to attach only to Fast Burn alerts.
- annotations
Sequence[Get
Slos Slo Alerting Fastburn Annotation] - Annotations to attach only to Fast Burn alerts.
- labels
Sequence[Get
Slos Slo Alerting Fastburn Label] - Labels to attach only to Fast Burn alerts.
- annotations List<Property Map>
- Annotations to attach only to Fast Burn alerts.
- labels List<Property Map>
- Labels to attach only to Fast Burn alerts.
GetSlosSloAlertingFastburnAnnotation
GetSlosSloAlertingFastburnLabel
GetSlosSloAlertingLabel
GetSlosSloAlertingSlowburn
- Annotations
List<Pulumiverse.
Grafana. Inputs. Get Slos Slo Alerting Slowburn Annotation> - Annotations to attach only to Slow Burn alerts.
- Labels
List<Pulumiverse.
Grafana. Inputs. Get Slos Slo Alerting Slowburn Label> - Labels to attach only to Slow Burn alerts.
- Annotations
[]Get
Slos Slo Alerting Slowburn Annotation - Annotations to attach only to Slow Burn alerts.
- Labels
[]Get
Slos Slo Alerting Slowburn Label - Labels to attach only to Slow Burn alerts.
- annotations
List<Get
Slos Slo Alerting Slowburn Annotation> - Annotations to attach only to Slow Burn alerts.
- labels
List<Get
Slos Slo Alerting Slowburn Label> - Labels to attach only to Slow Burn alerts.
- annotations
Get
Slos Slo Alerting Slowburn Annotation[] - Annotations to attach only to Slow Burn alerts.
- labels
Get
Slos Slo Alerting Slowburn Label[] - Labels to attach only to Slow Burn alerts.
- annotations
Sequence[Get
Slos Slo Alerting Slowburn Annotation] - Annotations to attach only to Slow Burn alerts.
- labels
Sequence[Get
Slos Slo Alerting Slowburn Label] - Labels to attach only to Slow Burn alerts.
- annotations List<Property Map>
- Annotations to attach only to Slow Burn alerts.
- labels List<Property Map>
- Labels to attach only to Slow Burn alerts.
GetSlosSloAlertingSlowburnAnnotation
GetSlosSloAlertingSlowburnLabel
GetSlosSloDestinationDatasource
- Uid string
- UID for the Mimir Datasource
- Uid string
- UID for the Mimir Datasource
- uid String
- UID for the Mimir Datasource
- uid string
- UID for the Mimir Datasource
- uid str
- UID for the Mimir Datasource
- uid String
- UID for the Mimir Datasource
GetSlosSloLabel
GetSlosSloObjective
GetSlosSloQuery
- Type string
- Query type must be one of: "freeform", "query", "ratio", or "threshold"
- Freeform
Pulumiverse.
Grafana. Inputs. Get Slos Slo Query Freeform - Ratio
Pulumiverse.
Grafana. Inputs. Get Slos Slo Query Ratio
- Type string
- Query type must be one of: "freeform", "query", "ratio", or "threshold"
- Freeform
Get
Slos Slo Query Freeform - Ratio
Get
Slos Slo Query Ratio
- type String
- Query type must be one of: "freeform", "query", "ratio", or "threshold"
- freeform
Get
Slos Slo Query Freeform - ratio
Get
Slos Slo Query Ratio
- type string
- Query type must be one of: "freeform", "query", "ratio", or "threshold"
- freeform
Get
Slos Slo Query Freeform - ratio
Get
Slos Slo Query Ratio
- type str
- Query type must be one of: "freeform", "query", "ratio", or "threshold"
- freeform
Get
Slos Slo Query Freeform - ratio
Get
Slos Slo Query Ratio
- type String
- Query type must be one of: "freeform", "query", "ratio", or "threshold"
- freeform Property Map
- ratio Property Map
GetSlosSloQueryFreeform
- Query string
- Freeform Query Field
- Query string
- Freeform Query Field
- query String
- Freeform Query Field
- query string
- Freeform Query Field
- query str
- Freeform Query Field
- query String
- Freeform Query Field
GetSlosSloQueryRatio
- Success
Metric string - Counter metric for success events (numerator)
- Total
Metric string - Metric for total events (denominator)
- Group
By List<string>Labels - Defines Group By Labels used for per-label alerting. These appear as variables on SLO dashboards to enable filtering and aggregation. Labels must adhere to Prometheus label name schema - "^[a-zA-Z_][a-zA-Z0-9_]*$"
- Success
Metric string - Counter metric for success events (numerator)
- Total
Metric string - Metric for total events (denominator)
- Group
By []stringLabels - Defines Group By Labels used for per-label alerting. These appear as variables on SLO dashboards to enable filtering and aggregation. Labels must adhere to Prometheus label name schema - "^[a-zA-Z_][a-zA-Z0-9_]*$"
- success
Metric String - Counter metric for success events (numerator)
- total
Metric String - Metric for total events (denominator)
- group
By List<String>Labels - Defines Group By Labels used for per-label alerting. These appear as variables on SLO dashboards to enable filtering and aggregation. Labels must adhere to Prometheus label name schema - "^[a-zA-Z_][a-zA-Z0-9_]*$"
- success
Metric string - Counter metric for success events (numerator)
- total
Metric string - Metric for total events (denominator)
- group
By string[]Labels - Defines Group By Labels used for per-label alerting. These appear as variables on SLO dashboards to enable filtering and aggregation. Labels must adhere to Prometheus label name schema - "^[a-zA-Z_][a-zA-Z0-9_]*$"
- success_
metric str - Counter metric for success events (numerator)
- total_
metric str - Metric for total events (denominator)
- group_
by_ Sequence[str]labels - Defines Group By Labels used for per-label alerting. These appear as variables on SLO dashboards to enable filtering and aggregation. Labels must adhere to Prometheus label name schema - "^[a-zA-Z_][a-zA-Z0-9_]*$"
- success
Metric String - Counter metric for success events (numerator)
- total
Metric String - Metric for total events (denominator)
- group
By List<String>Labels - Defines Group By Labels used for per-label alerting. These appear as variables on SLO dashboards to enable filtering and aggregation. Labels must adhere to Prometheus label name schema - "^[a-zA-Z_][a-zA-Z0-9_]*$"
Package Details
- Repository
- grafana pulumiverse/pulumi-grafana
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
grafana
Terraform Provider.