Skip to content

Commit

Permalink
feat: Add support for pie charts, incident lists, dropdown groups, er…
Browse files Browse the repository at this point in the history
…ror reporting panels, section headers, and styling options on text widgets

docs: updated some comments

PiperOrigin-RevId: 605410874
  • Loading branch information
Google APIs authored and Copybara-Service committed Feb 8, 2024
1 parent 671deae commit 8aa8817
Show file tree
Hide file tree
Showing 23 changed files with 475 additions and 30 deletions.
15 changes: 14 additions & 1 deletion google/monitoring/dashboard/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ proto_library(
"dashboard_filter.proto",
"dashboards_service.proto",
"drilldowns.proto",
"error_reporting_panel.proto",
"incident_list.proto",
"layouts.proto",
"logs_panel.proto",
"metrics.proto",
"piechart.proto",
"scorecard.proto",
"section_header.proto",
"service.proto",
"single_view_group.proto",
"table.proto",
"table_display_options.proto",
"text.proto",
Expand All @@ -43,7 +48,9 @@ proto_library(
"//google/api:annotations_proto",
"//google/api:client_proto",
"//google/api:field_behavior_proto",
"//google/api:monitored_resource_proto",
"//google/api:resource_proto",
"//google/type:interval_proto",
"@com_google_protobuf//:duration_proto",
"@com_google_protobuf//:empty_proto",
],
Expand Down Expand Up @@ -136,6 +143,8 @@ go_proto_library(
protos = [":dashboard_proto"],
deps = [
"//google/api:annotations_go_proto",
"//google/api:monitoredres_go_proto",
"//google/type:interval_go_proto",
],
)

Expand All @@ -151,6 +160,7 @@ go_gapic_library(
transport = "grpc+rest",
deps = [
":dashboard_go_proto",
"//google/api:monitoredres_go_proto",
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
],
)
Expand Down Expand Up @@ -230,10 +240,13 @@ php_gapic_library(
name = "dashboard_php_gapic",
srcs = [":dashboard_proto_with_info"],
grpc_service_config = "dashboards_grpc_service_config.json",
migration_mode = "PRE_MIGRATION_SURFACE_ONLY",
rest_numeric_enums = True,
service_yaml = "monitoring.yaml",
transport = "grpc+rest",
deps = [":dashboard_php_proto"],
deps = [
":dashboard_php_proto",
],
)

# Open Source Packages
Expand Down
2 changes: 1 addition & 1 deletion google/monitoring/dashboard/v1/alertchart.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 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 Down
2 changes: 1 addition & 1 deletion google/monitoring/dashboard/v1/collapsible_group.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 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 Down
6 changes: 5 additions & 1 deletion google/monitoring/dashboard/v1/common.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 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 @@ -17,6 +17,7 @@ syntax = "proto3";
package google.monitoring.dashboard.v1;

import "google/protobuf/duration.proto";
import "google/type/interval.proto";

option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1";
option go_package = "cloud.google.com/go/monitoring/dashboard/apiv1/dashboardpb;dashboardpb";
Expand Down Expand Up @@ -425,6 +426,9 @@ message PickTimeSeriesFilter {

// How to use the ranking to select time series that pass through the filter.
Direction direction = 3;

// Select the top N streams/time series within this time interval
google.type.Interval interval = 4;
}

// A filter that ranks streams based on their statistical relation to other
Expand Down
6 changes: 3 additions & 3 deletions google/monitoring/dashboard/v1/dashboard.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 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 Down Expand Up @@ -37,8 +37,8 @@ message Dashboard {
pattern: "projects/{project}/dashboards/{dashboard}"
};

// Immutable. The resource name of the dashboard.
string name = 1 [(google.api.field_behavior) = IMMUTABLE];
// Identifier. The resource name of the dashboard.
string name = 1 [(google.api.field_behavior) = IDENTIFIER];

// Required. The mutable, human-readable name.
string display_name = 2 [(google.api.field_behavior) = REQUIRED];
Expand Down
2 changes: 1 addition & 1 deletion google/monitoring/dashboard/v1/dashboard_filter.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 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 Down
22 changes: 16 additions & 6 deletions google/monitoring/dashboard/v1/dashboards_service.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 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 Down Expand Up @@ -52,6 +52,7 @@ service DashboardsService {
post: "/v1/{parent=projects/*}/dashboards"
body: "dashboard"
};
option (google.api.method_signature) = "parent,dashboard";
}

// Lists the existing dashboards.
Expand All @@ -63,6 +64,7 @@ service DashboardsService {
option (google.api.http) = {
get: "/v1/{parent=projects/*}/dashboards"
};
option (google.api.method_signature) = "parent";
}

// Fetches a specific dashboard.
Expand All @@ -74,6 +76,7 @@ service DashboardsService {
option (google.api.http) = {
get: "/v1/{name=projects/*/dashboards/*}"
};
option (google.api.method_signature) = "name";
}

// Deletes an existing custom dashboard.
Expand All @@ -85,6 +88,7 @@ service DashboardsService {
option (google.api.http) = {
delete: "/v1/{name=projects/*/dashboards/*}"
};
option (google.api.method_signature) = "name";
}

// Replaces an existing custom dashboard with a new definition.
Expand All @@ -107,7 +111,12 @@ message CreateDashboardRequest {
// projects/[PROJECT_ID_OR_NUMBER]
//
// The `[PROJECT_ID_OR_NUMBER]` must match the dashboard resource name.
string parent = 1 [(google.api.field_behavior) = REQUIRED];
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "cloudresourcemanager.googleapis.com/Project"
}
];

