1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.monitoring.dashboard.v1; 18 19import "google/api/field_behavior.proto"; 20import "google/monitoring/dashboard/v1/metrics.proto"; 21import "google/protobuf/duration.proto"; 22 23option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1"; 24option go_package = "cloud.google.com/go/monitoring/dashboard/apiv1/dashboardpb;dashboardpb"; 25option java_multiple_files = true; 26option java_outer_classname = "XyChartProto"; 27option java_package = "com.google.monitoring.dashboard.v1"; 28option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1"; 29option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1"; 30 31// A chart that displays data on a 2D (X and Y axes) plane. 32message XyChart { 33 // Groups a time series query definition with charting options. 34 message DataSet { 35 // The types of plotting strategies for data sets. 36 enum PlotType { 37 // Plot type is unspecified. The view will default to `LINE`. 38 PLOT_TYPE_UNSPECIFIED = 0; 39 40 // The data is plotted as a set of lines (one line per series). 41 LINE = 1; 42 43 // The data is plotted as a set of filled areas (one area per series), 44 // with the areas stacked vertically (the base of each area is the top of 45 // its predecessor, and the base of the first area is the x-axis). Since 46 // the areas do not overlap, each is filled with a different opaque color. 47 STACKED_AREA = 2; 48 49 // The data is plotted as a set of rectangular boxes (one box per series), 50 // with the boxes stacked vertically (the base of each box is the top of 51 // its predecessor, and the base of the first box is the x-axis). Since 52 // the boxes do not overlap, each is filled with a different opaque color. 53 STACKED_BAR = 3; 54 55 // The data is plotted as a heatmap. The series being plotted must have a 56 // `DISTRIBUTION` value type. The value of each bucket in the distribution 57 // is displayed as a color. This type is not currently available in the 58 // Stackdriver Monitoring application. 59 HEATMAP = 4; 60 } 61 62 // An axis identifier. 63 enum TargetAxis { 64 // The target axis was not specified. Defaults to Y1. 65 TARGET_AXIS_UNSPECIFIED = 0; 66 67 // The y_axis (the right axis of chart). 68 Y1 = 1; 69 70 // The y2_axis (the left axis of chart). 71 Y2 = 2; 72 } 73 74 // Required. Fields for querying time series data from the 75 // Stackdriver metrics API. 76 TimeSeriesQuery time_series_query = 1 77 [(google.api.field_behavior) = REQUIRED]; 78 79 // How this data should be plotted on the chart. 80 PlotType plot_type = 2; 81 82 // A template string for naming `TimeSeries` in the resulting data set. 83 // This should be a string with interpolations of the form `${label_name}`, 84 // which will resolve to the label's value. 85 string legend_template = 3; 86 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 91 // make sense to fetch and align data at one minute intervals. 92 google.protobuf.Duration min_alignment_period = 4 93 [(google.api.field_behavior) = OPTIONAL]; 94 95 // Optional. The target axis to use for plotting the metric. 96 TargetAxis target_axis = 5 [(google.api.field_behavior) = OPTIONAL]; 97 } 98 99 // A chart axis. 100 message Axis { 101 // Types of scales used in axes. 102 enum Scale { 103 // Scale is unspecified. The view will default to `LINEAR`. 104 SCALE_UNSPECIFIED = 0; 105 106 // Linear scale. 107 LINEAR = 1; 108 109 // Logarithmic scale (base 10). 110 LOG10 = 2; 111 } 112 113 // The label of the axis. 114 string label = 1; 115 116 // The axis scale. By default, a linear scale is used. 117 Scale scale = 2; 118 } 119 120 // Required. The data displayed in this chart. 121 repeated DataSet data_sets = 1 [(google.api.field_behavior) = REQUIRED]; 122 123 // The duration used to display a comparison chart. A comparison chart 124 // simultaneously shows values from two similar-length time periods 125 // (e.g., week-over-week metrics). 126 // The duration must be positive, and it can only be applied to charts with 127 // data sets of LINE plot type. 128 google.protobuf.Duration timeshift_duration = 4; 129 130 // Threshold lines drawn horizontally across the chart. 131 repeated Threshold thresholds = 5; 132 133 // The properties applied to the x-axis. 134 Axis x_axis = 6; 135 136 // The properties applied to the y-axis. 137 Axis y_axis = 7; 138 139 // The properties applied to the y2-axis. 140 Axis y2_axis = 9; 141 142 // Display options for the chart. 143 ChartOptions chart_options = 8; 144} 145 146// Options to control visual rendering of a chart. 147message ChartOptions { 148 // Chart mode options. 149 enum Mode { 150 // Mode is unspecified. The view will default to `COLOR`. 151 MODE_UNSPECIFIED = 0; 152 153 // The chart distinguishes data series using different color. Line 154 // colors may get reused when there are many lines in the chart. 155 COLOR = 1; 156 157 // The chart uses the Stackdriver x-ray mode, in which each 158 // data set is plotted using the same semi-transparent color. 159 X_RAY = 2; 160 161 // The chart displays statistics such as average, median, 95th percentile, 162 // and more. 163 STATS = 3; 164 } 165 166 // The chart mode. 167 Mode mode = 1; 168} 169