Skip to content

Commit 2124b62

Browse files
Google APIscopybara-github
authored andcommitted
feat: Added support for units in the MetricService feat: Added total_size to the response of ListAlertPolicies. fix: Un-deprecated cluster_istio for service monitoring. feat: Added IstioCanonicalService for service monitoring. feat: Added creation and mutation records to notification channels. feat: Added support for querying metrics for folders and organizations. fix: Extended the default deadline for UpdateGroup to 180s. feat: Added support for secondary aggregation when querying metrics. PiperOrigin-RevId: 364422694
1 parent 149a3a8 commit 2124b62

19 files changed

Lines changed: 344 additions & 122 deletions

google/monitoring/v3/BUILD.bazel

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# This file was automatically generated by BuildFileGenerator
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
3+
4+
# Most of the manual changes to this file will be overwritten.
5+
# It's **only** allowed to change the following rule attribute values:
6+
# - names of *_gapic_assembly_* rules
7+
# - certain parameters of *_gapic_library rules, including but not limited to:
8+
# * extra_protoc_parameters
9+
# * extra_protoc_file_parameters
10+
# The complete list of preserved parameters can be found in the source code.
211

312
# This is an API workspace, having public visibility by default makes perfect sense.
413
package(default_visibility = ["//visibility:public"])
@@ -23,6 +32,7 @@ proto_library(
2332
"mutation_record.proto",
2433
"notification.proto",
2534
"notification_service.proto",
35+
"query_service.proto",
2636
"service.proto",
2737
"service_service.proto",
2838
"span_context.proto",
@@ -102,6 +112,7 @@ java_gapic_test(
102112
"com.google.cloud.monitoring.v3.GroupServiceClientTest",
103113
"com.google.cloud.monitoring.v3.MetricServiceClientTest",
104114
"com.google.cloud.monitoring.v3.NotificationChannelServiceClientTest",
115+
"com.google.cloud.monitoring.v3.QueryServiceClientTest",
105116
"com.google.cloud.monitoring.v3.ServiceMonitoringServiceClientTest",
106117
"com.google.cloud.monitoring.v3.UptimeCheckServiceClientTest",
107118
],
@@ -142,7 +153,6 @@ go_proto_library(
142153
"//google/api:label_go_proto",
143154
"//google/api:metric_go_proto",
144155
"//google/api:monitoredres_go_proto",
145-
"//google/longrunning:longrunning_go_proto",
146156
"//google/rpc:status_go_proto",
147157
"//google/type:calendar_period_go_proto",
148158
],
@@ -153,11 +163,13 @@ go_gapic_library(
153163
srcs = [":monitoring_proto_with_info"],
154164
grpc_service_config = "monitoring_grpc_service_config.json",
155165
importpath = "cloud.google.com/go/monitoring/apiv3;monitoring",
166+
metadata = True,
156167
service_yaml = "monitoring.yaml",
157168
deps = [
158169
":monitoring_go_proto",
159170
"//google/api:metric_go_proto",
160171
"//google/api:monitoredres_go_proto",
172+
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
161173
],
162174
)
163175

@@ -173,6 +185,7 @@ go_gapic_assembly_pkg(
173185
name = "gapi-cloud-monitoring-v3-go",
174186
deps = [
175187
":monitoring_go_gapic",
188+
":monitoring_go_gapic_srcjar-metadata.srcjar",
176189
":monitoring_go_gapic_srcjar-test.srcjar",
177190
":monitoring_go_proto",
178191
],
@@ -194,6 +207,7 @@ py_gapic_library(
194207
opt_args = ["python-gapic-namespace=google.cloud"],
195208
)
196209

210+
# Open Source Packages
197211
py_gapic_assembly_pkg(
198212
name = "monitoring-v3-py",
199213
deps = [
@@ -280,8 +294,8 @@ nodejs_gapic_assembly_pkg(
280294
##############################################################################
281295
load(
282296
"@com_google_googleapis_imports//:imports.bzl",
283-
"ruby_gapic_assembly_pkg",
284297
"ruby_cloud_gapic_library",
298+
"ruby_gapic_assembly_pkg",
285299
"ruby_grpc_library",
286300
"ruby_proto_library",
287301
)
@@ -301,11 +315,11 @@ ruby_cloud_gapic_library(
301315
name = "monitoring_ruby_gapic",
302316
srcs = [":monitoring_proto_with_info"],
303317
extra_protoc_parameters = [
304-
"ruby-cloud-gem-name=google-cloud-monitoring-v3",
305-
"ruby-cloud-env-prefix=MONITORING",
306-
"ruby-cloud-product-url=https://cloud.google.com/monitoring",
307318
"ruby-cloud-api-id=monitoring.googleapis.com",
308319
"ruby-cloud-api-shortname=monitoring",
320+
"ruby-cloud-env-prefix=MONITORING",
321+
"ruby-cloud-gem-name=google-cloud-monitoring-v3",
322+
"ruby-cloud-product-url=https://cloud.google.com/monitoring",
309323
],
310324
grpc_service_config = "monitoring_grpc_service_config.json",
311325
ruby_cloud_description = "Cloud Monitoring collects metrics, events, and metadata from Google Cloud, Amazon Web Services (AWS), hosted uptime probes, and application instrumentation.",

google/monitoring/v3/alert.proto

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@ syntax = "proto3";
1616

1717
package google.monitoring.v3;
1818

19+
import "google/api/field_behavior.proto";
1920
import "google/api/resource.proto";
2021
import "google/monitoring/v3/common.proto";
2122
import "google/monitoring/v3/mutation_record.proto";
@@ -89,17 +90,17 @@ message AlertPolicy {
8990
// A condition type that compares a collection of time series
9091
// against a threshold.
9192
message MetricThreshold {
92-
// A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
93+
// Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
9394
// identifies which time series should be compared with the threshold.
9495
//
9596
// The filter is similar to the one that is specified in the
9697
// [`ListTimeSeries`
9798
// request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
9899
// (that call is useful to verify the time series that will be retrieved /
99-
// processed) and must specify the metric type and optionally may contain
100-
// restrictions on resource type, resource labels, and metric labels.
101-
// This field may not exceed 2048 Unicode characters in length.
102-
string filter = 2;
100+
// processed). The filter must specify the metric type and the resource
101+
// type. Optionally, it can specify resource labels and metric labels.
102+
// This field must not exceed 2048 Unicode characters in length.
103+
string filter = 2 [(google.api.field_behavior) = REQUIRED];
103104

104105
// Specifies the alignment of data points in individual time series as
105106
// well as how to combine the retrieved time series together (such as
@@ -175,17 +176,17 @@ message AlertPolicy {
175176
// when a time series for the specified metric of a monitored
176177
// resource does not include any data in the specified `duration`.
177178
message MetricAbsence {
178-
// A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
179+
// Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
179180
// identifies which time series should be compared with the threshold.
180181
//
181182
// The filter is similar to the one that is specified in the
182183
// [`ListTimeSeries`
183184
// request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
184185
// (that call is useful to verify the time series that will be retrieved /
185-
// processed) and must specify the metric type and optionally may contain
186-
// restrictions on resource type, resource labels, and metric labels.
187-
// This field may not exceed 2048 Unicode characters in length.
188-
string filter = 1;
186+
// processed). The filter must specify the metric type and the resource
187+
// type. Optionally, it can specify resource labels and metric labels.
188+
// This field must not exceed 2048 Unicode characters in length.
189+
string filter = 1 [(google.api.field_behavior) = REQUIRED];
189190

190191
// Specifies the alignment of data points in individual time series as
191192
// well as how to combine the retrieved time series together (such as
@@ -201,9 +202,10 @@ message AlertPolicy {
201202
repeated Aggregation aggregations = 5;
202203

203204
// The amount of time that a time series must fail to report new
204-
// data to be considered failing. Currently, only values that
205-
// are a multiple of a minute--e.g. 60, 120, or 300
206-
// seconds--are supported. If an invalid value is given, an
205+
// data to be considered failing. The minimum value of this field
206+
// is 120 seconds. Larger values that are a multiple of a
207+
// minute--for example, 240 or 300 seconds--are supported.
208+
// If an invalid value is given, an
207209
// error will be returned. The `Duration.nanos` field is
208210
// ignored.
209211
google.protobuf.Duration duration = 2;
@@ -215,6 +217,34 @@ message AlertPolicy {
215217
Trigger trigger = 3;
216218
}
217219

220+
// A condition type that allows alert policies to be defined using
221+
// [Monitoring Query Language](https://cloud.google.com/monitoring/mql).
222+
message MonitoringQueryLanguageCondition {
223+
// [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
224+
// query that outputs a boolean stream.
225+
string query = 1;
226+
227+
// The amount of time that a time series must violate the
228+
// threshold to be considered failing. Currently, only values
229+
// that are a multiple of a minute--e.g., 0, 60, 120, or 300
230+
// seconds--are supported. If an invalid value is given, an
231+
// error will be returned. When choosing a duration, it is useful to
232+
// keep in mind the frequency of the underlying time series data
233+
// (which may also be affected by any alignments specified in the
234+
// `aggregations` field); a good duration is long enough so that a single
235+
// outlier does not generate spurious alerts, but short enough that
236+
// unhealthy states are detected and alerted on quickly.
237+
google.protobuf.Duration duration = 2;
238+
239+
// The number/percent of time series for which the comparison must hold
240+
// in order for the condition to trigger. If unspecified, then the
241+
// condition will trigger if the comparison is true for any of the
242+
// time series that have been identified by `filter` and `aggregations`,
243+
// or by the ratio, if `denominator_filter` and `denominator_aggregations`
244+
// are specified.
245+
Trigger trigger = 3;
246+
}
247+
218248
// Required if the condition exists. The unique resource name for this
219249
// condition. Its format is:
220250
//
@@ -255,6 +285,10 @@ message AlertPolicy {
255285
// A condition that checks that a time series continues to
256286
// receive new data points.
257287
MetricAbsence condition_absent = 2;
288+
289+
// A condition that uses the Monitoring Query Language to define
290+
// alerts.
291+
MonitoringQueryLanguageCondition condition_monitoring_query_language = 19;
258292
}
259293
}
260294

google/monitoring/v3/alert_service.proto

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ service AlertPolicyService {
4848
"https://www.googleapis.com/auth/monitoring,"
4949
"https://www.googleapis.com/auth/monitoring.read";
5050

51-
// Lists the existing alerting policies for the project.
51+
// Lists the existing alerting policies for the workspace.
5252
rpc ListAlertPolicies(ListAlertPoliciesRequest) returns (ListAlertPoliciesResponse) {
5353
option (google.api.http) = {
5454
get: "/v3/{name=projects/*}/alertPolicies"
@@ -101,10 +101,11 @@ message CreateAlertPolicyRequest {
101101
// projects/[PROJECT_ID_OR_NUMBER]
102102
//
103103
// Note that this field names the parent container in which the alerting
104-
// policy will be written, not the name of the created policy. The alerting
105-
// policy that is returned will have a name that contains a normalized
106-
// representation of this name as a prefix but adds a suffix of the form
107-
// `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the
104+
// policy will be written, not the name of the created policy. |name| must be
105+
// a host project of a workspace, otherwise INVALID_ARGUMENT error will
106+
// return. The alerting policy that is returned will have a name that contains
107+
// a normalized representation of this name as a prefix but adds a suffix of
108+
// the form `/alertPolicies/[ALERT_POLICY_ID]`, identifying the policy in the
108109
// container.
109110
string name = 3 [
110111
(google.api.field_behavior) = REQUIRED,
@@ -183,6 +184,10 @@ message ListAlertPoliciesResponse {
183184
// to a non-empty value. To see the additional results,
184185
// use that value as `page_token` in the next call to this method.
185186
string next_page_token = 2;
187+
188+
// The total number of alert policies in all pages. This number is only an
189+
// estimate, and may change in subsequent pages. https://aip.dev/158
190+
int32 total_size = 4;
186191
}
187192

188193
// The protocol for the `UpdateAlertPolicy` request.

google/monitoring/v3/common.proto

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -51,28 +51,34 @@ message TypedValue {
5151
}
5252
}
5353

54-
// A closed time interval. It extends from the start time to the end time, and
55-
// includes both: `[startTime, endTime]`. Valid time intervals depend on the
56-
// [`MetricKind`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind)
57-
// of the metric value. In no case can the end time be earlier than the start
58-
// time.
54+
// A closed time interval. It extends from the start time to the end time, and includes both: `[startTime, endTime]`. Valid time intervals depend on the [`MetricKind`](/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind) of the metric value. The end time must not be earlier than the start time. When writing data points, the start time must not be more than 25 hours in the past and the end time must not be more than five minutes in the future.
5955
//
60-
// * For a `GAUGE` metric, the `startTime` value is technically optional; if
56+
// * For `GAUGE` metrics, the `startTime` value is technically optional; if
6157
// no value is specified, the start time defaults to the value of the
6258
// end time, and the interval represents a single point in time. If both
6359
// start and end times are specified, they must be identical. Such an
6460
// interval is valid only for `GAUGE` metrics, which are point-in-time
65-
// measurements.
61+
// measurements. The end time of a new interval must be at least a
62+
// millisecond after the end time of the previous interval.
6663
//
67-
// * For `DELTA` and `CUMULATIVE` metrics, the start time must be earlier
68-
// than the end time.
64+
// * For `DELTA` metrics, the start time and end time must specify a
65+
// non-zero interval, with subsequent points specifying contiguous and
66+
// non-overlapping intervals. For `DELTA` metrics, the start time of
67+
// the next interval must be at least a millisecond after the end time
68+
// of the previous interval.
6969
//
70-
// * In all cases, the start time of the next interval must be
71-
// at least a millisecond after the end time of the previous interval.
72-
// Because the interval is closed, if the start time of a new interval
73-
// is the same as the end time of the previous interval, data written
74-
// at the new start time could overwrite data written at the previous
75-
// end time.
70+
// * For `CUMULATIVE` metrics, the start time and end time must specify a
71+
// a non-zero interval, with subsequent points specifying the same
72+
// start time and increasing end times, until an event resets the
73+
// cumulative value to zero and sets a new start time for the following
74+
// points. The new start time must be at least a millisecond after the
75+
// end time of the previous interval.
76+
//
77+
// * The start time of a new interval must be at least a millisecond after the
78+
// end time of the previous interval because intervals are closed. If the
79+
// start time of a new interval is the same as the end time of the previous
80+
// interval, then data written at the new start time could overwrite data
81+
// written at the previous end time.
7682
message TimeInterval {
7783
// Required. The end of the time interval.
7884
google.protobuf.Timestamp end_time = 2;
@@ -370,10 +376,13 @@ message Aggregation {
370376
// time. This will be done before the per-series aligner can be applied to
371377
// the data.
372378
//
373-
// The value must be at least 60 seconds. If a per-series aligner other than
374-
// `ALIGN_NONE` is specified, this field is required or an error is returned.
375-
// If no per-series aligner is specified, or the aligner `ALIGN_NONE` is
376-
// specified, then this field is ignored.
379+
// The value must be at least 60 seconds. If a per-series
380+
// aligner other than `ALIGN_NONE` is specified, this field is required or an
381+
// error is returned. If no per-series aligner is specified, or the aligner
382+
// `ALIGN_NONE` is specified, then this field is ignored.
383+
//
384+
// The maximum value of the `alignment_period` is 104 weeks (2 years) for
385+
// charts, and 90,000 seconds (25 hours) for alerting policies.
377386
google.protobuf.Duration alignment_period = 1;
378387

379388
// An `Aligner` describes how to bring the data points in a single

google/monitoring/v3/dropped_labels.proto

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -24,16 +24,17 @@ option java_package = "com.google.monitoring.v3";
2424
option php_namespace = "Google\\Cloud\\Monitoring\\V3";
2525
option ruby_package = "Google::Cloud::Monitoring::V3";
2626

27-
// A set of (label, value) pairs which were dropped during aggregation, attached
28-
// to google.api.Distribution.Exemplars in google.api.Distribution values during
29-
// aggregation.
27+
// A set of (label, value) pairs that were removed from a Distribution
28+
// time series during aggregation and then added as an attachment to a
29+
// Distribution.Exemplar.
3030
//
31-
// These values are used in combination with the label values that remain on the
32-
// aggregated Distribution timeseries to construct the full label set for the
33-
// exemplar values. The resulting full label set may be used to identify the
34-
// specific task/job/instance (for example) which may be contributing to a
35-
// long-tail, while allowing the storage savings of only storing aggregated
36-
// distribution values for a large group.
31+
// The full label set for the exemplars is constructed by using the dropped
32+
// pairs in combination with the label values that remain on the aggregated
33+
// Distribution time series. The constructed full label set can be used to
34+
// identify the specific entity, such as the instance or job, which might be
35+
// contributing to a long-tail. However, with dropped labels, the storage
36+
// requirements are reduced because only the aggregated distribution values for
37+
// a large group of time series are stored.
3738
//
3839
// Note that there are no guarantees on ordering of the labels from
3940
// exemplar-to-exemplar and from distribution-to-distribution in the same

google/monitoring/v3/group.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

google/monitoring/v3/group_service.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2021 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)