Skip to content

Commit 09d97e0

Browse files
Google APIscopybara-github
authored andcommitted
feat: added support for horizontal bar rendering and column settings on time series tables
PiperOrigin-RevId: 501316608
1 parent 938ebe2 commit 09d97e0

6 files changed

Lines changed: 157 additions & 64 deletions

File tree

google/monitoring/dashboard/v1/BUILD.bazel

Lines changed: 90 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,14 @@
99
# * extra_protoc_file_parameters
1010
# The complete list of preserved parameters can be found in the source code.
1111

12+
# This is an API workspace, having public visibility by default makes perfect sense.
13+
package(default_visibility = ["//visibility:public"])
14+
1215
##############################################################################
1316
# Common
1417
##############################################################################
1518
load("@rules_proto//proto:defs.bzl", "proto_library")
16-
load(
17-
"@com_google_googleapis_imports//:imports.bzl",
18-
"cc_grpc_library",
19-
"cc_proto_library",
20-
"csharp_gapic_assembly_pkg",
21-
"csharp_gapic_library",
22-
"csharp_grpc_library",
23-
"csharp_proto_library",
24-
"go_gapic_assembly_pkg",
25-
"go_gapic_library",
26-
"go_proto_library",
27-
"go_test",
28-
"java_gapic_assembly_gradle_pkg",
29-
"java_gapic_library",
30-
"java_gapic_test",
31-
"java_grpc_library",
32-
"java_proto_library",
33-
"nodejs_gapic_assembly_pkg",
34-
"nodejs_gapic_library",
35-
"php_gapic_assembly_pkg",
36-
"php_gapic_library",
37-
"php_grpc_library",
38-
"php_proto_library",
39-
"proto_library_with_info",
40-
"py_gapic_assembly_pkg",
41-
"py_gapic_library",
42-
"py_test",
43-
"ruby_cloud_gapic_library",
44-
"ruby_gapic_assembly_pkg",
45-
"ruby_grpc_library",
46-
"ruby_proto_library",
47-
)
48-
49-
# This is an API workspace, having public visibility by default makes perfect sense.
50-
package(default_visibility = ["//visibility:public"])
19+
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
5120

5221
proto_library(
5322
name = "dashboard_proto",
@@ -88,6 +57,18 @@ proto_library_with_info(
8857
],
8958
)
9059

60+
##############################################################################
61+
# Java
62+
##############################################################################
63+
load(
64+
"@com_google_googleapis_imports//:imports.bzl",
65+
"java_gapic_assembly_gradle_pkg",
66+
"java_gapic_library",
67+
"java_gapic_test",
68+
"java_grpc_library",
69+
"java_proto_library",
70+
)
71+
9172
java_proto_library(
9273
name = "dashboard_java_proto",
9374
deps = [":dashboard_proto"],
@@ -138,6 +119,17 @@ java_gapic_assembly_gradle_pkg(
138119
],
139120
)
140121

122+
##############################################################################
123+
# Go
124+
##############################################################################
125+
load(
126+
"@com_google_googleapis_imports//:imports.bzl",
127+
"go_gapic_assembly_pkg",
128+
"go_gapic_library",
129+
"go_proto_library",
130+
"go_test",
131+
)
132+
141133
go_proto_library(
142134
name = "dashboard_go_proto",
143135
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
@@ -181,14 +173,24 @@ go_gapic_assembly_pkg(
181173
],
182174
)
183175

176+
##############################################################################
177+
# Python
178+
##############################################################################
179+
load(
180+
"@com_google_googleapis_imports//:imports.bzl",
181+
"py_gapic_assembly_pkg",
182+
"py_gapic_library",
183+
"py_test",
184+
)
185+
184186
py_gapic_library(
185187
name = "dashboard_py_gapic",
186188
srcs = [":dashboard_proto"],
187189
grpc_service_config = "dashboards_grpc_service_config.json",
188190
opt_args = [
189-
"warehouse-package-name=google-cloud-monitoring-dashboards",
190-
"python-gapic-namespace=google.cloud",
191191
"python-gapic-name=monitoring_dashboard",
192+
"python-gapic-namespace=google.cloud",
193+
"warehouse-package-name=google-cloud-monitoring-dashboards",
192194
],
193195
rest_numeric_enums = True,
194196
service_yaml = "monitoring.yaml",
@@ -215,6 +217,17 @@ py_gapic_assembly_pkg(
215217
],
216218
)
217219

220+
##############################################################################
221+
# PHP
222+
##############################################################################
223+
load(
224+
"@com_google_googleapis_imports//:imports.bzl",
225+
"php_gapic_assembly_pkg",
226+
"php_gapic_library",
227+
"php_grpc_library",
228+
"php_proto_library",
229+
)
230+
218231
php_proto_library(
219232
name = "dashboard_php_proto",
220233
deps = [":dashboard_proto"],
@@ -249,6 +262,15 @@ php_gapic_assembly_pkg(
249262
],
250263
)
251264

