Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/google-monitoring-dashboard/.jsdoc.js
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 @@ -40,7 +40,7 @@ module.exports = {
includePattern: '\\.js$'
},
templates: {
copyright: 'Copyright 2022 Google LLC',
copyright: 'Copyright 2023 Google LLC',
includeDate: false,
sourceFiles: false,
systemName: '@google-cloud/monitoring-dashboards',
Expand Down
2 changes: 1 addition & 1 deletion packages/google-monitoring-dashboard/.mocharc.js
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 packages/google-monitoring-dashboard/.prettierrc.js
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
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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];
}
}

Expand Down Expand Up @@ -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];
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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];
Expand Down
124 changes: 123 additions & 1 deletion packages/google-monitoring-dashboard/protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading