MonitoringServiceLevelObjective


Property Value
Google Cloud Service Name Cloud Monitoring
Google Cloud Service Documentation /monitoring/docs/
Google Cloud REST Resource Name v3.services.serviceLevelObjectives
Google Cloud REST Resource Documentation /monitoring/api/ref_v3/rest/v3/services.serviceLevelObjectives
Config Connector Resource Short Names gcpmonitoringservicelevelobjective
gcpmonitoringservicelevelobjectives
monitoringservicelevelobjective
Config Connector Service Name monitoring.googleapis.com
Config Connector Resource Fully Qualified Name monitoringservicelevelobjectives.monitoring.cnrm.cloud.google.com
Can Be Referenced by IAMPolicy/IAMPolicyMember No
Config Connector Default Average Reconcile Interval In Seconds 600

Custom Resource Definition Properties

Spec

Schema

calendarPeriod: string
displayName: string
goal: float
projectRef:
  external: string
  name: string
  namespace: string
resourceID: string
rollingPeriod: string
serviceLevelIndicator:
  basicSli:
    availability: {}
    latency:
      experience: string
      threshold: string
    location:
    - string
    method:
    - string
    operationAvailability: {}
    operationLatency:
      experience: string
      threshold: string
    version:
    - string
  requestBased:
    distributionCut:
      distributionFilter: string
      range:
        max: float
        min: float
    goodTotalRatio:
      badServiceFilter: string
      goodServiceFilter: string
      totalServiceFilter: string
  windowsBased:
    goodBadMetricFilter: string
    goodTotalRatioThreshold:
      basicSliPerformance:
        availability: {}
        latency:
          experience: string
          threshold: string
        location:
        - string
        method:
        - string
        operationAvailability: {}
        operationLatency:
          experience: string
          threshold: string
        version:
        - string
      performance:
        distributionCut:
          distributionFilter: string
          range:
            max: float
            min: float
        goodTotalRatio:
          badServiceFilter: string
          goodServiceFilter: string
          totalServiceFilter: string
      threshold: float
    metricMeanInRange:
      range:
        max: float
        min: float
      timeSeries: string
    metricSumInRange:
      range:
        max: float
        min: float
      timeSeries: string
    windowPeriod: string
serviceRef:
  external: string
  name: string
  namespace: string
Fields

calendarPeriod

Optional

string

A calendar period, semantically "since the start of the current ``". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and `MONTH` are supported. Possible values: CALENDAR_PERIOD_UNSPECIFIED, DAY, WEEK, FORTNIGHT, MONTH, QUARTER, HALF, YEAR

displayName

Optional

string

Name used for UI elements listing this SLO.

goal

Required

float

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

projectRef

Required

object

Immutable. The Project that this resource belongs to.

projectRef.external

Optional

string

The project for the resource Allowed value: The Google Cloud resource name of a `Project` resource (format: `projects/{{name}}`).

projectRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

projectRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

resourceID

Optional

string

Immutable. Optional. The name of the resource. Used for creation and acquisition. When unset, the value of `metadata.name` is used as the default.

rollingPeriod

Optional

string

A rolling time period, semantically "in the past ``". Must be an integer multiple of 1 day no larger than 30 days.

serviceLevelIndicator

Optional

object

The definition of good service, used to measure and calculate the quality of the `Service`'s performance with respect to a single aspect of service quality.

serviceLevelIndicator.basicSli

Optional

object

Basic SLI on a well-known service type.

serviceLevelIndicator.basicSli.availability

Optional

object

Good service is defined to be the count of requests made to this service that return successfully.

serviceLevelIndicator.basicSli.latency

Optional

object

Good service is defined to be the count of requests made to this service that are fast enough with respect to `latency.threshold`.

serviceLevelIndicator.basicSli.latency.experience

Optional

string

A description of the experience associated with failing requests. Possible values: LATENCY_EXPERIENCE_UNSPECIFIED, DELIGHTING, SATISFYING, ANNOYING

serviceLevelIndicator.basicSli.latency.threshold

Optional

string

Good service is defined to be the count of requests made to this service that return in no more than `threshold`.

serviceLevelIndicator.basicSli.location

Optional

list (string)

OPTIONAL: The set of locations to which this SLI is relevant. Telemetry from other locations will not be used to calculate performance for this SLI. If omitted, this SLI applies to all locations in which the Service has activity. For service types that don't support breaking down by location, setting this field will result in an error.

serviceLevelIndicator.basicSli.location[]

Optional

string

serviceLevelIndicator.basicSli.method

Optional

list (string)

OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from other methods will not be used to calculate performance for this SLI. If omitted, this SLI applies to all the Service's methods. For service types that don't support breaking down by method, setting this field will result in an error.

serviceLevelIndicator.basicSli.method[]

Optional

string

serviceLevelIndicator.basicSli.operationAvailability

Optional

object

Good service is defined to be the count of operations performed by this service that return successfully

serviceLevelIndicator.basicSli.operationLatency

Optional

object

Good service is defined to be the count of operations performed by this service that are fast enough with respect to `operation_latency.threshold`.

serviceLevelIndicator.basicSli.operationLatency.experience

Optional

string

A description of the experience associated with failing requests. Possible values: LATENCY_EXPERIENCE_UNSPECIFIED, DELIGHTING, SATISFYING, ANNOYING

serviceLevelIndicator.basicSli.operationLatency.threshold

Optional

string

Good service is defined to be the count of operations that are completed in no more than `threshold`.

serviceLevelIndicator.basicSli.version

Optional

list (string)

OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry from other API versions will not be used to calculate performance for this SLI. If omitted, this SLI applies to all API versions. For service types that don't support breaking down by version, setting this field will result in an error.

serviceLevelIndicator.basicSli.version[]

Optional

string

serviceLevelIndicator.requestBased

Optional

object

Request-based SLIs

serviceLevelIndicator.requestBased.distributionCut

Optional

object

`distribution_cut` is used when `good_service` is a count of values aggregated in a `Distribution` that fall into a good range. The `total_service` is the total count of all values aggregated in the `Distribution`.

serviceLevelIndicator.requestBased.distributionCut.distributionFilter

Optional

string

A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) specifying a `TimeSeries` aggregating values. Must have `ValueType = DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.

serviceLevelIndicator.requestBased.distributionCut.range

Optional

object

Range of values considered "good." For a one-sided range, set one bound to an infinite value.

serviceLevelIndicator.requestBased.distributionCut.range.max

Optional

float

Range maximum.

serviceLevelIndicator.requestBased.distributionCut.range.min

Optional

float

Range minimum.

serviceLevelIndicator.requestBased.goodTotalRatio

Optional

object

`good_total_ratio` is used when the ratio of `good_service` to `total_service` is computed from two `TimeSeries`.

serviceLevelIndicator.requestBased.goodTotalRatio.badServiceFilter

Optional

string

A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) specifying a `TimeSeries` quantifying bad service, either demanded service that was not provided or demanded service that was of inadequate quality. Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.

serviceLevelIndicator.requestBased.goodTotalRatio.goodServiceFilter

Optional

string

A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) specifying a `TimeSeries` quantifying good service provided. Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.

serviceLevelIndicator.requestBased.goodTotalRatio.totalServiceFilter

Optional

string

A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) specifying a `TimeSeries` quantifying total demanded service. Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.

serviceLevelIndicator.windowsBased

Optional

object

Windows-based SLIs

serviceLevelIndicator.windowsBased.goodBadMetricFilter

Optional

string

A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if any `true` values appear in the window.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold

Optional

object

A window is good if its `performance` is high enough.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance

Optional

object

`BasicSli` to evaluate to judge window quality.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.availability

Optional

object

Good service is defined to be the count of requests made to this service that return successfully.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.latency

Optional

object

Good service is defined to be the count of requests made to this service that are fast enough with respect to `latency.threshold`.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.latency.experience

Optional

string

A description of the experience associated with failing requests. Possible values: LATENCY_EXPERIENCE_UNSPECIFIED, DELIGHTING, SATISFYING, ANNOYING

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.latency.threshold

Optional

string

Good service is defined to be the count of requests made to this service that return in no more than `threshold`.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.location

Optional

list (string)

OPTIONAL: The set of locations to which this SLI is relevant. Telemetry from other locations will not be used to calculate performance for this SLI. If omitted, this SLI applies to all locations in which the Service has activity. For service types that don't support breaking down by location, setting this field will result in an error.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.location[]

Optional

string

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.method

Optional

list (string)

OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from other methods will not be used to calculate performance for this SLI. If omitted, this SLI applies to all the Service's methods. For service types that don't support breaking down by method, setting this field will result in an error.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.method[]

Optional

string

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.operationAvailability

Optional

object

Good service is defined to be the count of operations performed by this service that return successfully

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.operationLatency

Optional

object

Good service is defined to be the count of operations performed by this service that are fast enough with respect to `operation_latency.threshold`.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.operationLatency.experience

Optional

string

A description of the experience associated with failing requests. Possible values: LATENCY_EXPERIENCE_UNSPECIFIED, DELIGHTING, SATISFYING, ANNOYING

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.operationLatency.threshold

Optional

string

Good service is defined to be the count of operations that are completed in no more than `threshold`.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.version

Optional

list (string)

OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry from other API versions will not be used to calculate performance for this SLI. If omitted, this SLI applies to all API versions. For service types that don't support breaking down by version, setting this field will result in an error.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.basicSliPerformance.version[]

Optional

string

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance

Optional

object

`RequestBasedSli` to evaluate to judge window quality.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.distributionCut

Optional

object

`distribution_cut` is used when `good_service` is a count of values aggregated in a `Distribution` that fall into a good range. The `total_service` is the total count of all values aggregated in the `Distribution`.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.distributionCut.distributionFilter

Optional

string

A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) specifying a `TimeSeries` aggregating values. Must have `ValueType = DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.distributionCut.range