265+
##############################################################################
266+
# Node.js
267+
##############################################################################
268+
load(
269+
"@com_google_googleapis_imports//:imports.bzl",
270+
"nodejs_gapic_assembly_pkg",
271+
"nodejs_gapic_library",
272+
)
273+
252274
nodejs_gapic_library(
253275
name = "dashboard_nodejs_gapic",
254276
package_name = "@google-cloud/monitoring-dashboards",
@@ -270,6 +292,17 @@ nodejs_gapic_assembly_pkg(
270292
],
271293
)
272294

295+
##############################################################################
296+
# Ruby
297+
##############################################################################
298+
load(
299+
"@com_google_googleapis_imports//:imports.bzl",
300+
"ruby_cloud_gapic_library",
301+
"ruby_gapic_assembly_pkg",
302+
"ruby_grpc_library",
303+
"ruby_proto_library",
304+
)
305+
273306
ruby_proto_library(
274307
name = "dashboard_ruby_proto",
275308
deps = [":dashboard_proto"],
@@ -313,6 +346,17 @@ ruby_gapic_assembly_pkg(
313346
],
314347
)
315348

349+
##############################################################################
350+
# C#
351+
##############################################################################
352+
load(
353+
"@com_google_googleapis_imports//:imports.bzl",
354+
"csharp_gapic_assembly_pkg",
355+
"csharp_gapic_library",
356+
"csharp_grpc_library",
357+
"csharp_proto_library",
358+
)
359+
316360
csharp_proto_library(
317361
name = "dashboard_csharp_proto",
318362
deps = [":dashboard_proto"],
@@ -347,6 +391,15 @@ csharp_gapic_assembly_pkg(
347391
],
348392
)
349393

394+
##############################################################################
395+
# C++
396+
##############################################################################
397+
load(
398+
"@com_google_googleapis_imports//:imports.bzl",
399+
"cc_grpc_library",
400+
"cc_proto_library",
401+
)
402+
350403
cc_proto_library(
351404
name = "dashboard_cc_proto",
352405
deps = [":dashboard_proto"],

google/monitoring/dashboard/v1/dashboards_service.proto

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,12 @@ service DashboardsService {
4141
"https://www.googleapis.com/auth/monitoring.read,"
4242
"https://www.googleapis.com/auth/monitoring.write";
4343

44-
// Creates a new custom dashboard. For examples on how you can use this API to create dashboards, see [Managing dashboards by API](https://cloud.google.com/monitoring/dashboards/api-dashboard).
45-
// This method requires the `monitoring.dashboards.create` permission on the specified project. For more information about permissions, see [Cloud Identity and Access Management](https://cloud.google.com/iam).
44+
// Creates a new custom dashboard. For examples on how you can use this API to
45+
// create dashboards, see [Managing dashboards by
46+
// API](https://cloud.google.com/monitoring/dashboards/api-dashboard). This
47+
// method requires the `monitoring.dashboards.create` permission on the
48+
// specified project. For more information about permissions, see [Cloud
49+
// Identity and Access Management](https://cloud.google.com/iam).
4650
rpc CreateDashboard(CreateDashboardRequest) returns (Dashboard) {
4751
option (google.api.http) = {
4852
post: "/v1/{parent=projects/*}/dashboards"

google/monitoring/dashboard/v1/metrics.proto

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ message TimeSeriesQuery {
5858
// [`ListTimeSeries`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
5959
// method.
6060
message TimeSeriesFilter {
61-
// Required. The [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
62-
// that identifies the metric types, resources, and projects to query.
61+
// Required. The [monitoring
62+
// filter](https://cloud.google.com/monitoring/api/v3/filters) that identifies
63+
// the metric types, resources, and projects to query.
6364
string filter = 1 [(google.api.field_behavior) = REQUIRED];
6465

6566
// By default, the raw time series data is returned.
@@ -77,7 +78,8 @@ message TimeSeriesFilter {
7778

7879
// Statistics based time series filter.
7980
// Note: This field is deprecated and completely ignored by the API.
80-
StatisticalTimeSeriesFilter statistical_time_series_filter = 5 [deprecated = true];
81+
StatisticalTimeSeriesFilter statistical_time_series_filter = 5
82+
[deprecated = true];
8183
}
8284
}
8385

@@ -116,7 +118,8 @@ message TimeSeriesFilterRatio {
116118

117119
// Statistics based time series filter.
118120
// Note: This field is deprecated and completely ignored by the API.
119-
StatisticalTimeSeriesFilter statistical_time_series_filter = 5 [deprecated = true];
121+
StatisticalTimeSeriesFilter statistical_time_series_filter = 5
122+
[deprecated = true];
120123
}
121124
}
122125

google/monitoring/dashboard/v1/table.proto

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,25 +35,58 @@ message TimeSeriesTable {
3535
message TableDataSet {
3636
// Required. Fields for querying time series data from the
3737
// Stackdriver metrics API.
38-
TimeSeriesQuery time_series_query = 1 [(google.api.field_behavior) = REQUIRED];
38+
TimeSeriesQuery time_series_query = 1
39+
[(google.api.field_behavior) = REQUIRED];
3940

40-
// Optional. A template string for naming `TimeSeries` in the resulting data set.
41-
// This should be a string with interpolations of the form `${label_name}`,
42-
// which will resolve to the label's value i.e.
41+
// Optional. A template string for naming `TimeSeries` in the resulting data
42+
// set. This should be a string with interpolations of the form
43+
// `${label_name}`, which will resolve to the label's value i.e.
4344
// "${resource.labels.project_id}."
4445
string table_template = 2 [(google.api.field_behavior) = OPTIONAL];
4546

46-
// Optional. The lower bound on data point frequency for this data set, implemented by
47-
// specifying the minimum alignment period to use in a time series query
48-
// For example, if the data is published once every 10 minutes, the
49-
// `min_alignment_period` should be at least 10 minutes. It would not
47+
// Optional. The lower bound on data point frequency for this data set,
48+
// implemented by specifying the minimum alignment period to use in a time
49+
// series query For example, if the data is published once every 10 minutes,
50+
// the `min_alignment_period` should be at least 10 minutes. It would not
5051
// make sense to fetch and align data at one minute intervals.
51-
google.protobuf.Duration min_alignment_period = 3 [(google.api.field_behavior) = OPTIONAL];
52+
google.protobuf.Duration min_alignment_period = 3
53+
[(google.api.field_behavior) = OPTIONAL];
5254

53-
// Optional. Table display options for configuring how the table is rendered.
54-
TableDisplayOptions table_display_options = 4 [(google.api.field_behavior) = OPTIONAL];
55+
// Optional. Table display options for configuring how the table is
56+
// rendered.
57+
TableDisplayOptions table_display_options = 4
58+
[(google.api.field_behavior) = OPTIONAL];
59+
}
60+
61+
// Enum for metric metric_visualization
62+
enum MetricVisualization {
63+
// Unspecified state
64+
METRIC_VISUALIZATION_UNSPECIFIED = 0;
65+
66+
// Default text rendering
67+
NUMBER = 1;
68+
69+
// Horizontal bar rendering
70+
BAR = 2;
71+
}
72+
73+
// The persistent settings for a table's columns.
74+
message ColumnSettings {
75+
// Required. The id of the column.
76+
string column = 1 [(google.api.field_behavior) = REQUIRED];
77+
78+
// Required. Whether the column should be visible on page load.
79+
bool visible = 2 [(google.api.field_behavior) = REQUIRED];
5580
}
5681

5782
// Required. The data displayed in this table.
5883
repeated TableDataSet data_sets = 1 [(google.api.field_behavior) = REQUIRED];
84+
85+
// Optional. Store rendering strategy
86+
MetricVisualization metric_visualization = 2
87+
[(google.api.field_behavior) = OPTIONAL];
88+
89+
// Optional. The list of the persistent column settings for the table.
90+
repeated ColumnSettings column_settings = 4
91+
[(google.api.field_behavior) = OPTIONAL];
5992
}

google/monitoring/dashboard/v1/table_display_options.proto

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1";
3030
message TableDisplayOptions {
3131
// Optional. This field is unused and has been replaced by
3232
// TimeSeriesTable.column_settings
33-
repeated string shown_columns = 1 [
34-
deprecated = true,
35-
(google.api.field_behavior) = OPTIONAL
36-
];
33+
repeated string shown_columns = 1
34+
[deprecated = true, (google.api.field_behavior) = OPTIONAL];
3735
}

google/monitoring/dashboard/v1/xychart.proto

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ message XyChart {
7373

7474
// Required. Fields for querying time series data from the
7575
// Stackdriver metrics API.
76-
TimeSeriesQuery time_series_query = 1 [(google.api.field_behavior) = REQUIRED];
76+
TimeSeriesQuery time_series_query = 1
77+
[(google.api.field_behavior) = REQUIRED];
7778

7879
// How this data should be plotted on the chart.
7980
PlotType plot_type = 2;
@@ -83,12 +84,13 @@ message XyChart {
8384
// which will resolve to the label's value.
8485
string legend_template = 3;
8586

86-
// Optional. The lower bound on data point frequency for this data set, implemented by
87-
// specifying the minimum alignment period to use in a time series query
88-
// For example, if the data is published once every 10 minutes, the
89-
// `min_alignment_period` should be at least 10 minutes. It would not
87+
// Optional. The lower bound on data point frequency for this data set,
88+
// implemented by specifying the minimum alignment period to use in a time
89+
// series query For example, if the data is published once every 10 minutes,
90+
// the `min_alignment_period` should be at least 10 minutes. It would not
9091
// make sense to fetch and align data at one minute intervals.
91-
google.protobuf.Duration min_alignment_period = 4 [(google.api.field_behavior) = OPTIONAL];
92+
google.protobuf.Duration min_alignment_period = 4
93+
[(google.api.field_behavior) = OPTIONAL];
9294

9395
// Optional. The target axis to use for plotting the metric.
9496
TargetAxis target_axis = 5 [(google.api.field_behavior) = OPTIONAL];

0 commit comments

Comments
 (0)