Skip to content

Commit

Permalink
Refresh monitoring client libraries.
Browse files Browse the repository at this point in the history
Rename to Cloud Monitoring API.
Added support for TimeSeriesQueryLanguageCondition condition type in alert policies.

PiperOrigin-RevId: 302735422
  • Loading branch information
Google APIs authored and Copybara-Service committed Mar 24, 2020
1 parent 25a1781 commit 71d6c56
Show file tree
Hide file tree
Showing 17 changed files with 341 additions and 115 deletions.
40 changes: 29 additions & 11 deletions google/monitoring/v3/alert.proto
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// 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.
Expand All @@ -11,7 +11,6 @@
// 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.
//

syntax = "proto3";

Expand All @@ -34,7 +33,7 @@ option php_namespace = "Google\\Cloud\\Monitoring\\V3";
// A description of the conditions under which some aspect of your system is
// considered to be "unhealthy" and the ways to notify people or services about
// this state. For an overview of alert policies, see
// [Introduction to Alerting](/monitoring/alerts/).
// [Introduction to Alerting](https://cloud.google.com/monitoring/alerts/).
message AlertPolicy {
option (google.api.resource) = {
type: "monitoring.googleapis.com/AlertPolicy"
Expand Down Expand Up @@ -94,8 +93,8 @@ message AlertPolicy {
//
// The filter is similar to the one that is specified in the
// [`ListTimeSeries`
// request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) (that
// call is useful to verify the time series that will be retrieved /
// request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
// (that call is useful to verify the time series that will be retrieved /
// processed) and must specify the metric type and optionally may contain
// restrictions on resource type, resource labels, and metric labels.
// This field may not exceed 2048 Unicode characters in length.
Expand All @@ -109,8 +108,8 @@ message AlertPolicy {
// are applied in the order specified.
//
// This field is similar to the one in the [`ListTimeSeries`
// request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It
// is advisable to use the `ListTimeSeries` method when debugging this
// request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
// It is advisable to use the `ListTimeSeries` method when debugging this
// field.
repeated Aggregation aggregations = 8;

Expand Down Expand Up @@ -180,8 +179,8 @@ message AlertPolicy {
//
// The filter is similar to the one that is specified in the
// [`ListTimeSeries`
// request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) (that
// call is useful to verify the time series that will be retrieved /
// request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
// (that call is useful to verify the time series that will be retrieved /
// processed) and must specify the metric type and optionally may contain
// restrictions on resource type, resource labels, and metric labels.
// This field may not exceed 2048 Unicode characters in length.
Expand All @@ -195,8 +194,8 @@ message AlertPolicy {
// are applied in the order specified.
//
// This field is similar to the one in the [`ListTimeSeries`
// request](/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). It
// is advisable to use the `ListTimeSeries` method when debugging this
// request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
// It is advisable to use the `ListTimeSeries` method when debugging this
// field.
repeated Aggregation aggregations = 5;

Expand All @@ -215,6 +214,20 @@ message AlertPolicy {
Trigger trigger = 3;
}

// A condition type that allows alert policies to be defined using the
// time series query language.
message TimeSeriesQueryLanguageCondition {
// A query in the time series query language format that generates time
// series indicating points in time that the condition should be
// considered active.
string query = 1;

// A short explanation of what the query represents. For example:
//
// "Error ratio exceeds 15% for >5% of servers in >2 regions"
string summary = 2;
}

// Required if the condition exists. The unique resource name for this
// condition. Its format is:
//
Expand Down Expand Up @@ -255,6 +268,11 @@ message AlertPolicy {
// A condition that checks that a time series continues to
// receive new data points.
MetricAbsence condition_absent = 2;

// A condition that uses the time series query language format to define
// alerts.
// If set, no other conditions can be present.
TimeSeriesQueryLanguageCondition condition_time_series_query_language = 14;
}
}

Expand Down
3 changes: 1 addition & 2 deletions google/monitoring/v3/alert_service.proto
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// 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.
Expand All @@ -11,7 +11,6 @@
// 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.
//

syntax = "proto3";

Expand Down
5 changes: 2 additions & 3 deletions google/monitoring/v3/common.proto
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// 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.
Expand All @@ -11,7 +11,6 @@
// 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.
//

syntax = "proto3";

Expand Down Expand Up @@ -104,7 +103,7 @@ message TimeInterval {
// representative data can be more easily graphed and comprehended, and the
// individual time series data is still available for later drilldown. For more
// details, see [Aggregating Time
// Series](/monitoring/api/v3/metrics#aggregating_time_series).
// Series](https://cloud.google.com/monitoring/api/v3/metrics#aggregating_time_series).
message Aggregation {
// The `Aligner` specifies the operation that will be applied to the data
// points in each alignment period in a time series. Except for
Expand Down
3 changes: 1 addition & 2 deletions google/monitoring/v3/dropped_labels.proto
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// 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.
Expand All @@ -11,7 +11,6 @@
// 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.
//

syntax = "proto3";

Expand Down
19 changes: 11 additions & 8 deletions google/monitoring/v3/group.proto
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// 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.
Expand All @@ -11,7 +11,6 @@
// 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.
//

syntax = "proto3";

Expand Down Expand Up @@ -61,19 +60,23 @@ message Group {
pattern: "*"
};

// Output only. The name of this group. The format is
// `"projects/{project_id_or_number}/groups/{group_id}"`.
// Output only. The name of this group. The format is:
//
// projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]
//
// When creating a group, this field is ignored and a new name is created
// consisting of the project specified in the call to `CreateGroup`
// and a unique `{group_id}` that is generated automatically.
// and a unique `[GROUP_ID]` that is generated automatically.
string name = 1;

// A user-assigned name for this group, used only for display purposes.
string display_name = 2;

// The name of the group's parent, if it has one.
// The format is `"projects/{project_id_or_number}/groups/{group_id}"`.
// For groups with no parent, `parentName` is the empty string, `""`.
// The name of the group's parent, if it has one. The format is:
//
// projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]
//
// For groups with no parent, `parent_name` is the empty string, `""`.
string parent_name = 3;

// The filter used to determine which monitored resources belong to this
Expand Down
3 changes: 1 addition & 2 deletions google/monitoring/v3/group_service.proto
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// 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.
Expand All @@ -11,7 +11,6 @@
// 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.
//

syntax = "proto3";

Expand Down
135 changes: 133 additions & 2 deletions google/monitoring/v3/metric.proto
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// 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.
Expand All @@ -11,7 +11,6 @@
// 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.
//

syntax = "proto3";

Expand All @@ -22,6 +21,7 @@ import "google/api/label.proto";
import "google/api/metric.proto";
import "google/api/monitored_resource.proto";
import "google/monitoring/v3/common.proto";
import "google/protobuf/duration.proto";

option csharp_namespace = "Google.Cloud.Monitoring.V3";
option go_package = "google.golang.org/genproto/googleapis/monitoring/v3;monitoring";
Expand Down Expand Up @@ -94,3 +94,134 @@ message TimeSeries {
// must be `BOOL`, `INT64`, `DOUBLE`, or `DISTRIBUTION`.
repeated Point points = 5;
}

// A descriptor for the labels and points in a timeseries.
message TimeSeriesDescriptor {
// A descriptor for the value columns in a data point.
message ValueDescriptor {
// The value key.
string key = 1;

// The value type.
google.api.MetricDescriptor.ValueType value_type = 2;

// The value stream kind.
google.api.MetricDescriptor.MetricKind metric_kind = 3;
}

// Descriptors for the labels.
repeated google.api.LabelDescriptor label_descriptors = 1;

// Descriptors for the point data value columns.
repeated ValueDescriptor point_descriptors = 5;
}

// Represents the values of a time series associated with a
// TimeSeriesDescriptor.
message TimeSeriesData {
// A point's value columns and time interval. Each point has one or more
// point values corresponding to the entries in `point_descriptors` field in
// the TimeSeriesDescriptor associated with this object.
message PointData {
// The values that make up the point.
repeated TypedValue values = 1;

// The time interval associated with the point.
TimeInterval time_interval = 2;
}

// The values of the labels in the time series identifier, given in the same
// order as the `label_descriptors` field of the TimeSeriesDescriptor
// associated with this object. Each value must have a value of the type
// given in the corresponding entry of `label_descriptors`.
repeated LabelValue label_values = 1;

// The points in the time series.
repeated PointData point_data = 2;
}

// A label value.
message LabelValue {
// The label value can be a bool, int64, or string.
oneof value {
// A bool label value.
bool bool_value = 1;

// An int64 label value.
int64 int64_value = 2;

// A string label value.
string string_value = 3;
}
}

// An error associated with a query in the time series query language format.
message QueryError {
// The location of the time series query language text that this error applies
// to.
TextLocator locator = 1;

// The error message.
string message = 2;
}

// A locator for text. Indicates a particular part of the text of a request or
// of an object referenced in the request.
//
// For example, suppose the request field `text` contains:
//
// text: "The quick brown fox jumps over the lazy dog."
//
// Then the locator:
//
// source: "text"
// start_position {
// line: 1
// column: 17
// }
// end_position {
// line: 1
// column: 19
// }
//
// refers to the part of the text: "fox".
message TextLocator {
// The position of a byte within the text.
message Position {
// The line, starting with 1, where the byte is positioned.
int32 line = 1;

// The column within the line, starting with 1, where the byte is
// positioned. This is a byte index even though the text is UTF-8.
int32 column = 2;
}

// The source of the text. The source may be a field in the request, in which
// case its format is the format of the
// google.rpc.BadRequest.FieldViolation.field field in
// https://cloud.google.com/apis/design/errors#error_details. It may also be
// be a source other than the request field (e.g. a macro definition
// referenced in the text of the query), in which case this is the name of
// the source (e.g. the macro name).
string source = 1;

// The position of the first byte within the text.
Position start_position = 2;

// The position of the last byte within the text.
Position end_position = 3;

// If `source`, `start_position`, and `end_position` describe a call on
// some object (e.g. a macro in the time series query language text) and a
// location is to be designated in that object's text, `nested_locator`
// identifies the location within that object.
TextLocator nested_locator = 4;

// When `nested_locator` is set, this field gives the reason for the nesting.
// Usually, the reason is a macro invocation. In that case, the macro name
// (including the leading '@') signals the location of the macro call
// in the text and a macro argument name (including the leading '$') signals
// the location of the macro argument inside the macro body that got
// substituted away.
string nesting_reason = 5;
}

0 comments on commit 71d6c56

Please sign in to comment.