xref: /aosp_15_r20/external/googleapis/google/monitoring/v3/service.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1*d5c09012SAndroid Build Coastguard Worker// Copyright 2023 Google LLC
2*d5c09012SAndroid Build Coastguard Worker//
3*d5c09012SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License");
4*d5c09012SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License.
5*d5c09012SAndroid Build Coastguard Worker// You may obtain a copy of the License at
6*d5c09012SAndroid Build Coastguard Worker//
7*d5c09012SAndroid Build Coastguard Worker//     http://www.apache.org/licenses/LICENSE-2.0
8*d5c09012SAndroid Build Coastguard Worker//
9*d5c09012SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software
10*d5c09012SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS,
11*d5c09012SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*d5c09012SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and
13*d5c09012SAndroid Build Coastguard Worker// limitations under the License.
14*d5c09012SAndroid Build Coastguard Worker
15*d5c09012SAndroid Build Coastguard Workersyntax = "proto3";
16*d5c09012SAndroid Build Coastguard Worker
17*d5c09012SAndroid Build Coastguard Workerpackage google.monitoring.v3;
18*d5c09012SAndroid Build Coastguard Worker
19*d5c09012SAndroid Build Coastguard Workerimport "google/api/field_behavior.proto";
20*d5c09012SAndroid Build Coastguard Workerimport "google/api/resource.proto";
21*d5c09012SAndroid Build Coastguard Workerimport "google/protobuf/duration.proto";
22*d5c09012SAndroid Build Coastguard Workerimport "google/type/calendar_period.proto";
23*d5c09012SAndroid Build Coastguard Worker
24*d5c09012SAndroid Build Coastguard Workeroption csharp_namespace = "Google.Cloud.Monitoring.V3";
25*d5c09012SAndroid Build Coastguard Workeroption go_package = "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb";
26*d5c09012SAndroid Build Coastguard Workeroption java_multiple_files = true;
27*d5c09012SAndroid Build Coastguard Workeroption java_outer_classname = "ServiceMonitoringProto";
28*d5c09012SAndroid Build Coastguard Workeroption java_package = "com.google.monitoring.v3";
29*d5c09012SAndroid Build Coastguard Workeroption php_namespace = "Google\\Cloud\\Monitoring\\V3";
30*d5c09012SAndroid Build Coastguard Workeroption ruby_package = "Google::Cloud::Monitoring::V3";
31*d5c09012SAndroid Build Coastguard Worker
32*d5c09012SAndroid Build Coastguard Worker// A `Service` is a discrete, autonomous, and network-accessible unit, designed
33*d5c09012SAndroid Build Coastguard Worker// to solve an individual concern
34*d5c09012SAndroid Build Coastguard Worker// ([Wikipedia](https://en.wikipedia.org/wiki/Service-orientation)). In
35*d5c09012SAndroid Build Coastguard Worker// Cloud Monitoring, a `Service` acts as the root resource under which
36*d5c09012SAndroid Build Coastguard Worker// operational aspects of the service are accessible.
37*d5c09012SAndroid Build Coastguard Workermessage Service {
38*d5c09012SAndroid Build Coastguard Worker  option (google.api.resource) = {
39*d5c09012SAndroid Build Coastguard Worker    type: "monitoring.googleapis.com/Service"
40*d5c09012SAndroid Build Coastguard Worker    pattern: "projects/{project}/services/{service}"
41*d5c09012SAndroid Build Coastguard Worker    pattern: "organizations/{organization}/services/{service}"
42*d5c09012SAndroid Build Coastguard Worker    pattern: "folders/{folder}/services/{service}"
43*d5c09012SAndroid Build Coastguard Worker    pattern: "*"
44*d5c09012SAndroid Build Coastguard Worker  };
45*d5c09012SAndroid Build Coastguard Worker
46*d5c09012SAndroid Build Coastguard Worker  // Use a custom service to designate a service that you want to monitor
47*d5c09012SAndroid Build Coastguard Worker  // when none of the other service types (like App Engine, Cloud Run, or
48*d5c09012SAndroid Build Coastguard Worker  // a GKE type) matches your intended service.
49*d5c09012SAndroid Build Coastguard Worker  message Custom {}
50*d5c09012SAndroid Build Coastguard Worker
51*d5c09012SAndroid Build Coastguard Worker  // App Engine service. Learn more at https://cloud.google.com/appengine.
52*d5c09012SAndroid Build Coastguard Worker  message AppEngine {
53*d5c09012SAndroid Build Coastguard Worker    // The ID of the App Engine module underlying this service. Corresponds to
54*d5c09012SAndroid Build Coastguard Worker    // the `module_id` resource label in the [`gae_app` monitored
55*d5c09012SAndroid Build Coastguard Worker    // resource](https://cloud.google.com/monitoring/api/resources#tag_gae_app).
56*d5c09012SAndroid Build Coastguard Worker    string module_id = 1;
57*d5c09012SAndroid Build Coastguard Worker  }
58*d5c09012SAndroid Build Coastguard Worker
59*d5c09012SAndroid Build Coastguard Worker  // Cloud Endpoints service. Learn more at https://cloud.google.com/endpoints.
60*d5c09012SAndroid Build Coastguard Worker  message CloudEndpoints {
61*d5c09012SAndroid Build Coastguard Worker    // The name of the Cloud Endpoints service underlying this service.
62*d5c09012SAndroid Build Coastguard Worker    // Corresponds to the `service` resource label in the [`api` monitored
63*d5c09012SAndroid Build Coastguard Worker    // resource](https://cloud.google.com/monitoring/api/resources#tag_api).
64*d5c09012SAndroid Build Coastguard Worker    string service = 1;
65*d5c09012SAndroid Build Coastguard Worker  }
66*d5c09012SAndroid Build Coastguard Worker
67*d5c09012SAndroid Build Coastguard Worker  // Istio service scoped to a single Kubernetes cluster. Learn more at
68*d5c09012SAndroid Build Coastguard Worker  // https://istio.io. Clusters running OSS Istio will have their services
69*d5c09012SAndroid Build Coastguard Worker  // ingested as this type.
70*d5c09012SAndroid Build Coastguard Worker  message ClusterIstio {
71*d5c09012SAndroid Build Coastguard Worker    // The location of the Kubernetes cluster in which this Istio service is
72*d5c09012SAndroid Build Coastguard Worker    // defined. Corresponds to the `location` resource label in `k8s_cluster`
73*d5c09012SAndroid Build Coastguard Worker    // resources.
74*d5c09012SAndroid Build Coastguard Worker    string location = 1;
75*d5c09012SAndroid Build Coastguard Worker
76*d5c09012SAndroid Build Coastguard Worker    // The name of the Kubernetes cluster in which this Istio service is
77*d5c09012SAndroid Build Coastguard Worker    // defined. Corresponds to the `cluster_name` resource label in
78*d5c09012SAndroid Build Coastguard Worker    // `k8s_cluster` resources.
79*d5c09012SAndroid Build Coastguard Worker    string cluster_name = 2;
80*d5c09012SAndroid Build Coastguard Worker
81*d5c09012SAndroid Build Coastguard Worker    // The namespace of the Istio service underlying this service. Corresponds
82*d5c09012SAndroid Build Coastguard Worker    // to the `destination_service_namespace` metric label in Istio metrics.
83*d5c09012SAndroid Build Coastguard Worker    string service_namespace = 3;
84*d5c09012SAndroid Build Coastguard Worker
85*d5c09012SAndroid Build Coastguard Worker    // The name of the Istio service underlying this service. Corresponds to the
86*d5c09012SAndroid Build Coastguard Worker    // `destination_service_name` metric label in Istio metrics.
87*d5c09012SAndroid Build Coastguard Worker    string service_name = 4;
88*d5c09012SAndroid Build Coastguard Worker  }
89*d5c09012SAndroid Build Coastguard Worker
90*d5c09012SAndroid Build Coastguard Worker  // Istio service scoped to an Istio mesh. Anthos clusters running ASM < 1.6.8
91*d5c09012SAndroid Build Coastguard Worker  // will have their services ingested as this type.
92*d5c09012SAndroid Build Coastguard Worker  message MeshIstio {
93*d5c09012SAndroid Build Coastguard Worker    // Identifier for the mesh in which this Istio service is defined.
94*d5c09012SAndroid Build Coastguard Worker    // Corresponds to the `mesh_uid` metric label in Istio metrics.
95*d5c09012SAndroid Build Coastguard Worker    string mesh_uid = 1;
96*d5c09012SAndroid Build Coastguard Worker
97*d5c09012SAndroid Build Coastguard Worker    // The namespace of the Istio service underlying this service. Corresponds
98*d5c09012SAndroid Build Coastguard Worker    // to the `destination_service_namespace` metric label in Istio metrics.
99*d5c09012SAndroid Build Coastguard Worker    string service_namespace = 3;
100*d5c09012SAndroid Build Coastguard Worker
101*d5c09012SAndroid Build Coastguard Worker    // The name of the Istio service underlying this service. Corresponds to the
102*d5c09012SAndroid Build Coastguard Worker    // `destination_service_name` metric label in Istio metrics.
103*d5c09012SAndroid Build Coastguard Worker    string service_name = 4;
104*d5c09012SAndroid Build Coastguard Worker  }
105*d5c09012SAndroid Build Coastguard Worker
106*d5c09012SAndroid Build Coastguard Worker  // Canonical service scoped to an Istio mesh. Anthos clusters running ASM >=
107*d5c09012SAndroid Build Coastguard Worker  // 1.6.8 will have their services ingested as this type.
108*d5c09012SAndroid Build Coastguard Worker  message IstioCanonicalService {
109*d5c09012SAndroid Build Coastguard Worker    // Identifier for the Istio mesh in which this canonical service is defined.
110*d5c09012SAndroid Build Coastguard Worker    // Corresponds to the `mesh_uid` metric label in
111*d5c09012SAndroid Build Coastguard Worker    // [Istio metrics](https://cloud.google.com/monitoring/api/metrics_istio).
112*d5c09012SAndroid Build Coastguard Worker    string mesh_uid = 1;
113*d5c09012SAndroid Build Coastguard Worker
114*d5c09012SAndroid Build Coastguard Worker    // The namespace of the canonical service underlying this service.
115*d5c09012SAndroid Build Coastguard Worker    // Corresponds to the `destination_canonical_service_namespace` metric
116*d5c09012SAndroid Build Coastguard Worker    // label in [Istio
117*d5c09012SAndroid Build Coastguard Worker    // metrics](https://cloud.google.com/monitoring/api/metrics_istio).
118*d5c09012SAndroid Build Coastguard Worker    string canonical_service_namespace = 3;
119*d5c09012SAndroid Build Coastguard Worker
120*d5c09012SAndroid Build Coastguard Worker    // The name of the canonical service underlying this service.
121*d5c09012SAndroid Build Coastguard Worker    // Corresponds to the `destination_canonical_service_name` metric label in
122*d5c09012SAndroid Build Coastguard Worker    // label in [Istio
123*d5c09012SAndroid Build Coastguard Worker    // metrics](https://cloud.google.com/monitoring/api/metrics_istio).
124*d5c09012SAndroid Build Coastguard Worker    string canonical_service = 4;
125*d5c09012SAndroid Build Coastguard Worker  }
126*d5c09012SAndroid Build Coastguard Worker
127*d5c09012SAndroid Build Coastguard Worker  // Cloud Run service. Learn more at https://cloud.google.com/run.
128*d5c09012SAndroid Build Coastguard Worker  message CloudRun {
129*d5c09012SAndroid Build Coastguard Worker    // The name of the Cloud Run service. Corresponds to the `service_name`
130*d5c09012SAndroid Build Coastguard Worker    // resource label in the [`cloud_run_revision` monitored
131*d5c09012SAndroid Build Coastguard Worker    // resource](https://cloud.google.com/monitoring/api/resources#tag_cloud_run_revision).
132*d5c09012SAndroid Build Coastguard Worker    string service_name = 1;
133*d5c09012SAndroid Build Coastguard Worker
134*d5c09012SAndroid Build Coastguard Worker    // The location the service is run. Corresponds to the `location`
135*d5c09012SAndroid Build Coastguard Worker    // resource label in the [`cloud_run_revision` monitored
136*d5c09012SAndroid Build Coastguard Worker    // resource](https://cloud.google.com/monitoring/api/resources#tag_cloud_run_revision).
137*d5c09012SAndroid Build Coastguard Worker    string location = 2;
138*d5c09012SAndroid Build Coastguard Worker  }
139*d5c09012SAndroid Build Coastguard Worker
140*d5c09012SAndroid Build Coastguard Worker  // GKE Namespace. The field names correspond to the resource metadata labels
141*d5c09012SAndroid Build Coastguard Worker  // on monitored resources that fall under a namespace (for example,
142*d5c09012SAndroid Build Coastguard Worker  // `k8s_container` or `k8s_pod`).
143*d5c09012SAndroid Build Coastguard Worker  message GkeNamespace {
144*d5c09012SAndroid Build Coastguard Worker    // Output only. The project this resource lives in. For legacy services
145*d5c09012SAndroid Build Coastguard Worker    // migrated from the `Custom` type, this may be a distinct project from the
146*d5c09012SAndroid Build Coastguard Worker    // one parenting the service itself.
147*d5c09012SAndroid Build Coastguard Worker    string project_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
148*d5c09012SAndroid Build Coastguard Worker
149*d5c09012SAndroid Build Coastguard Worker    // The location of the parent cluster. This may be a zone or region.
150*d5c09012SAndroid Build Coastguard Worker    string location = 2;
151*d5c09012SAndroid Build Coastguard Worker
152*d5c09012SAndroid Build Coastguard Worker    // The name of the parent cluster.
153*d5c09012SAndroid Build Coastguard Worker    string cluster_name = 3;
154*d5c09012SAndroid Build Coastguard Worker
155*d5c09012SAndroid Build Coastguard Worker    // The name of this namespace.
156*d5c09012SAndroid Build Coastguard Worker    string namespace_name = 4;
157*d5c09012SAndroid Build Coastguard Worker  }
158*d5c09012SAndroid Build Coastguard Worker
159*d5c09012SAndroid Build Coastguard Worker  // A GKE Workload (Deployment, StatefulSet, etc). The field names correspond
160*d5c09012SAndroid Build Coastguard Worker  // to the metadata labels on monitored resources that fall under a workload
161*d5c09012SAndroid Build Coastguard Worker  // (for example, `k8s_container` or `k8s_pod`).
162*d5c09012SAndroid Build Coastguard Worker  message GkeWorkload {
163*d5c09012SAndroid Build Coastguard Worker    // Output only. The project this resource lives in. For legacy services
164*d5c09012SAndroid Build Coastguard Worker    // migrated from the `Custom` type, this may be a distinct project from the
165*d5c09012SAndroid Build Coastguard Worker    // one parenting the service itself.
166*d5c09012SAndroid Build Coastguard Worker    string project_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
167*d5c09012SAndroid Build Coastguard Worker
168*d5c09012SAndroid Build Coastguard Worker    // The location of the parent cluster. This may be a zone or region.
169*d5c09012SAndroid Build Coastguard Worker    string location = 2;
170*d5c09012SAndroid Build Coastguard Worker
171*d5c09012SAndroid Build Coastguard Worker    // The name of the parent cluster.
172*d5c09012SAndroid Build Coastguard Worker    string cluster_name = 3;
173*d5c09012SAndroid Build Coastguard Worker
174*d5c09012SAndroid Build Coastguard Worker    // The name of the parent namespace.
175*d5c09012SAndroid Build Coastguard Worker    string namespace_name = 4;
176*d5c09012SAndroid Build Coastguard Worker
177*d5c09012SAndroid Build Coastguard Worker    // The type of this workload (for example, "Deployment" or "DaemonSet")
178*d5c09012SAndroid Build Coastguard Worker    string top_level_controller_type = 5;
179*d5c09012SAndroid Build Coastguard Worker
180*d5c09012SAndroid Build Coastguard Worker    // The name of this workload.
181*d5c09012SAndroid Build Coastguard Worker    string top_level_controller_name = 6;
182*d5c09012SAndroid Build Coastguard Worker  }
183*d5c09012SAndroid Build Coastguard Worker
184*d5c09012SAndroid Build Coastguard Worker  // GKE Service. The "service" here represents a
185*d5c09012SAndroid Build Coastguard Worker  // [Kubernetes service
186*d5c09012SAndroid Build Coastguard Worker  // object](https://kubernetes.io/docs/concepts/services-networking/service).
187*d5c09012SAndroid Build Coastguard Worker  // The field names correspond to the resource labels on [`k8s_service`
188*d5c09012SAndroid Build Coastguard Worker  // monitored
189*d5c09012SAndroid Build Coastguard Worker  // resources](https://cloud.google.com/monitoring/api/resources#tag_k8s_service).
190*d5c09012SAndroid Build Coastguard Worker  message GkeService {
191*d5c09012SAndroid Build Coastguard Worker    // Output only. The project this resource lives in. For legacy services
192*d5c09012SAndroid Build Coastguard Worker    // migrated from the `Custom` type, this may be a distinct project from the
193*d5c09012SAndroid Build Coastguard Worker    // one parenting the service itself.
194*d5c09012SAndroid Build Coastguard Worker    string project_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
195*d5c09012SAndroid Build Coastguard Worker
196*d5c09012SAndroid Build Coastguard Worker    // The location of the parent cluster. This may be a zone or region.
197*d5c09012SAndroid Build Coastguard Worker    string location = 2;
198*d5c09012SAndroid Build Coastguard Worker
199*d5c09012SAndroid Build Coastguard Worker    // The name of the parent cluster.
200*d5c09012SAndroid Build Coastguard Worker    string cluster_name = 3;
201*d5c09012SAndroid Build Coastguard Worker
202*d5c09012SAndroid Build Coastguard Worker    // The name of the parent namespace.
203*d5c09012SAndroid Build Coastguard Worker    string namespace_name = 4;
204*d5c09012SAndroid Build Coastguard Worker
205*d5c09012SAndroid Build Coastguard Worker    // The name of this service.
206*d5c09012SAndroid Build Coastguard Worker    string service_name = 5;
207*d5c09012SAndroid Build Coastguard Worker  }
208*d5c09012SAndroid Build Coastguard Worker
209*d5c09012SAndroid Build Coastguard Worker  // A well-known service type, defined by its service type and service labels.
210*d5c09012SAndroid Build Coastguard Worker  // Documentation and examples
211*d5c09012SAndroid Build Coastguard Worker  // [here](https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli).
212*d5c09012SAndroid Build Coastguard Worker  message BasicService {
213*d5c09012SAndroid Build Coastguard Worker    // The type of service that this basic service defines, e.g.
214*d5c09012SAndroid Build Coastguard Worker    // APP_ENGINE service type.
215*d5c09012SAndroid Build Coastguard Worker    // Documentation and valid values
216*d5c09012SAndroid Build Coastguard Worker    // [here](https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli).
217*d5c09012SAndroid Build Coastguard Worker    string service_type = 1;
218*d5c09012SAndroid Build Coastguard Worker
219*d5c09012SAndroid Build Coastguard Worker    // Labels that specify the resource that emits the monitoring data which
220*d5c09012SAndroid Build Coastguard Worker    // is used for SLO reporting of this `Service`.
221*d5c09012SAndroid Build Coastguard Worker    // Documentation and valid values for given service types
222*d5c09012SAndroid Build Coastguard Worker    // [here](https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli).
223*d5c09012SAndroid Build Coastguard Worker    map<string, string> service_labels = 2;
224*d5c09012SAndroid Build Coastguard Worker  }
225*d5c09012SAndroid Build Coastguard Worker
226*d5c09012SAndroid Build Coastguard Worker  // Configuration for how to query telemetry on a Service.
227*d5c09012SAndroid Build Coastguard Worker  message Telemetry {
228*d5c09012SAndroid Build Coastguard Worker    // The full name of the resource that defines this service. Formatted as
229*d5c09012SAndroid Build Coastguard Worker    // described in https://cloud.google.com/apis/design/resource_names.
230*d5c09012SAndroid Build Coastguard Worker    string resource_name = 1;
231*d5c09012SAndroid Build Coastguard Worker  }
232*d5c09012SAndroid Build Coastguard Worker
233*d5c09012SAndroid Build Coastguard Worker  // Identifier. Resource name for this Service. The format is:
234*d5c09012SAndroid Build Coastguard Worker  //
235*d5c09012SAndroid Build Coastguard Worker  //     projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]
236*d5c09012SAndroid Build Coastguard Worker  string name = 1 [(google.api.field_behavior) = IDENTIFIER];
237*d5c09012SAndroid Build Coastguard Worker
238*d5c09012SAndroid Build Coastguard Worker  // Name used for UI elements listing this Service.
239*d5c09012SAndroid Build Coastguard Worker  string display_name = 2;
240*d5c09012SAndroid Build Coastguard Worker
241*d5c09012SAndroid Build Coastguard Worker  // REQUIRED. Service-identifying atoms specifying the underlying service.
242*d5c09012SAndroid Build Coastguard Worker  oneof identifier {
243*d5c09012SAndroid Build Coastguard Worker    // Custom service type.
244*d5c09012SAndroid Build Coastguard Worker    Custom custom = 6;
245*d5c09012SAndroid Build Coastguard Worker
246*d5c09012SAndroid Build Coastguard Worker    // Type used for App Engine services.
247*d5c09012SAndroid Build Coastguard Worker    AppEngine app_engine = 7;
248*d5c09012SAndroid Build Coastguard Worker
249*d5c09012SAndroid Build Coastguard Worker    // Type used for Cloud Endpoints services.
250*d5c09012SAndroid Build Coastguard Worker    CloudEndpoints cloud_endpoints = 8;
251*d5c09012SAndroid Build Coastguard Worker
252*d5c09012SAndroid Build Coastguard Worker    // Type used for Istio services that live in a Kubernetes cluster.
253*d5c09012SAndroid Build Coastguard Worker    ClusterIstio cluster_istio = 9;
254*d5c09012SAndroid Build Coastguard Worker
255*d5c09012SAndroid Build Coastguard Worker    // Type used for Istio services scoped to an Istio mesh.
256*d5c09012SAndroid Build Coastguard Worker    MeshIstio mesh_istio = 10;
257*d5c09012SAndroid Build Coastguard Worker
258*d5c09012SAndroid Build Coastguard Worker    // Type used for canonical services scoped to an Istio mesh.
259*d5c09012SAndroid Build Coastguard Worker    // Metrics for Istio are
260*d5c09012SAndroid Build Coastguard Worker    // [documented here](https://istio.io/latest/docs/reference/config/metrics/)
261*d5c09012SAndroid Build Coastguard Worker    IstioCanonicalService istio_canonical_service = 11;
262*d5c09012SAndroid Build Coastguard Worker
263*d5c09012SAndroid Build Coastguard Worker    // Type used for Cloud Run services.
264*d5c09012SAndroid Build Coastguard Worker    CloudRun cloud_run = 12;
265*d5c09012SAndroid Build Coastguard Worker
266*d5c09012SAndroid Build Coastguard Worker    // Type used for GKE Namespaces.
267*d5c09012SAndroid Build Coastguard Worker    GkeNamespace gke_namespace = 15;
268*d5c09012SAndroid Build Coastguard Worker
269*d5c09012SAndroid Build Coastguard Worker    // Type used for GKE Workloads.
270*d5c09012SAndroid Build Coastguard Worker    GkeWorkload gke_workload = 16;
271*d5c09012SAndroid Build Coastguard Worker
272*d5c09012SAndroid Build Coastguard Worker    // Type used for GKE Services (the Kubernetes concept of a service).
273*d5c09012SAndroid Build Coastguard Worker    GkeService gke_service = 17;
274*d5c09012SAndroid Build Coastguard Worker  }
275*d5c09012SAndroid Build Coastguard Worker
276*d5c09012SAndroid Build Coastguard Worker  // Message that contains the service type and service labels of this service
277*d5c09012SAndroid Build Coastguard Worker  // if it is a basic service.
278*d5c09012SAndroid Build Coastguard Worker  // Documentation and examples
279*d5c09012SAndroid Build Coastguard Worker  // [here](https://cloud.google.com/stackdriver/docs/solutions/slo-monitoring/api/api-structures#basic-svc-w-basic-sli).
280*d5c09012SAndroid Build Coastguard Worker  BasicService basic_service = 19;
281*d5c09012SAndroid Build Coastguard Worker
282*d5c09012SAndroid Build Coastguard Worker  // Configuration for how to query telemetry on a Service.
283*d5c09012SAndroid Build Coastguard Worker  Telemetry telemetry = 13;
284*d5c09012SAndroid Build Coastguard Worker
285*d5c09012SAndroid Build Coastguard Worker  // Labels which have been used to annotate the service. Label keys must start
286*d5c09012SAndroid Build Coastguard Worker  // with a letter. Label keys and values may contain lowercase letters,
287*d5c09012SAndroid Build Coastguard Worker  // numbers, underscores, and dashes. Label keys and values have a maximum
288*d5c09012SAndroid Build Coastguard Worker  // length of 63 characters, and must be less than 128 bytes in size. Up to 64
289*d5c09012SAndroid Build Coastguard Worker  // label entries may be stored. For labels which do not have a semantic value,
290*d5c09012SAndroid Build Coastguard Worker  // the empty string may be supplied for the label value.
291*d5c09012SAndroid Build Coastguard Worker  map<string, string> user_labels = 14;
292*d5c09012SAndroid Build Coastguard Worker}
293*d5c09012SAndroid Build Coastguard Worker
294*d5c09012SAndroid Build Coastguard Worker// A Service-Level Objective (SLO) describes a level of desired good service. It
295*d5c09012SAndroid Build Coastguard Worker// consists of a service-level indicator (SLI), a performance goal, and a period
296*d5c09012SAndroid Build Coastguard Worker// over which the objective is to be evaluated against that goal. The SLO can
297*d5c09012SAndroid Build Coastguard Worker// use SLIs defined in a number of different manners. Typical SLOs might include
298*d5c09012SAndroid Build Coastguard Worker// "99% of requests in each rolling week have latency below 200 milliseconds" or
299*d5c09012SAndroid Build Coastguard Worker// "99.5% of requests in each calendar month return successfully."
300*d5c09012SAndroid Build Coastguard Workermessage ServiceLevelObjective {
301*d5c09012SAndroid Build Coastguard Worker  option (google.api.resource) = {
302*d5c09012SAndroid Build Coastguard Worker    type: "monitoring.googleapis.com/ServiceLevelObjective"
303*d5c09012SAndroid Build Coastguard Worker    pattern: "projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}"
304*d5c09012SAndroid Build Coastguard Worker    pattern: "organizations/{organization}/services/{service}/serviceLevelObjectives/{service_level_objective}"
305*d5c09012SAndroid Build Coastguard Worker    pattern: "folders/{folder}/services/{service}/serviceLevelObjectives/{service_level_objective}"
306*d5c09012SAndroid Build Coastguard Worker    pattern: "*"
307*d5c09012SAndroid Build Coastguard Worker    history: ORIGINALLY_SINGLE_PATTERN
308*d5c09012SAndroid Build Coastguard Worker  };
309*d5c09012SAndroid Build Coastguard Worker
310*d5c09012SAndroid Build Coastguard Worker  // `ServiceLevelObjective.View` determines what form of
311*d5c09012SAndroid Build Coastguard Worker  // `ServiceLevelObjective` is returned from `GetServiceLevelObjective`,
312*d5c09012SAndroid Build Coastguard Worker  // `ListServiceLevelObjectives`, and `ListServiceLevelObjectiveVersions` RPCs.
313*d5c09012SAndroid Build Coastguard Worker  enum View {
314*d5c09012SAndroid Build Coastguard Worker    // Same as FULL.
315*d5c09012SAndroid Build Coastguard Worker    VIEW_UNSPECIFIED = 0;
316*d5c09012SAndroid Build Coastguard Worker
317*d5c09012SAndroid Build Coastguard Worker    // Return the embedded `ServiceLevelIndicator` in the form in which it was
318*d5c09012SAndroid Build Coastguard Worker    // defined. If it was defined using a `BasicSli`, return that `BasicSli`.
319*d5c09012SAndroid Build Coastguard Worker    FULL = 2;
320*d5c09012SAndroid Build Coastguard Worker
321*d5c09012SAndroid Build Coastguard Worker    // For `ServiceLevelIndicator`s using `BasicSli` articulation, instead
322*d5c09012SAndroid Build Coastguard Worker    // return the `ServiceLevelIndicator` with its mode of computation fully
323*d5c09012SAndroid Build Coastguard Worker    // spelled out as a `RequestBasedSli`. For `ServiceLevelIndicator`s using
324*d5c09012SAndroid Build Coastguard Worker    // `RequestBasedSli` or `WindowsBasedSli`, return the
325*d5c09012SAndroid Build Coastguard Worker    // `ServiceLevelIndicator` as it was provided.
326*d5c09012SAndroid Build Coastguard Worker    EXPLICIT = 1;
327*d5c09012SAndroid Build Coastguard Worker  }
328*d5c09012SAndroid Build Coastguard Worker
329*d5c09012SAndroid Build Coastguard Worker  // Identifier. Resource name for this `ServiceLevelObjective`. The format is:
330*d5c09012SAndroid Build Coastguard Worker  //
331*d5c09012SAndroid Build Coastguard Worker  //     projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME]
332*d5c09012SAndroid Build Coastguard Worker  string name = 1 [(google.api.field_behavior) = IDENTIFIER];
333*d5c09012SAndroid Build Coastguard Worker
334*d5c09012SAndroid Build Coastguard Worker  // Name used for UI elements listing this SLO.
335*d5c09012SAndroid Build Coastguard Worker  string display_name = 11;
336*d5c09012SAndroid Build Coastguard Worker
337*d5c09012SAndroid Build Coastguard Worker  // The definition of good service, used to measure and calculate the quality
338*d5c09012SAndroid Build Coastguard Worker  // of the `Service`'s performance with respect to a single aspect of service
339*d5c09012SAndroid Build Coastguard Worker  // quality.
340*d5c09012SAndroid Build Coastguard Worker  ServiceLevelIndicator service_level_indicator = 3;
341*d5c09012SAndroid Build Coastguard Worker
342*d5c09012SAndroid Build Coastguard Worker  // The fraction of service that must be good in order for this objective to be
343*d5c09012SAndroid Build Coastguard Worker  // met. `0 < goal <= 0.999`.
344*d5c09012SAndroid Build Coastguard Worker  double goal = 4;
345*d5c09012SAndroid Build Coastguard Worker
346*d5c09012SAndroid Build Coastguard Worker  // The time period over which the objective will be evaluated.
347*d5c09012SAndroid Build Coastguard Worker  oneof period {
348*d5c09012SAndroid Build Coastguard Worker    // A rolling time period, semantically "in the past `<rolling_period>`".
349*d5c09012SAndroid Build Coastguard Worker    // Must be an integer multiple of 1 day no larger than 30 days.
350*d5c09012SAndroid Build Coastguard Worker    google.protobuf.Duration rolling_period = 5;
351*d5c09012SAndroid Build Coastguard Worker
352*d5c09012SAndroid Build Coastguard Worker    // A calendar period, semantically "since the start of the current
353*d5c09012SAndroid Build Coastguard Worker    // `<calendar_period>`". At this time, only `DAY`, `WEEK`, `FORTNIGHT`, and
354*d5c09012SAndroid Build Coastguard Worker    // `MONTH` are supported.
355*d5c09012SAndroid Build Coastguard Worker    google.type.CalendarPeriod calendar_period = 6;
356*d5c09012SAndroid Build Coastguard Worker  }
357*d5c09012SAndroid Build Coastguard Worker
358*d5c09012SAndroid Build Coastguard Worker  // Labels which have been used to annotate the service-level objective. Label
359*d5c09012SAndroid Build Coastguard Worker  // keys must start with a letter. Label keys and values may contain lowercase
360*d5c09012SAndroid Build Coastguard Worker  // letters, numbers, underscores, and dashes. Label keys and values have a
361*d5c09012SAndroid Build Coastguard Worker  // maximum length of 63 characters, and must be less than 128 bytes in size.
362*d5c09012SAndroid Build Coastguard Worker  // Up to 64 label entries may be stored. For labels which do not have a
363*d5c09012SAndroid Build Coastguard Worker  // semantic value, the empty string may be supplied for the label value.
364*d5c09012SAndroid Build Coastguard Worker  map<string, string> user_labels = 12;
365*d5c09012SAndroid Build Coastguard Worker}
366*d5c09012SAndroid Build Coastguard Worker
367*d5c09012SAndroid Build Coastguard Worker// A Service-Level Indicator (SLI) describes the "performance" of a service. For
368*d5c09012SAndroid Build Coastguard Worker// some services, the SLI is well-defined. In such cases, the SLI can be
369*d5c09012SAndroid Build Coastguard Worker// described easily by referencing the well-known SLI and providing the needed
370*d5c09012SAndroid Build Coastguard Worker// parameters. Alternatively, a "custom" SLI can be defined with a query to the
371*d5c09012SAndroid Build Coastguard Worker// underlying metric store. An SLI is defined to be `good_service /
372*d5c09012SAndroid Build Coastguard Worker// total_service` over any queried time interval. The value of performance
373*d5c09012SAndroid Build Coastguard Worker// always falls into the range `0 <= performance <= 1`. A custom SLI describes
374*d5c09012SAndroid Build Coastguard Worker// how to compute this ratio, whether this is by dividing values from a pair of
375*d5c09012SAndroid Build Coastguard Worker// time series, cutting a `Distribution` into good and bad counts, or counting
376*d5c09012SAndroid Build Coastguard Worker// time windows in which the service complies with a criterion. For separation
377*d5c09012SAndroid Build Coastguard Worker// of concerns, a single Service-Level Indicator measures performance for only
378*d5c09012SAndroid Build Coastguard Worker// one aspect of service quality, such as fraction of successful queries or
379*d5c09012SAndroid Build Coastguard Worker// fast-enough queries.
380*d5c09012SAndroid Build Coastguard Workermessage ServiceLevelIndicator {
381*d5c09012SAndroid Build Coastguard Worker  // Service level indicators can be grouped by whether the "unit" of service
382*d5c09012SAndroid Build Coastguard Worker  // being measured is based on counts of good requests or on counts of good
383*d5c09012SAndroid Build Coastguard Worker  // time windows
384*d5c09012SAndroid Build Coastguard Worker  oneof type {
385*d5c09012SAndroid Build Coastguard Worker    // Basic SLI on a well-known service type.
386*d5c09012SAndroid Build Coastguard Worker    BasicSli basic_sli = 4;
387*d5c09012SAndroid Build Coastguard Worker
388*d5c09012SAndroid Build Coastguard Worker    // Request-based SLIs
389*d5c09012SAndroid Build Coastguard Worker    RequestBasedSli request_based = 1;
390*d5c09012SAndroid Build Coastguard Worker
391*d5c09012SAndroid Build Coastguard Worker    // Windows-based SLIs
392*d5c09012SAndroid Build Coastguard Worker    WindowsBasedSli windows_based = 2;
393*d5c09012SAndroid Build Coastguard Worker  }
394*d5c09012SAndroid Build Coastguard Worker}
395*d5c09012SAndroid Build Coastguard Worker
396*d5c09012SAndroid Build Coastguard Worker// An SLI measuring performance on a well-known service type. Performance will
397*d5c09012SAndroid Build Coastguard Worker// be computed on the basis of pre-defined metrics. The type of the
398*d5c09012SAndroid Build Coastguard Worker// `service_resource` determines the metrics to use and the
399*d5c09012SAndroid Build Coastguard Worker// `service_resource.labels` and `metric_labels` are used to construct a
400*d5c09012SAndroid Build Coastguard Worker// monitoring filter to filter that metric down to just the data relevant to
401*d5c09012SAndroid Build Coastguard Worker// this service.
402*d5c09012SAndroid Build Coastguard Workermessage BasicSli {
403*d5c09012SAndroid Build Coastguard Worker  // Future parameters for the availability SLI.
404*d5c09012SAndroid Build Coastguard Worker  message AvailabilityCriteria {}
405*d5c09012SAndroid Build Coastguard Worker
406*d5c09012SAndroid Build Coastguard Worker  // Parameters for a latency threshold SLI.
407*d5c09012SAndroid Build Coastguard Worker  message LatencyCriteria {
408*d5c09012SAndroid Build Coastguard Worker    // Good service is defined to be the count of requests made to this service
409*d5c09012SAndroid Build Coastguard Worker    // that return in no more than `threshold`.
410*d5c09012SAndroid Build Coastguard Worker    google.protobuf.Duration threshold = 3;
411*d5c09012SAndroid Build Coastguard Worker  }
412*d5c09012SAndroid Build Coastguard Worker
413*d5c09012SAndroid Build Coastguard Worker  // OPTIONAL: The set of RPCs to which this SLI is relevant. Telemetry from
414*d5c09012SAndroid Build Coastguard Worker  // other methods will not be used to calculate performance for this SLI. If
415*d5c09012SAndroid Build Coastguard Worker  // omitted, this SLI applies to all the Service's methods. For service types
416*d5c09012SAndroid Build Coastguard Worker  // that don't support breaking down by method, setting this field will result
417*d5c09012SAndroid Build Coastguard Worker  // in an error.
418*d5c09012SAndroid Build Coastguard Worker  repeated string method = 7;
419*d5c09012SAndroid Build Coastguard Worker
420*d5c09012SAndroid Build Coastguard Worker  // OPTIONAL: The set of locations to which this SLI is relevant. Telemetry
421*d5c09012SAndroid Build Coastguard Worker  // from other locations will not be used to calculate performance for this
422*d5c09012SAndroid Build Coastguard Worker  // SLI. If omitted, this SLI applies to all locations in which the Service has
423*d5c09012SAndroid Build Coastguard Worker  // activity. For service types that don't support breaking down by location,
424*d5c09012SAndroid Build Coastguard Worker  // setting this field will result in an error.
425*d5c09012SAndroid Build Coastguard Worker  repeated string location = 8;
426*d5c09012SAndroid Build Coastguard Worker
427*d5c09012SAndroid Build Coastguard Worker  // OPTIONAL: The set of API versions to which this SLI is relevant. Telemetry
428*d5c09012SAndroid Build Coastguard Worker  // from other API versions will not be used to calculate performance for this
429*d5c09012SAndroid Build Coastguard Worker  // SLI. If omitted, this SLI applies to all API versions. For service types
430*d5c09012SAndroid Build Coastguard Worker  // that don't support breaking down by version, setting this field will result
431*d5c09012SAndroid Build Coastguard Worker  // in an error.
432*d5c09012SAndroid Build Coastguard Worker  repeated string version = 9;
433*d5c09012SAndroid Build Coastguard Worker
434*d5c09012SAndroid Build Coastguard Worker  // This SLI can be evaluated on the basis of availability or latency.
435*d5c09012SAndroid Build Coastguard Worker  oneof sli_criteria {
436*d5c09012SAndroid Build Coastguard Worker    // Good service is defined to be the count of requests made to this service
437*d5c09012SAndroid Build Coastguard Worker    // that return successfully.
438*d5c09012SAndroid Build Coastguard Worker    AvailabilityCriteria availability = 2;
439*d5c09012SAndroid Build Coastguard Worker
440*d5c09012SAndroid Build Coastguard Worker    // Good service is defined to be the count of requests made to this service
441*d5c09012SAndroid Build Coastguard Worker    // that are fast enough with respect to `latency.threshold`.
442*d5c09012SAndroid Build Coastguard Worker    LatencyCriteria latency = 3;
443*d5c09012SAndroid Build Coastguard Worker  }
444*d5c09012SAndroid Build Coastguard Worker}
445*d5c09012SAndroid Build Coastguard Worker
446*d5c09012SAndroid Build Coastguard Worker// Range of numerical values within `min` and `max`.
447*d5c09012SAndroid Build Coastguard Workermessage Range {
448*d5c09012SAndroid Build Coastguard Worker  // Range minimum.
449*d5c09012SAndroid Build Coastguard Worker  double min = 1;
450*d5c09012SAndroid Build Coastguard Worker
451*d5c09012SAndroid Build Coastguard Worker  // Range maximum.
452*d5c09012SAndroid Build Coastguard Worker  double max = 2;
453*d5c09012SAndroid Build Coastguard Worker}
454*d5c09012SAndroid Build Coastguard Worker
455*d5c09012SAndroid Build Coastguard Worker// Service Level Indicators for which atomic units of service are counted
456*d5c09012SAndroid Build Coastguard Worker// directly.
457*d5c09012SAndroid Build Coastguard Workermessage RequestBasedSli {
458*d5c09012SAndroid Build Coastguard Worker  // The means to compute a ratio of `good_service` to `total_service`.
459*d5c09012SAndroid Build Coastguard Worker  oneof method {
460*d5c09012SAndroid Build Coastguard Worker    // `good_total_ratio` is used when the ratio of `good_service` to
461*d5c09012SAndroid Build Coastguard Worker    // `total_service` is computed from two `TimeSeries`.
462*d5c09012SAndroid Build Coastguard Worker    TimeSeriesRatio good_total_ratio = 1;
463*d5c09012SAndroid Build Coastguard Worker
464*d5c09012SAndroid Build Coastguard Worker    // `distribution_cut` is used when `good_service` is a count of values
465*d5c09012SAndroid Build Coastguard Worker    // aggregated in a `Distribution` that fall into a good range. The
466*d5c09012SAndroid Build Coastguard Worker    // `total_service` is the total count of all values aggregated in the
467*d5c09012SAndroid Build Coastguard Worker    // `Distribution`.
468*d5c09012SAndroid Build Coastguard Worker    DistributionCut distribution_cut = 3;
469*d5c09012SAndroid Build Coastguard Worker  }
470*d5c09012SAndroid Build Coastguard Worker}
471*d5c09012SAndroid Build Coastguard Worker
472*d5c09012SAndroid Build Coastguard Worker// A `TimeSeriesRatio` specifies two `TimeSeries` to use for computing the
473*d5c09012SAndroid Build Coastguard Worker// `good_service / total_service` ratio. The specified `TimeSeries` must have
474*d5c09012SAndroid Build Coastguard Worker// `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
475*d5c09012SAndroid Build Coastguard Worker// DELTA` or `MetricKind = CUMULATIVE`. The `TimeSeriesRatio` must specify
476*d5c09012SAndroid Build Coastguard Worker// exactly two of good, bad, and total, and the relationship `good_service +
477*d5c09012SAndroid Build Coastguard Worker// bad_service = total_service` will be assumed.
478*d5c09012SAndroid Build Coastguard Workermessage TimeSeriesRatio {
479*d5c09012SAndroid Build Coastguard Worker  // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
480*d5c09012SAndroid Build Coastguard Worker  // specifying a `TimeSeries` quantifying good service provided. Must have
481*d5c09012SAndroid Build Coastguard Worker  // `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
482*d5c09012SAndroid Build Coastguard Worker  // DELTA` or `MetricKind = CUMULATIVE`.
483*d5c09012SAndroid Build Coastguard Worker  string good_service_filter = 4;
484*d5c09012SAndroid Build Coastguard Worker
485*d5c09012SAndroid Build Coastguard Worker  // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
486*d5c09012SAndroid Build Coastguard Worker  // specifying a `TimeSeries` quantifying bad service, either demanded service
487*d5c09012SAndroid Build Coastguard Worker  // that was not provided or demanded service that was of inadequate quality.
488*d5c09012SAndroid Build Coastguard Worker  // Must have `ValueType = DOUBLE` or `ValueType = INT64` and must have
489*d5c09012SAndroid Build Coastguard Worker  // `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
490*d5c09012SAndroid Build Coastguard Worker  string bad_service_filter = 5;
491*d5c09012SAndroid Build Coastguard Worker
492*d5c09012SAndroid Build Coastguard Worker  // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
493*d5c09012SAndroid Build Coastguard Worker  // specifying a `TimeSeries` quantifying total demanded service. Must have
494*d5c09012SAndroid Build Coastguard Worker  // `ValueType = DOUBLE` or `ValueType = INT64` and must have `MetricKind =
495*d5c09012SAndroid Build Coastguard Worker  // DELTA` or `MetricKind = CUMULATIVE`.
496*d5c09012SAndroid Build Coastguard Worker  string total_service_filter = 6;
497*d5c09012SAndroid Build Coastguard Worker}
498*d5c09012SAndroid Build Coastguard Worker
499*d5c09012SAndroid Build Coastguard Worker// A `DistributionCut` defines a `TimeSeries` and thresholds used for measuring
500*d5c09012SAndroid Build Coastguard Worker// good service and total service. The `TimeSeries` must have `ValueType =
501*d5c09012SAndroid Build Coastguard Worker// DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`. The
502*d5c09012SAndroid Build Coastguard Worker// computed `good_service` will be the estimated count of values in the
503*d5c09012SAndroid Build Coastguard Worker// `Distribution` that fall within the specified `min` and `max`.
504*d5c09012SAndroid Build Coastguard Workermessage DistributionCut {
505*d5c09012SAndroid Build Coastguard Worker  // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
506*d5c09012SAndroid Build Coastguard Worker  // specifying a `TimeSeries` aggregating values. Must have `ValueType =
507*d5c09012SAndroid Build Coastguard Worker  // DISTRIBUTION` and `MetricKind = DELTA` or `MetricKind = CUMULATIVE`.
508*d5c09012SAndroid Build Coastguard Worker  string distribution_filter = 4;
509*d5c09012SAndroid Build Coastguard Worker
510*d5c09012SAndroid Build Coastguard Worker  // Range of values considered "good." For a one-sided range, set one bound to
511*d5c09012SAndroid Build Coastguard Worker  // an infinite value.
512*d5c09012SAndroid Build Coastguard Worker  Range range = 5;
513*d5c09012SAndroid Build Coastguard Worker}
514*d5c09012SAndroid Build Coastguard Worker
515*d5c09012SAndroid Build Coastguard Worker// A `WindowsBasedSli` defines `good_service` as the count of time windows for
516*d5c09012SAndroid Build Coastguard Worker// which the provided service was of good quality. Criteria for determining
517*d5c09012SAndroid Build Coastguard Worker// if service was good are embedded in the `window_criterion`.
518*d5c09012SAndroid Build Coastguard Workermessage WindowsBasedSli {
519*d5c09012SAndroid Build Coastguard Worker  // A `PerformanceThreshold` is used when each window is good when that window
520*d5c09012SAndroid Build Coastguard Worker  // has a sufficiently high `performance`.
521*d5c09012SAndroid Build Coastguard Worker  message PerformanceThreshold {
522*d5c09012SAndroid Build Coastguard Worker    // The means, either a request-based SLI or a basic SLI, by which to compute
523*d5c09012SAndroid Build Coastguard Worker    // performance over a window.
524*d5c09012SAndroid Build Coastguard Worker    oneof type {
525*d5c09012SAndroid Build Coastguard Worker      // `RequestBasedSli` to evaluate to judge window quality.
526*d5c09012SAndroid Build Coastguard Worker      RequestBasedSli performance = 1;
527*d5c09012SAndroid Build Coastguard Worker
528*d5c09012SAndroid Build Coastguard Worker      // `BasicSli` to evaluate to judge window quality.
529*d5c09012SAndroid Build Coastguard Worker      BasicSli basic_sli_performance = 3;
530*d5c09012SAndroid Build Coastguard Worker    }
531*d5c09012SAndroid Build Coastguard Worker
532*d5c09012SAndroid Build Coastguard Worker    // If window `performance >= threshold`, the window is counted as good.
533*d5c09012SAndroid Build Coastguard Worker    double threshold = 2;
534*d5c09012SAndroid Build Coastguard Worker  }
535*d5c09012SAndroid Build Coastguard Worker
536*d5c09012SAndroid Build Coastguard Worker  // A `MetricRange` is used when each window is good when the value x of a
537*d5c09012SAndroid Build Coastguard Worker  // single `TimeSeries` satisfies `range.min <= x <= range.max`. The provided
538*d5c09012SAndroid Build Coastguard Worker  // `TimeSeries` must have `ValueType = INT64` or `ValueType = DOUBLE` and
539*d5c09012SAndroid Build Coastguard Worker  // `MetricKind = GAUGE`.
540*d5c09012SAndroid Build Coastguard Worker  message MetricRange {
541*d5c09012SAndroid Build Coastguard Worker    // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
542*d5c09012SAndroid Build Coastguard Worker    // specifying the `TimeSeries` to use for evaluating window quality.
543*d5c09012SAndroid Build Coastguard Worker    string time_series = 1;
544*d5c09012SAndroid Build Coastguard Worker
545*d5c09012SAndroid Build Coastguard Worker    // Range of values considered "good." For a one-sided range, set one bound
546*d5c09012SAndroid Build Coastguard Worker    // to an infinite value.
547*d5c09012SAndroid Build Coastguard Worker    Range range = 4;
548*d5c09012SAndroid Build Coastguard Worker  }
549*d5c09012SAndroid Build Coastguard Worker
550*d5c09012SAndroid Build Coastguard Worker  // The criterion to use for evaluating window goodness.
551*d5c09012SAndroid Build Coastguard Worker  oneof window_criterion {
552*d5c09012SAndroid Build Coastguard Worker    // A [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
553*d5c09012SAndroid Build Coastguard Worker    // specifying a `TimeSeries` with `ValueType = BOOL`. The window is good if
554*d5c09012SAndroid Build Coastguard Worker    // any `true` values appear in the window.
555*d5c09012SAndroid Build Coastguard Worker    string good_bad_metric_filter = 5;
556*d5c09012SAndroid Build Coastguard Worker
557*d5c09012SAndroid Build Coastguard Worker    // A window is good if its `performance` is high enough.
558*d5c09012SAndroid Build Coastguard Worker    PerformanceThreshold good_total_ratio_threshold = 2;
559*d5c09012SAndroid Build Coastguard Worker
560*d5c09012SAndroid Build Coastguard Worker    // A window is good if the metric's value is in a good range, averaged
561*d5c09012SAndroid Build Coastguard Worker    // across returned streams.
562*d5c09012SAndroid Build Coastguard Worker    MetricRange metric_mean_in_range = 6;
563*d5c09012SAndroid Build Coastguard Worker
564*d5c09012SAndroid Build Coastguard Worker    // A window is good if the metric's value is in a good range, summed across
565*d5c09012SAndroid Build Coastguard Worker    // returned streams.
566*d5c09012SAndroid Build Coastguard Worker    MetricRange metric_sum_in_range = 7;
567*d5c09012SAndroid Build Coastguard Worker  }
568*d5c09012SAndroid Build Coastguard Worker
569*d5c09012SAndroid Build Coastguard Worker  // Duration over which window quality is evaluated. Must be an integer
570*d5c09012SAndroid Build Coastguard Worker  // fraction of a day and at least `60s`.
571*d5c09012SAndroid Build Coastguard Worker  google.protobuf.Duration window_period = 4;
572*d5c09012SAndroid Build Coastguard Worker}
573