// Required. The initial dashboard specification.
Dashboard dashboard = 2 [(google.api.field_behavior) = REQUIRED];
Expand All @@ -133,10 +142,11 @@ message ListDashboardsRequest {
// If unspecified, a default of 1000 is used.
int32 page_size = 2;

// If this field is not empty then it must contain the `nextPageToken` value
// returned by a previous call to this method. Using this field causes the
// method to return additional results from the previous method call.
string page_token = 3;
// Optional. If this field is not empty then it must contain the
// `nextPageToken` value returned by a previous call to this method. Using
// this field causes the method to return additional results from the previous
// method call.
string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
}

// The `ListDashboards` request.
Expand Down
2 changes: 1 addition & 1 deletion google/monitoring/dashboard/v1/drilldowns.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 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 Down
50 changes: 50 additions & 0 deletions google/monitoring/dashboard/v1/error_reporting_panel.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Copyright 2023 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 = "cloud.google.com/go/monitoring/dashboard/apiv1/dashboardpb;dashboardpb";
option java_multiple_files = true;
option java_outer_classname = "ErrorReportingPanelProto";
option java_package = "com.google.monitoring.dashboard.v1";
option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1";

// A widget that displays a list of error groups.
message ErrorReportingPanel {
// The resource name of the Google Cloud Platform project. Written
// as `projects/{projectID}` or `projects/{projectNumber}`, where
// `{projectID}` and `{projectNumber}` can be found in the
// [Google Cloud console](https://support.google.com/cloud/answer/6158840).
//
// Examples: `projects/my-project-123`, `projects/5551234`.
repeated string project_names = 1;

// An identifier of the service, such as the name of the
// executable, job, or Google App Engine service name. This field is expected
// to have a low number of values that are relatively stable over time, as
// opposed to `version`, which can be changed whenever new code is deployed.
//
// Contains the service name for error reports extracted from Google
// App Engine logs or `default` if the App Engine default service is used.
repeated string services = 2;

// Represents the source code version that the developer provided,
// which could represent a version label or a Git SHA-1 hash, for example.
// For App Engine standard environment, the version is set to the version of
// the app.
repeated string versions = 3;
}
43 changes: 43 additions & 0 deletions google/monitoring/dashboard/v1/incident_list.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright 2023 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/api/monitored_resource.proto";

option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1";
option go_package = "cloud.google.com/go/monitoring/dashboard/apiv1/dashboardpb;dashboardpb";
option java_multiple_files = true;
option java_outer_classname = "IncidentListProto";
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 list of incidents
message IncidentList {
// Optional. The monitored resource for which incidents are listed.
// The resource doesn't need to be fully specified. That is, you can specify
// the resource type but not the values of the resource labels.
// The resource type and labels are used for filtering.
repeated google.api.MonitoredResource monitored_resources = 1
[(google.api.field_behavior) = OPTIONAL];

// Optional. A list of alert policy names to filter the incident list by.
// Don't include the project ID prefix in the policy name. For
// example, use `alertPolicies/utilization`.
repeated string policy_names = 2 [(google.api.field_behavior) = OPTIONAL];
}
2 changes: 1 addition & 1 deletion google/monitoring/dashboard/v1/layouts.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 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 Down
2 changes: 1 addition & 1 deletion google/monitoring/dashboard/v1/logs_panel.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 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 Down
11 changes: 10 additions & 1 deletion google/monitoring/dashboard/v1/metrics.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 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 Down Expand Up @@ -51,6 +51,15 @@ message TimeSeriesQuery {
// [`unit`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors)
// field in `MetricDescriptor`.
string unit_override = 5;

// Optional. If set, Cloud Monitoring will treat the full query duration as
// the alignment period so that there will be only 1 output value.
//
// *Note: This could override the configured alignment period except for
// the cases where a series of data points are expected, like
// - XyChart
// - Scorecard's spark chart
bool output_full_duration = 7 [(google.api.field_behavior) = OPTIONAL];
}

// A filter that defines a subset of time series data that is displayed in a
Expand Down
78 changes: 78 additions & 0 deletions google/monitoring/dashboard/v1/piechart.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// Copyright 2023 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/protobuf/duration.proto";

option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1";
option go_package = "cloud.google.com/go/monitoring/dashboard/apiv1/dashboardpb;dashboardpb";
option java_multiple_files = true;
option java_outer_classname = "PieChartProto";
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 timeseries data as a pie or a donut.
message PieChart {
// Groups a time series query definition.
message PieChartDataSet {
// Required. The query for the PieChart. See,
// `google.monitoring.dashboard.v1.TimeSeriesQuery`.
TimeSeriesQuery time_series_query = 1
[(google.api.field_behavior) = REQUIRED];

// Optional. A template for the name of the slice. This name will be
// displayed in the legend and the tooltip of the pie chart. It replaces the
// auto-generated names for the slices. For example, if the template is set
// to
// `${resource.labels.zone}`, the zone's value will be used for the name
// instead of the default name.
string slice_name_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];
}

// Types for the pie chart.
enum PieChartType {
// The zero value. No type specified. Do not use.
PIE_CHART_TYPE_UNSPECIFIED = 0;

// A Pie type PieChart.
PIE = 1;

// Similar to PIE, but the DONUT type PieChart has a hole in the middle.
DONUT = 2;
}

// Required. The queries for the chart's data.
repeated PieChartDataSet data_sets = 1
[(google.api.field_behavior) = REQUIRED];

// Required. Indicates the visualization type for the PieChart.
PieChartType chart_type = 2 [(google.api.field_behavior) = REQUIRED];

// Optional. Indicates whether or not the pie chart should show slices' labels
bool show_labels = 4 [(google.api.field_behavior) = OPTIONAL];
}

0 comments on commit 8aa8817

Please sign in to comment.