Optional

object

Range of values considered "good." For a one-sided range, set one bound to an infinite value.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.distributionCut.range.max

Optional

float

Range maximum.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.distributionCut.range.min

Optional

float

Range minimum.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.goodTotalRatio

Optional

object

`good_total_ratio` is used when the ratio of `good_service` to `total_service` is computed from two `TimeSeries`.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.goodTotalRatio.badServiceFilter

Optional

string

A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) specifying a `TimeSeries` quantifying bad service, either demanded service that was not provided or demanded service that was of inadequate quality. Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.goodTotalRatio.goodServiceFilter

Optional

string

A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) specifying a `TimeSeries` quantifying good service provided. Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.performance.goodTotalRatio.totalServiceFilter

Optional

string

A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) specifying a `TimeSeries` quantifying total demanded service. Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.

serviceLevelIndicator.windowsBased.goodTotalRatioThreshold.threshold

Optional

float

If window `performance >= threshold`, the window is counted as good.

serviceLevelIndicator.windowsBased.metricMeanInRange

Optional

object

A window is good if the metric's value is in a good range, averaged across returned streams.

serviceLevelIndicator.windowsBased.metricMeanInRange.range

Optional

object

Range of values considered "good." For a one-sided range, set one bound to an infinite value.

serviceLevelIndicator.windowsBased.metricMeanInRange.range.max

Optional

float

Range maximum.

serviceLevelIndicator.windowsBased.metricMeanInRange.range.min

Optional

float

Range minimum.

serviceLevelIndicator.windowsBased.metricMeanInRange.timeSeries

Optional

string

A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) specifying the `TimeSeries` to use for evaluating window quality.

serviceLevelIndicator.windowsBased.metricSumInRange

Optional

object

A window is good if the metric's value is in a good range, summed across returned streams.

serviceLevelIndicator.windowsBased.metricSumInRange.range

Optional

object

Range of values considered "good." For a one-sided range, set one bound to an infinite value.

serviceLevelIndicator.windowsBased.metricSumInRange.range.max

Optional

float

Range maximum.

serviceLevelIndicator.windowsBased.metricSumInRange.range.min

Optional

float

Range minimum.

serviceLevelIndicator.windowsBased.metricSumInRange.timeSeries

Optional

string

A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters) specifying the `TimeSeries` to use for evaluating window quality.

serviceLevelIndicator.windowsBased.windowPeriod

Optional

string

Duration over which window quality is evaluated. Must be an integer fraction of a day and at least `60s`.

serviceRef

Required

object

Immutable.

serviceRef.external

Optional

string

The service for the resource Allowed value: The Google Cloud resource name of a `MonitoringService` resource (format: `projects/{{project}}/services/{{name}}`).

serviceRef.name

Optional

string

Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names

serviceRef.namespace

Optional

string

Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/

Status

Schema

conditions:
- lastTransitionTime: string
  message: string
  reason: string
  status: string
  type: string
createTime: string
deleteTime: string
observedGeneration: integer
serviceManagementOwned: boolean
Fields
conditions

list (object)

Conditions represent the latest available observation of the resource's current state.

conditions[]

object

conditions[].lastTransitionTime

string

Last time the condition transitioned from one status to another.

conditions[].message

string

Human-readable message indicating details about last transition.

conditions[].reason

string

Unique, one-word, CamelCase reason for the condition's last transition.

conditions[].status

string

Status is the status of the condition. Can be True, False, Unknown.

conditions[].type

string

Type is the type of the condition.

createTime

string

Time stamp of the `Create` or most recent `Update` command on this `Slo`.

deleteTime

string

