feat: added support for horizontal bar rendering and column settings on time series tables

PiperOrigin-RevId: 501316608
pull/765/head
Google APIs 2 years ago committed by Copybara-Service
parent 938ebe2ab6
commit 09d97e07eb
  1. 127
      google/monitoring/dashboard/v1/BUILD.bazel
  2. 8
      google/monitoring/dashboard/v1/dashboards_service.proto
  3. 11
      google/monitoring/dashboard/v1/metrics.proto
  4. 55
      google/monitoring/dashboard/v1/table.proto
  5. 6
      google/monitoring/dashboard/v1/table_display_options.proto
  6. 14
      google/monitoring/dashboard/v1/xychart.proto

@ -9,45 +9,14 @@
# * extra_protoc_file_parameters
# The complete list of preserved parameters can be found in the source code.
# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])
##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
load(
"@com_google_googleapis_imports//:imports.bzl",
"cc_grpc_library",
"cc_proto_library",
"csharp_gapic_assembly_pkg",
"csharp_gapic_library",
"csharp_grpc_library",
"csharp_proto_library",
"go_gapic_assembly_pkg",
"go_gapic_library",
"go_proto_library",
"go_test",
"java_gapic_assembly_gradle_pkg",
"java_gapic_library",
"java_gapic_test",
"java_grpc_library",
"java_proto_library",
"nodejs_gapic_assembly_pkg",
"nodejs_gapic_library",
"php_gapic_assembly_pkg",
"php_gapic_library",
"php_grpc_library",
"php_proto_library",
"proto_library_with_info",
"py_gapic_assembly_pkg",
"py_gapic_library",
"py_test",
"ruby_cloud_gapic_library",
"ruby_gapic_assembly_pkg",
"ruby_grpc_library",
"ruby_proto_library",
)
# This is an API workspace, having public visibility by default makes perfect sense.
package(default_visibility = ["//visibility:public"])
load("@com_google_googleapis_imports//:imports.bzl", "proto_library_with_info")
proto_library(
name = "dashboard_proto",
@ -88,6 +57,18 @@ proto_library_with_info(
],
)
##############################################################################
# Java
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"java_gapic_assembly_gradle_pkg",
"java_gapic_library",
"java_gapic_test",
"java_grpc_library",
"java_proto_library",
)
java_proto_library(
name = "dashboard_java_proto",
deps = [":dashboard_proto"],
@ -138,6 +119,17 @@ java_gapic_assembly_gradle_pkg(
],
)
##############################################################################
# Go
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"go_gapic_assembly_pkg",
"go_gapic_library",
"go_proto_library",
"go_test",
)
go_proto_library(
name = "dashboard_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_grpc"],
@ -181,14 +173,24 @@ go_gapic_assembly_pkg(
],
)
##############################################################################
# Python
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"py_gapic_assembly_pkg",
"py_gapic_library",
"py_test",
)
py_gapic_library(
name = "dashboard_py_gapic",
srcs = [":dashboard_proto"],
grpc_service_config = "dashboards_grpc_service_config.json",
opt_args = [
"warehouse-package-name=google-cloud-monitoring-dashboards",
"python-gapic-namespace=google.cloud",
"python-gapic-name=monitoring_dashboard",
"python-gapic-namespace=google.cloud",
"warehouse-package-name=google-cloud-monitoring-dashboards",
],
rest_numeric_enums = True,
service_yaml = "monitoring.yaml",
@ -215,6 +217,17 @@ py_gapic_assembly_pkg(
],
)
##############################################################################
# PHP
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"php_gapic_assembly_pkg",
"php_gapic_library",
"php_grpc_library",
"php_proto_library",
)
php_proto_library(
name = "dashboard_php_proto",
deps = [":dashboard_proto"],
@ -249,6 +262,15 @@ php_gapic_assembly_pkg(
],
)
##############################################################################
# Node.js
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"nodejs_gapic_assembly_pkg",
"nodejs_gapic_library",
)
nodejs_gapic_library(
name = "dashboard_nodejs_gapic",
package_name = "@google-cloud/monitoring-dashboards",
@ -270,6 +292,17 @@ nodejs_gapic_assembly_pkg(
],
)
##############################################################################
# Ruby
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"ruby_cloud_gapic_library",
"ruby_gapic_assembly_pkg",
"ruby_grpc_library",
"ruby_proto_library",
)
ruby_proto_library(
name = "dashboard_ruby_proto",
deps = [":dashboard_proto"],
@ -313,6 +346,17 @@ ruby_gapic_assembly_pkg(
],
)
##############################################################################
# C#
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"csharp_gapic_assembly_pkg",
"csharp_gapic_library",
"csharp_grpc_library",
"csharp_proto_library",
)
csharp_proto_library(
name = "dashboard_csharp_proto",
deps = [":dashboard_proto"],
@ -347,6 +391,15 @@ csharp_gapic_assembly_pkg(
],
)
##############################################################################
# C++
##############################################################################
load(
"@com_google_googleapis_imports//:imports.bzl",
"cc_grpc_library",
"cc_proto_library",
)
cc_proto_library(
name = "dashboard_cc_proto",
deps = [":dashboard_proto"],

@ -41,8 +41,12 @@ service DashboardsService {
"https://www.googleapis.com/auth/monitoring.read,"
"https://www.googleapis.com/auth/monitoring.write";
// 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).
// 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).
// 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). 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).
rpc CreateDashboard(CreateDashboardRequest) returns (Dashboard) {
option (google.api.http) = {
post: "/v1/{parent=projects/*}/dashboards"

@ -58,8 +58,9 @@ message TimeSeriesQuery {
// [`ListTimeSeries`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
// method.
message TimeSeriesFilter {
// Required. The [monitoring filter](https://cloud.google.com/monitoring/api/v3/filters)
// that identifies the metric types, resources, and projects to query.
// Required. The [monitoring
// filter](https://cloud.google.com/monitoring/api/v3/filters) that identifies
// the metric types, resources, and projects to query.
string filter = 1 [(google.api.field_behavior) = REQUIRED];
// By default, the raw time series data is returned.
@ -77,7 +78,8 @@ message TimeSeriesFilter {
// Statistics based time series filter.
// Note: This field is deprecated and completely ignored by the API.
StatisticalTimeSeriesFilter statistical_time_series_filter = 5 [deprecated = true];
StatisticalTimeSeriesFilter statistical_time_series_filter = 5
[deprecated = true];
}
}
@ -116,7 +118,8 @@ message TimeSeriesFilterRatio {
// Statistics based time series filter.
// Note: This field is deprecated and completely ignored by the API.
StatisticalTimeSeriesFilter statistical_time_series_filter = 5 [deprecated = true];
StatisticalTimeSeriesFilter statistical_time_series_filter = 5
[deprecated = true];
}
}

@ -35,25 +35,58 @@ message TimeSeriesTable {
message TableDataSet {
// Required. Fields for querying time series data from the
// Stackdriver metrics API.
TimeSeriesQuery time_series_query = 1 [(google.api.field_behavior) = REQUIRED];
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.
// 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
// 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];
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];
// Optional. Table display options for configuring how the table is
// rendered.
TableDisplayOptions table_display_options = 4
[(google.api.field_behavior) = OPTIONAL];
}
// Enum for metric metric_visualization
enum MetricVisualization {
// Unspecified state
METRIC_VISUALIZATION_UNSPECIFIED = 0;
// Default text rendering
NUMBER = 1;
// Horizontal bar rendering
BAR = 2;
}
// The persistent settings for a table's columns.
message ColumnSettings {
// Required. The id of the column.
string column = 1 [(google.api.field_behavior) = REQUIRED];
// Required. Whether the column should be visible on page load.
bool visible = 2 [(google.api.field_behavior) = REQUIRED];
}
// Required. The data displayed in this table.
repeated TableDataSet data_sets = 1 [(google.api.field_behavior) = REQUIRED];
// Optional. Store rendering strategy
MetricVisualization metric_visualization = 2
[(google.api.field_behavior) = OPTIONAL];
// Optional. The list of the persistent column settings for the table.
repeated ColumnSettings column_settings = 4
[(google.api.field_behavior) = OPTIONAL];
}

@ -30,8 +30,6 @@ option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1";
message TableDisplayOptions {
// Optional. This field is unused and has been replaced by
// TimeSeriesTable.column_settings
repeated string shown_columns = 1 [
deprecated = true,
(google.api.field_behavior) = OPTIONAL
];
repeated string shown_columns = 1
[deprecated = true, (google.api.field_behavior) = OPTIONAL];
}

@ -73,7 +73,8 @@ message XyChart {
// Required. Fields for querying time series data from the
// Stackdriver metrics API.
TimeSeriesQuery time_series_query = 1 [(google.api.field_behavior) = REQUIRED];
TimeSeriesQuery time_series_query = 1
[(google.api.field_behavior) = REQUIRED];
// How this data should be plotted on the chart.
PlotType plot_type = 2;
@ -83,12 +84,13 @@ message XyChart {
// which will resolve to the label's value.
string legend_template = 3;
// 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
// 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 = 4 [(google.api.field_behavior) = OPTIONAL];
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];

Loading…
Cancel
Save