From 2bff0f31f05f5d49ef33a11297cf3640c13ec2ac Mon Sep 17 00:00:00 2001 From: Google APIs Date: Thu, 7 Apr 2022 10:21:13 -0700 Subject: [PATCH] feat: Sync public protos with latests public api state. This adds support for collapsible groups, filters, labels, drilldowns, logs panels and tables PiperOrigin-RevId: 440139643 --- google/monitoring/dashboard/v1/BUILD.bazel | 9 +-- .../monitoring/dashboard/v1/alertchart.proto | 2 +- .../dashboard/v1/collapsible_group.proto | 32 +++++++++ google/monitoring/dashboard/v1/common.proto | 2 +- .../monitoring/dashboard/v1/dashboard.proto | 9 ++- .../dashboard/v1/dashboard_filter.proto | 68 +++++++++++++++++++ .../dashboard/v1/dashboards_service.proto | 4 +- .../monitoring/dashboard/v1/drilldowns.proto | 2 +- google/monitoring/dashboard/v1/layouts.proto | 2 +- .../monitoring/dashboard/v1/logs_panel.proto | 38 +++++++++++ google/monitoring/dashboard/v1/metrics.proto | 18 ++++- .../monitoring/dashboard/v1/scorecard.proto | 2 +- google/monitoring/dashboard/v1/service.proto | 2 +- google/monitoring/dashboard/v1/table.proto | 59 ++++++++++++++++ .../dashboard/v1/table_display_options.proto | 34 ++++++++++ google/monitoring/dashboard/v1/text.proto | 2 +- google/monitoring/dashboard/v1/widget.proto | 15 +++- google/monitoring/dashboard/v1/xychart.proto | 20 +++++- 18 files changed, 303 insertions(+), 17 deletions(-) create mode 100644 google/monitoring/dashboard/v1/collapsible_group.proto create mode 100644 google/monitoring/dashboard/v1/dashboard_filter.proto create mode 100644 google/monitoring/dashboard/v1/logs_panel.proto create mode 100644 google/monitoring/dashboard/v1/table.proto create mode 100644 google/monitoring/dashboard/v1/table_display_options.proto diff --git a/google/monitoring/dashboard/v1/BUILD.bazel b/google/monitoring/dashboard/v1/BUILD.bazel index a438fbafca7df..d2929fea0ec14 100644 --- a/google/monitoring/dashboard/v1/BUILD.bazel +++ b/google/monitoring/dashboard/v1/BUILD.bazel @@ -22,14 +22,19 @@ proto_library( name = "dashboard_proto", srcs = [ "alertchart.proto", + "collapsible_group.proto", "common.proto", "dashboard.proto", + "dashboard_filter.proto", "dashboards_service.proto", "drilldowns.proto", "layouts.proto", + "logs_panel.proto", "metrics.proto", "scorecard.proto", "service.proto", + "table.proto", + "table_display_options.proto", "text.proto", "widget.proto", "xychart.proto", @@ -37,12 +42,10 @@ proto_library( deps = [ "//google/api:annotations_proto", "//google/api:client_proto", - "//google/api:distribution_proto", "//google/api:field_behavior_proto", "//google/api:resource_proto", "@com_google_protobuf//:duration_proto", "@com_google_protobuf//:empty_proto", - "@com_google_protobuf//:field_mask_proto", ], ) @@ -129,7 +132,6 @@ go_proto_library( protos = [":dashboard_proto"], deps = [ "//google/api:annotations_go_proto", - "//google/api:distribution_go_proto", ], ) @@ -371,7 +373,6 @@ cc_proto_library( cc_grpc_library( name = "dashboard_cc_grpc", srcs = [":dashboard_proto"], - generate_mocks = True, grpc_only = True, deps = [":dashboard_cc_proto"], ) diff --git a/google/monitoring/dashboard/v1/alertchart.proto b/google/monitoring/dashboard/v1/alertchart.proto index a795e063ab6d7..2a92423b8f774 100644 --- a/google/monitoring/dashboard/v1/alertchart.proto +++ b/google/monitoring/dashboard/v1/alertchart.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/google/monitoring/dashboard/v1/collapsible_group.proto b/google/monitoring/dashboard/v1/collapsible_group.proto new file mode 100644 index 0000000000000..513560eb169cc --- /dev/null +++ b/google/monitoring/dashboard/v1/collapsible_group.proto @@ -0,0 +1,32 @@ +// Copyright 2022 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. + +syntax = "proto3"; + +package google.monitoring.dashboard.v1; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "CollapsibleGroupProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// A widget that groups the other widgets. All widgets that are within +// the area spanned by the grouping widget are considered member widgets. +message CollapsibleGroup { + // The collapsed state of the widget on first page load. + bool collapsed = 1; +} diff --git a/google/monitoring/dashboard/v1/common.proto b/google/monitoring/dashboard/v1/common.proto index 2dddf5cd1ffbb..6b8e6b3d54997 100644 --- a/google/monitoring/dashboard/v1/common.proto +++ b/google/monitoring/dashboard/v1/common.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/google/monitoring/dashboard/v1/dashboard.proto b/google/monitoring/dashboard/v1/dashboard.proto index 54c8a013e9a28..66f4c5300815a 100644 --- a/google/monitoring/dashboard/v1/dashboard.proto +++ b/google/monitoring/dashboard/v1/dashboard.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ package google.monitoring.dashboard.v1; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/monitoring/dashboard/v1/dashboard_filter.proto"; import "google/monitoring/dashboard/v1/layouts.proto"; option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; @@ -69,4 +70,10 @@ message Dashboard { // arranged vertically. ColumnLayout column_layout = 9; } + + // Filters to reduce the amount of data charted based on the filter criteria. + repeated DashboardFilter dashboard_filters = 11; + + // Labels applied to the dashboard + map labels = 12; } diff --git a/google/monitoring/dashboard/v1/dashboard_filter.proto b/google/monitoring/dashboard/v1/dashboard_filter.proto new file mode 100644 index 0000000000000..fba5cf63e8870 --- /dev/null +++ b/google/monitoring/dashboard/v1/dashboard_filter.proto @@ -0,0 +1,68 @@ +// Copyright 2022 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. + +syntax = "proto3"; + +package google.monitoring.dashboard.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "DashboardFilterProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// A filter to reduce the amount of data charted in relevant widgets. +message DashboardFilter { + // The type for the dashboard filter + enum FilterType { + // Filter type is unspecified. This is not valid in a well-formed request. + FILTER_TYPE_UNSPECIFIED = 0; + + // Filter on a resource label value + RESOURCE_LABEL = 1; + + // Filter on a metrics label value + METRIC_LABEL = 2; + + // Filter on a user metadata label value + USER_METADATA_LABEL = 3; + + // Filter on a system metadata label value + SYSTEM_METADATA_LABEL = 4; + + // Filter on a group id + GROUP = 5; + } + + // Required. The key for the label + string label_key = 1 [(google.api.field_behavior) = REQUIRED]; + + // The placeholder text that can be referenced in a filter string or MQL + // query. If omitted, the dashboard filter will be applied to all relevant + // widgets in the dashboard. + string template_variable = 3; + + // The default value used in the filter comparison + oneof default_value { + // A variable-length string value. + string string_value = 4; + } + + // The specified filter type + FilterType filter_type = 5; +} diff --git a/google/monitoring/dashboard/v1/dashboards_service.proto b/google/monitoring/dashboard/v1/dashboards_service.proto index 21bedfb0121f6..4e99c4f7e4d29 100644 --- a/google/monitoring/dashboard/v1/dashboards_service.proto +++ b/google/monitoring/dashboard/v1/dashboards_service.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,11 +17,11 @@ syntax = "proto3"; package google.monitoring.dashboard.v1; import "google/api/annotations.proto"; +import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; import "google/monitoring/dashboard/v1/dashboard.proto"; import "google/protobuf/empty.proto"; -import "google/api/client.proto"; option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; diff --git a/google/monitoring/dashboard/v1/drilldowns.proto b/google/monitoring/dashboard/v1/drilldowns.proto index 24541d3814cd5..b0a11e0a342e8 100644 --- a/google/monitoring/dashboard/v1/drilldowns.proto +++ b/google/monitoring/dashboard/v1/drilldowns.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/google/monitoring/dashboard/v1/layouts.proto b/google/monitoring/dashboard/v1/layouts.proto index 81d6a5bd032af..94be37aa519aa 100644 --- a/google/monitoring/dashboard/v1/layouts.proto +++ b/google/monitoring/dashboard/v1/layouts.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/google/monitoring/dashboard/v1/logs_panel.proto b/google/monitoring/dashboard/v1/logs_panel.proto new file mode 100644 index 0000000000000..a5fb66c7d6cc5 --- /dev/null +++ b/google/monitoring/dashboard/v1/logs_panel.proto @@ -0,0 +1,38 @@ +// Copyright 2022 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. + +syntax = "proto3"; + +package google.monitoring.dashboard.v1; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "LogsPanelProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// A widget that displays a stream of log. +message LogsPanel { + // A filter that chooses which log entries to return. See [Advanced Logs + // Queries](https://cloud.google.com/logging/docs/view/advanced-queries). + // Only log entries that match the filter are returned. An empty filter + // matches all log entries. + string filter = 1; + + // The names of logging resources to collect logs for. Currently only projects + // are supported. If empty, the widget will default to the host project. + repeated string resource_names = 2; +} diff --git a/google/monitoring/dashboard/v1/metrics.proto b/google/monitoring/dashboard/v1/metrics.proto index dc2bb93dc3962..c5ae8f718c26c 100644 --- a/google/monitoring/dashboard/v1/metrics.proto +++ b/google/monitoring/dashboard/v1/metrics.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -148,6 +148,18 @@ message Threshold { BELOW = 2; } + // An axis identifier. + enum TargetAxis { + // The target axis was not specified. Defaults to Y1. + TARGET_AXIS_UNSPECIFIED = 0; + + // The y_axis (the right axis of chart). + Y1 = 1; + + // The y2_axis (the left axis of chart). + Y2 = 2; + } + // A label for the threshold. string label = 1; @@ -161,6 +173,10 @@ message Threshold { // The direction for the current threshold. Direction is not allowed in a // XyChart. Direction direction = 4; + + // The target axis to use for plotting the threshold. Target axis is not + // allowed in a Scorecard. + TargetAxis target_axis = 5; } // Defines the possible types of spark chart supported by the `Scorecard`. diff --git a/google/monitoring/dashboard/v1/scorecard.proto b/google/monitoring/dashboard/v1/scorecard.proto index ab2adf1135bea..2cb2e4b2eb007 100644 --- a/google/monitoring/dashboard/v1/scorecard.proto +++ b/google/monitoring/dashboard/v1/scorecard.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/google/monitoring/dashboard/v1/service.proto b/google/monitoring/dashboard/v1/service.proto index 6d5d9a357c4e2..f7e5e44aef175 100644 --- a/google/monitoring/dashboard/v1/service.proto +++ b/google/monitoring/dashboard/v1/service.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/google/monitoring/dashboard/v1/table.proto b/google/monitoring/dashboard/v1/table.proto new file mode 100644 index 0000000000000..8165c3a9b79a2 --- /dev/null +++ b/google/monitoring/dashboard/v1/table.proto @@ -0,0 +1,59 @@ +// Copyright 2022 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. + +syntax = "proto3"; + +package google.monitoring.dashboard.v1; + +import "google/api/field_behavior.proto"; +import "google/monitoring/dashboard/v1/metrics.proto"; +import "google/monitoring/dashboard/v1/table_display_options.proto"; +import "google/protobuf/duration.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "TableProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// A table that displays time series data. +message TimeSeriesTable { + // Groups a time series query definition with table options. + message TableDataSet { + // Required. Fields for querying time series data from the + // Stackdriver metrics API. + TimeSeriesQuery time_series_query = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A template string for naming `TimeSeries` in the resulting data set. + // This should be a string with interpolations of the form `${label_name}`, + // which will resolve to the label's value i.e. + // "${resource.labels.project_id}." + string table_template = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The lower bound on data point frequency for this data set, implemented by + // specifying the minimum alignment period to use in a time series query + // For example, if the data is published once every 10 minutes, the + // `min_alignment_period` should be at least 10 minutes. It would not + // make sense to fetch and align data at one minute intervals. + google.protobuf.Duration min_alignment_period = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Table display options for configuring how the table is rendered. + TableDisplayOptions table_display_options = 4 [(google.api.field_behavior) = OPTIONAL]; + } + + // Required. The data displayed in this table. + repeated TableDataSet data_sets = 1 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/google/monitoring/dashboard/v1/table_display_options.proto b/google/monitoring/dashboard/v1/table_display_options.proto new file mode 100644 index 0000000000000..b94b20b11bc56 --- /dev/null +++ b/google/monitoring/dashboard/v1/table_display_options.proto @@ -0,0 +1,34 @@ +// Copyright 2022 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. + +syntax = "proto3"; + +package google.monitoring.dashboard.v1; + +import "google/api/field_behavior.proto"; + +option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; +option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard"; +option java_multiple_files = true; +option java_outer_classname = "TableDisplayOptionsProto"; +option java_package = "com.google.monitoring.dashboard.v1"; +option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; +option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; + +// Table display options that can be reused. +message TableDisplayOptions { + // Optional. Columns to display in the table. Leave empty to display all available + // columns. Note: This field is for future features and is not currently used. + repeated string shown_columns = 1 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/google/monitoring/dashboard/v1/text.proto b/google/monitoring/dashboard/v1/text.proto index 2b1ddd3bba74b..ed75a19f2c610 100644 --- a/google/monitoring/dashboard/v1/text.proto +++ b/google/monitoring/dashboard/v1/text.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/google/monitoring/dashboard/v1/widget.proto b/google/monitoring/dashboard/v1/widget.proto index 8cf3c3f0c9238..bb50eec8ed32e 100644 --- a/google/monitoring/dashboard/v1/widget.proto +++ b/google/monitoring/dashboard/v1/widget.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,7 +18,10 @@ package google.monitoring.dashboard.v1; import "google/api/field_behavior.proto"; import "google/monitoring/dashboard/v1/alertchart.proto"; +import "google/monitoring/dashboard/v1/collapsible_group.proto"; +import "google/monitoring/dashboard/v1/logs_panel.proto"; import "google/monitoring/dashboard/v1/scorecard.proto"; +import "google/monitoring/dashboard/v1/table.proto"; import "google/monitoring/dashboard/v1/text.proto"; import "google/monitoring/dashboard/v1/xychart.proto"; import "google/protobuf/empty.proto"; @@ -53,5 +56,15 @@ message Widget { // A chart of alert policy data. AlertChart alert_chart = 7; + + // A widget that displays time series data in a tabular format. + TimeSeriesTable time_series_table = 8; + + // A widget that groups the other widgets. All widgets that are within + // the area spanned by the grouping widget are considered member widgets. + CollapsibleGroup collapsible_group = 9; + + // A widget that shows a stream of logs. + LogsPanel logs_panel = 10; } } diff --git a/google/monitoring/dashboard/v1/xychart.proto b/google/monitoring/dashboard/v1/xychart.proto index c29542c27e05f..11a26a49c3a28 100644 --- a/google/monitoring/dashboard/v1/xychart.proto +++ b/google/monitoring/dashboard/v1/xychart.proto @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -59,6 +59,18 @@ message XyChart { HEATMAP = 4; } + // An axis identifier. + enum TargetAxis { + // The target axis was not specified. Defaults to Y1. + TARGET_AXIS_UNSPECIFIED = 0; + + // The y_axis (the right axis of chart). + Y1 = 1; + + // The y2_axis (the left axis of chart). + Y2 = 2; + } + // Required. Fields for querying time series data from the // Stackdriver metrics API. TimeSeriesQuery time_series_query = 1 [(google.api.field_behavior) = REQUIRED]; @@ -77,6 +89,9 @@ message XyChart { // `min_alignment_period` should be at least 10 minutes. It would not // make sense to fetch and align data at one minute intervals. google.protobuf.Duration min_alignment_period = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The target axis to use for plotting the metric. + TargetAxis target_axis = 5 [(google.api.field_behavior) = OPTIONAL]; } // A chart axis. @@ -119,6 +134,9 @@ message XyChart { // The properties applied to the Y axis. Axis y_axis = 7; + // The properties applied to the Y2 axis. + Axis y2_axis = 9; + // Display options for the chart. ChartOptions chart_options = 8; }