scorecard.proto 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. // Copyright 2022 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. syntax = "proto3";
  15. package google.monitoring.dashboard.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/monitoring/dashboard/v1/metrics.proto";
  18. import "google/protobuf/duration.proto";
  19. option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1";
  20. option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "ScorecardProto";
  23. option java_package = "com.google.monitoring.dashboard.v1";
  24. option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1";
  25. option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1";
  26. // A widget showing the latest value of a metric, and how this value relates to
  27. // one or more thresholds.
  28. message Scorecard {
  29. // A gauge chart shows where the current value sits within a pre-defined
  30. // range. The upper and lower bounds should define the possible range of
  31. // values for the scorecard's query (inclusive).
  32. message GaugeView {
  33. // The lower bound for this gauge chart. The value of the chart should
  34. // always be greater than or equal to this.
  35. double lower_bound = 1;
  36. // The upper bound for this gauge chart. The value of the chart should
  37. // always be less than or equal to this.
  38. double upper_bound = 2;
  39. }
  40. // A sparkChart is a small chart suitable for inclusion in a table-cell or
  41. // inline in text. This message contains the configuration for a sparkChart
  42. // to show up on a Scorecard, showing recent trends of the scorecard's
  43. // timeseries.
  44. message SparkChartView {
  45. // Required. The type of sparkchart to show in this chartView.
  46. SparkChartType spark_chart_type = 1 [(google.api.field_behavior) = REQUIRED];
  47. // The lower bound on data point frequency in the chart implemented by
  48. // specifying the minimum alignment period to use in a time series query.
  49. // For example, if the data is published once every 10 minutes it would not
  50. // make sense to fetch and align data at one minute intervals. This field is
  51. // optional and exists only as a hint.
  52. google.protobuf.Duration min_alignment_period = 2;
  53. }
  54. // Required. Fields for querying time series data from the
  55. // Stackdriver metrics API.
  56. TimeSeriesQuery time_series_query = 1 [(google.api.field_behavior) = REQUIRED];
  57. // Defines the optional additional chart shown on the scorecard. If
  58. // neither is included - then a default scorecard is shown.
  59. oneof data_view {
  60. // Will cause the scorecard to show a gauge chart.
  61. GaugeView gauge_view = 4;
  62. // Will cause the scorecard to show a spark chart.
  63. SparkChartView spark_chart_view = 5;
  64. }
  65. // The thresholds used to determine the state of the scorecard given the
  66. // time series' current value. For an actual value x, the scorecard is in a
  67. // danger state if x is less than or equal to a danger threshold that triggers
  68. // below, or greater than or equal to a danger threshold that triggers above.
  69. // Similarly, if x is above/below a warning threshold that triggers
  70. // above/below, then the scorecard is in a warning state - unless x also puts
  71. // it in a danger state. (Danger trumps warning.)
  72. //
  73. // As an example, consider a scorecard with the following four thresholds:
  74. // {
  75. // value: 90,
  76. // category: 'DANGER',
  77. // trigger: 'ABOVE',
  78. // },
  79. // {
  80. // value: 70,
  81. // category: 'WARNING',
  82. // trigger: 'ABOVE',
  83. // },
  84. // {
  85. // value: 10,
  86. // category: 'DANGER',
  87. // trigger: 'BELOW',
  88. // },
  89. // {
  90. // value: 20,
  91. // category: 'WARNING',
  92. // trigger: 'BELOW',
  93. // }
  94. //
  95. // Then: values less than or equal to 10 would put the scorecard in a DANGER
  96. // state, values greater than 10 but less than or equal to 20 a WARNING state,
  97. // values strictly between 20 and 70 an OK state, values greater than or equal
  98. // to 70 but less than 90 a WARNING state, and values greater than or equal to
  99. // 90 a DANGER state.
  100. repeated Threshold thresholds = 6;
  101. }