Time stamp of the `Update` or `Delete` command that made this no longer a current `Slo`. This field is not populated in `ServiceLevelObjective`s returned from calls to `GetServiceLevelObjective` and `ListServiceLevelObjectives`, because it is always empty in the current version. It is populated in `ServiceLevelObjective`s representing previous versions in the output of `ListServiceLevelObjectiveVersions`. Because all old configuration versions are stored, `Update` operations mark the obsoleted version as deleted.

observedGeneration

integer

ObservedGeneration is the generation of the resource that was most recently observed by the Config Connector controller. If this is equal to metadata.generation, then that means that the current reported status reflects the most recent desired state of the resource.

serviceManagementOwned

boolean

Output only. If set, this SLO is managed at the [Service Management](https://cloud.google.com/service-management/overview) level. Therefore the service yaml file is the source of truth for this SLO, and API `Update` and `Delete` operations are forbidden.

Sample YAML(s)

Request Based Distribution Cut

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringServiceLevelObjective
metadata:
  name: monitoringservicelevelobjective-sample-requestbaseddistributioncut
  labels:
    test1: "value1"
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  serviceRef:
    external: monitoringservicelevelobjective-dep-requestbaseddistributioncut
  displayName: "A request based distribution cut filter"
  goal: 0.9
  rollingPeriod: "86400s"
  serviceLevelIndicator:
    requestBased:
      distributionCut:
        distributionFilter: "metric.type=\"serviceruntime.googleapis.com/api/request_latencies\" \n resource.type=\"api\"  "
        range:
          min: 50
          max: 100
---
apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringService
metadata:
  name: monitoringservicelevelobjective-dep-requestbaseddistributioncut
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  displayName: "A basic monitoring service."

Request Based Good Total Ratio

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringServiceLevelObjective
metadata:
  name: monitoringservicelevelobjective-sample-requestbasedgoodtotalratio
  labels:
    test1: "value1"
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  serviceRef:
    external: monitoringservicelevelobjective-dep-requestbasedgoodtotalratio
  displayName: "A request based good total ratio filter"
  goal: 0.9
  rollingPeriod: "86400s"
  serviceLevelIndicator:
    requestBased:
      goodTotalRatio:
        goodServiceFilter: "metric.type=\"serviceruntime.googleapis.com/api/request_count\" \n resource.type=\"api\" "
        badServiceFilter: "metric.type=\"serviceruntime.googleapis.com/api/request_count\" \n resource.type=\"api\" "
---
apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringService
metadata:
  name: monitoringservicelevelobjective-dep-requestbasedgoodtotalratio
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  displayName: "A basic monitoring service."

Request Based Gtr Total Service Filter

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringServiceLevelObjective
metadata:
  name: monitoringservicelevelobjective-sample-requestbasedgtrtotalservicefilter
  labels:
    test1: "value1"
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  serviceRef:
    external: monitoringservicelevelobjective-dep-requestbasedgtrtotalservicefilter
  displayName: "A request based good total ratio total service filter"
  goal: 0.9
  rollingPeriod: "86400s"
  serviceLevelIndicator:
    requestBased:
      goodTotalRatio:
        goodServiceFilter: "metric.type=\"serviceruntime.googleapis.com/api/request_count\" \n resource.type=\"api\" "
        totalServiceFilter: "metric.type=\"serviceruntime.googleapis.com/api/request_count\" \n resource.type=\"api\" "
---
apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringService
metadata:
  name: monitoringservicelevelobjective-dep-requestbasedgtrtotalservicefilter
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  displayName: "A basic monitoring service."

Window Based Good Bad Metric Filter

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringServiceLevelObjective
metadata:
  name: monitoringservicelevelobjective-sample-windowgoodbadmetric
  labels:
    test1: "value1"
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  serviceRef:
    external: monitoringservicelevelobjective-dep-windowgoodbadmetric
  displayName: "A window based good bad metric slo"
  goal: 0.9
  calendarPeriod: DAY
  serviceLevelIndicator:
    windowsBased:
      windowPeriod: "60s"
      goodBadMetricFilter: "metric.type=\"monitoring.googleapis.com/uptime_check/check_passed\" \n resource.type=\"uptime_url\""
---
apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringService
metadata:
  name: monitoringservicelevelobjective-dep-windowgoodbadmetric
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  displayName: "A basic monitoring service."

Window Based Gtr Distribution Cut

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringServiceLevelObjective
metadata:
  name: monitoringservicelevelobjective-sample-windowbasedgtrdistributioncut
  labels:
    test1: "value1"
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  serviceRef:
    external: monitoringservicelevelobjective-dep-windowbasedgtrdistributioncut
  displayName: "A window based good total ratio distribution cut filter"
  goal: 0.9
  calendarPeriod: "DAY"
  serviceLevelIndicator:
    windowsBased:
      windowPeriod: "60s"
      goodTotalRatioThreshold:
        threshold: 0.9
        performance:
          distributionCut:
            distributionFilter: "metric.type=\"serviceruntime.googleapis.com/api/request_latencies\" resource.type=\"api\"  "
            range:
              min: 50
              max: 100
---
apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringService
metadata:
  name: monitoringservicelevelobjective-dep-windowbasedgtrdistributioncut
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  displayName: "A basic monitoring service."

Window Based Gtr Performance Gtr

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringServiceLevelObjective
metadata:
  name: monitoringservicelevelobjective-sample-windowbasedgtrperformancegtr
  labels:
    test1: "value1"
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  serviceRef:
    external: monitoringservicelevelobjective-dep-windowbasedgtrperformancegtr
  displayName: "A window based good total ratio performance filter"
  goal: 0.9
  calendarPeriod: "DAY"
  serviceLevelIndicator:
    windowsBased:
      windowPeriod: "60s"
      goodTotalRatioThreshold:
        threshold: 0.9
        performance:
          goodTotalRatio:
            goodServiceFilter: "metric.type=\"serviceruntime.googleapis.com/api/request_count\" \n resource.type=\"api\" "
            badServiceFilter: "metric.type=\"serviceruntime.googleapis.com/api/request_count\" \n resource.type=\"api\" "
---
apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringService
metadata:
  name: monitoringservicelevelobjective-dep-windowbasedgtrperformancegtr
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  displayName: "A basic monitoring service."

Window Based Gtr Performance Gtr Total Service Filter

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringServiceLevelObjective
metadata:
  name: monitoringservicelevelobjective-sample-windowbasedgtrperformancegtrtotalservicefilter
  labels:
    test1: "value1"
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  serviceRef:
    external: monitoringservicelevelobjective-dep-windowbasedgtrperformancegtrtotalservicefilter
  displayName: "A window based good total ratio performance filter"
  goal: 0.9
  calendarPeriod: "DAY"
  serviceLevelIndicator:
    windowsBased:
      windowPeriod: "60s"
      goodTotalRatioThreshold:
        threshold: 0.9
        performance:
          goodTotalRatio:
            goodServiceFilter: "metric.type=\"serviceruntime.googleapis.com/api/request_count\" \n resource.type=\"api\" "
            totalServiceFilter: "metric.type=\"serviceruntime.googleapis.com/api/request_count\" \n resource.type=\"api\" "
---
apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringService
metadata:
  name: monitoringservicelevelobjective-dep-windowbasedgtrperformancegtrtotalservicefilter
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  displayName: "A basic monitoring service."

Window Based Metric Mean Filter

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringServiceLevelObjective
metadata:
  name: monitoringservicelevelobjective-sample-windowbasedmetricmeanfilter
  labels:
    test1: "value1"
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  serviceRef:
    external: monitoringservicelevelobjective-dep-windowbasedmetricmeanfilter
  displayName: "A window based metric mean filter"
  goal: 0.9
  rollingPeriod: "86400s"
  serviceLevelIndicator:
    windowsBased:
      windowPeriod: "60s"
      metricMeanInRange:
        timeSeries: "resource.type=\"gce_instance\" \nmetric.type=\"compute.googleapis.com/instance/cpu/usage_time\""
        range:
          min: 50
          max: 100
---
apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringService
metadata:
  name: monitoringservicelevelobjective-dep-windowbasedmetricmeanfilter
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  displayName: "A basic monitoring service."

Window Based Metric Sum Filter

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringServiceLevelObjective
metadata:
  name: monitoringservicelevelobjective-sample-windowbasedmetricsum
  labels:
    test1: "value1"
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  serviceRef:
    external: monitoringservicelevelobjective-dep-windowbasedmetricsum
  displayName: "A window based metric sum filter"
  goal: 0.9
  rollingPeriod: "86400s"
  serviceLevelIndicator:
    windowsBased:
      windowPeriod: "60s"
      metricSumInRange:
        timeSeries: "resource.type=\"gce_instance\" \nmetric.type=\"compute.googleapis.com/instance/cpu/usage_time\""
        range:
          min: 50
          max: 100
---
apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringService
metadata:
  name: monitoringservicelevelobjective-dep-windowbasedmetricsum
spec:
  projectRef:
     # Replace ${PROJECT_ID?} with your project ID
     external: "projects/${PROJECT_ID?}"
  displayName: "A basic monitoring service."