SloArgs

data class SloArgs(val basicSli: Output<SloBasicSliArgs>? = null, val calendarPeriod: Output<String>? = null, val displayName: Output<String>? = null, val goal: Output<Double>? = null, val project: Output<String>? = null, val requestBasedSli: Output<SloRequestBasedSliArgs>? = null, val rollingPeriodDays: Output<Int>? = null, val service: Output<String>? = null, val sloId: Output<String>? = null, val userLabels: Output<Map<String, String>>? = null, val windowsBasedSli: Output<SloWindowsBasedSliArgs>? = null) : ConvertibleToJava<SloArgs>

A Service-Level Objective (SLO) describes the level of desired good service. It consists of a service-level indicator (SLI), a performance goal, and a period over which the objective is to be evaluated against that goal. The SLO can use SLIs defined in a number of different manners. Typical SLOs might include "99% of requests in each rolling week have latency below 200 milliseconds" or "99.5% of requests in each calendar month return successfully." To get more information about Slo, see:

Example Usage

Monitoring Slo Appengine

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.monitoring.MonitoringFunctions;
import com.pulumi.gcp.monitoring.inputs.GetAppEngineServiceArgs;
import com.pulumi.gcp.monitoring.Slo;
import com.pulumi.gcp.monitoring.SloArgs;
import com.pulumi.gcp.monitoring.inputs.SloBasicSliArgs;
import com.pulumi.gcp.monitoring.inputs.SloBasicSliLatencyArgs;
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) {
final var default = MonitoringFunctions.getAppEngineService(GetAppEngineServiceArgs.builder()
.moduleId("default")
.build());
var appengSlo = new Slo("appengSlo", SloArgs.builder()
.service(default_.serviceId())
.sloId("ae-slo")
.displayName("Test SLO for App Engine")
.goal(0.9)
.calendarPeriod("DAY")
.basicSli(SloBasicSliArgs.builder()
.latency(SloBasicSliLatencyArgs.builder()
.threshold("1s")
.build())
.build())
.userLabels(Map.ofEntries(
Map.entry("my_key", "my_value"),
Map.entry("my_other_key", "my_other_value")
))
.build());
}
}

Monitoring Slo Request Based

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.monitoring.CustomService;
import com.pulumi.gcp.monitoring.CustomServiceArgs;
import com.pulumi.gcp.monitoring.Slo;
import com.pulumi.gcp.monitoring.SloArgs;
import com.pulumi.gcp.monitoring.inputs.SloRequestBasedSliArgs;
import com.pulumi.gcp.monitoring.inputs.SloRequestBasedSliDistributionCutArgs;
import com.pulumi.gcp.monitoring.inputs.SloRequestBasedSliDistributionCutRangeArgs;
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 customsrv = new CustomService("customsrv", CustomServiceArgs.builder()
.serviceId("custom-srv-request-slos")
.displayName("My Custom Service")
.build());
var requestBasedSlo = new Slo("requestBasedSlo", SloArgs.builder()
.service(customsrv.serviceId())
.sloId("consumed-api-slo")
.displayName("Test SLO with request based SLI (good total ratio)")
.goal(0.9)
.rollingPeriodDays(30)
.requestBasedSli(SloRequestBasedSliArgs.builder()
.distributionCut(SloRequestBasedSliDistributionCutArgs.builder()
.distributionFilter("metric.type=\"serviceruntime.googleapis.com/api/request_latencies\" resource.type=\"api\" ")
.range(SloRequestBasedSliDistributionCutRangeArgs.builder()
.max(0.5)
.build())
.build())
.build())
.build());
}
}

Import

Slo can be imported using any of these accepted formats:

$ pulumi import gcp:monitoring/slo:Slo default {{name}}

Constructors

Link copied to clipboard
constructor(basicSli: Output<SloBasicSliArgs>? = null, calendarPeriod: Output<String>? = null, displayName: Output<String>? = null, goal: Output<Double>? = null, project: Output<String>? = null, requestBasedSli: Output<SloRequestBasedSliArgs>? = null, rollingPeriodDays: Output<Int>? = null, service: Output<String>? = null, sloId: Output<String>? = null, userLabels: Output<Map<String, String>>? = null, windowsBasedSli: Output<SloWindowsBasedSliArgs>? = null)

Properties

Link copied to clipboard
val basicSli: Output<SloBasicSliArgs>? = null

Basic Service-Level Indicator (SLI) on a well-known service type. Performance will be computed on the basis of pre-defined metrics. SLIs are used to measure and calculate the quality of the Service's performance with respect to a single aspect of service quality. Exactly one of the following must be set: basic_sli, request_based_sli, windows_based_sli Structure is documented below.

Link copied to clipboard
val calendarPeriod: Output<String>? = null

A calendar period, semantically "since the start of the current ". Possible values are: DAY, WEEK, FORTNIGHT, MONTH.

Link copied to clipboard
val displayName: Output<String>? = null

Name used for UI elements listing this SLO.

Link copied to clipboard
val goal: Output<Double>? = null

The fraction of service that must be good in order for this objective to be met. 0 < goal <= 0.999

Link copied to clipboard
val project: Output<String>? = null

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Link copied to clipboard

A request-based SLI defines a SLI for which atomic units of service are counted directly. A SLI describes a good service. It is used to measure and calculate the quality of the Service's performance with respect to a single aspect of service quality. Exactly one of the following must be set: basic_sli, request_based_sli, windows_based_sli Structure is documented below.

Link copied to clipboard
val rollingPeriodDays: Output<Int>? = null

A rolling time period, semantically "in the past X days". Must be between 1 to 30 days, inclusive.

Link copied to clipboard
val service: Output<String>? = null

ID of the service to which this SLO belongs.

Link copied to clipboard
val sloId: Output<String>? = null

The id to use for this ServiceLevelObjective. If omitted, an id will be generated instead.

Link copied to clipboard
val userLabels: Output<Map<String, String>>? = null

This field is intended to be used for organizing and identifying the AlertPolicy objects.The field can contain up to 64 entries. Each key and value is limited to 63 Unicode characters or 128 bytes, whichever is smaller. Labels and values can contain only lowercase letters, numerals, underscores, and dashes. Keys must begin with a letter.

Link copied to clipboard

A windows-based SLI defines the criteria for time windows. good_service is defined based off the count of these time windows for which the provided service was of good quality. A SLI describes a good service. It is used to measure and calculate the quality of the Service's performance with respect to a single aspect of service quality. Exactly one of the following must be set: basic_sli, request_based_sli, windows_based_sli Structure is documented below.

Functions

Link copied to clipboard
open override fun toJava(): SloArgs