common.proto 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  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/protobuf/duration.proto";
  17. option csharp_namespace = "Google.Cloud.Monitoring.Dashboard.V1";
  18. option go_package = "google.golang.org/genproto/googleapis/monitoring/dashboard/v1;dashboard";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "CommonProto";
  21. option java_package = "com.google.monitoring.dashboard.v1";
  22. option php_namespace = "Google\\Cloud\\Monitoring\\Dashboard\\V1";
  23. option ruby_package = "Google::Cloud::Monitoring::Dashboard::V1";
  24. // Describes how to combine multiple time series to provide a different view of
  25. // the data. Aggregation of time series is done in two steps. First, each time
  26. // series in the set is _aligned_ to the same time interval boundaries, then the
  27. // set of time series is optionally _reduced_ in number.
  28. //
  29. // Alignment consists of applying the `per_series_aligner` operation
  30. // to each time series after its data has been divided into regular
  31. // `alignment_period` time intervals. This process takes _all_ of the data
  32. // points in an alignment period, applies a mathematical transformation such as
  33. // averaging, minimum, maximum, delta, etc., and converts them into a single
  34. // data point per period.
  35. //
  36. // Reduction is when the aligned and transformed time series can optionally be
  37. // combined, reducing the number of time series through similar mathematical
  38. // transformations. Reduction involves applying a `cross_series_reducer` to
  39. // all the time series, optionally sorting the time series into subsets with
  40. // `group_by_fields`, and applying the reducer to each subset.
  41. //
  42. // The raw time series data can contain a huge amount of information from
  43. // multiple sources. Alignment and reduction transforms this mass of data into
  44. // a more manageable and representative collection of data, for example "the
  45. // 95% latency across the average of all tasks in a cluster". This
  46. // representative data can be more easily graphed and comprehended, and the
  47. // individual time series data is still available for later drilldown. For more
  48. // details, see [Filtering and
  49. // aggregation](https://cloud.google.com/monitoring/api/v3/aggregation).
  50. message Aggregation {
  51. // The `Aligner` specifies the operation that will be applied to the data
  52. // points in each alignment period in a time series. Except for
  53. // `ALIGN_NONE`, which specifies that no operation be applied, each alignment
  54. // operation replaces the set of data values in each alignment period with
  55. // a single value: the result of applying the operation to the data values.
  56. // An aligned time series has a single data value at the end of each
  57. // `alignment_period`.
  58. //
  59. // An alignment operation can change the data type of the values, too. For
  60. // example, if you apply a counting operation to boolean values, the data
  61. // `value_type` in the original time series is `BOOLEAN`, but the `value_type`
  62. // in the aligned result is `INT64`.
  63. enum Aligner {
  64. // No alignment. Raw data is returned. Not valid if cross-series reduction
  65. // is requested. The `value_type` of the result is the same as the
  66. // `value_type` of the input.
  67. ALIGN_NONE = 0;
  68. // Align and convert to
  69. // [DELTA][google.api.MetricDescriptor.MetricKind.DELTA].
  70. // The output is `delta = y1 - y0`.
  71. //
  72. // This alignment is valid for
  73. // [CUMULATIVE][google.api.MetricDescriptor.MetricKind.CUMULATIVE] and
  74. // `DELTA` metrics. If the selected alignment period results in periods
  75. // with no data, then the aligned value for such a period is created by
  76. // interpolation. The `value_type` of the aligned result is the same as
  77. // the `value_type` of the input.
  78. ALIGN_DELTA = 1;
  79. // Align and convert to a rate. The result is computed as
  80. // `rate = (y1 - y0)/(t1 - t0)`, or "delta over time".
  81. // Think of this aligner as providing the slope of the line that passes
  82. // through the value at the start and at the end of the `alignment_period`.
  83. //
  84. // This aligner is valid for `CUMULATIVE`
  85. // and `DELTA` metrics with numeric values. If the selected alignment
  86. // period results in periods with no data, then the aligned value for
  87. // such a period is created by interpolation. The output is a `GAUGE`
  88. // metric with `value_type` `DOUBLE`.
  89. //
  90. // If, by "rate", you mean "percentage change", see the
  91. // `ALIGN_PERCENT_CHANGE` aligner instead.
  92. ALIGN_RATE = 2;
  93. // Align by interpolating between adjacent points around the alignment
  94. // period boundary. This aligner is valid for `GAUGE` metrics with
  95. // numeric values. The `value_type` of the aligned result is the same as the
  96. // `value_type` of the input.
  97. ALIGN_INTERPOLATE = 3;
  98. // Align by moving the most recent data point before the end of the
  99. // alignment period to the boundary at the end of the alignment
  100. // period. This aligner is valid for `GAUGE` metrics. The `value_type` of
  101. // the aligned result is the same as the `value_type` of the input.
  102. ALIGN_NEXT_OLDER = 4;
  103. // Align the time series by returning the minimum value in each alignment
  104. // period. This aligner is valid for `GAUGE` and `DELTA` metrics with
  105. // numeric values. The `value_type` of the aligned result is the same as
  106. // the `value_type` of the input.
  107. ALIGN_MIN = 10;
  108. // Align the time series by returning the maximum value in each alignment
  109. // period. This aligner is valid for `GAUGE` and `DELTA` metrics with
  110. // numeric values. The `value_type` of the aligned result is the same as
  111. // the `value_type` of the input.
  112. ALIGN_MAX = 11;
  113. // Align the time series by returning the mean value in each alignment
  114. // period. This aligner is valid for `GAUGE` and `DELTA` metrics with
  115. // numeric values. The `value_type` of the aligned result is `DOUBLE`.
  116. ALIGN_MEAN = 12;
  117. // Align the time series by returning the number of values in each alignment
  118. // period. This aligner is valid for `GAUGE` and `DELTA` metrics with
  119. // numeric or Boolean values. The `value_type` of the aligned result is
  120. // `INT64`.
  121. ALIGN_COUNT = 13;
  122. // Align the time series by returning the sum of the values in each
  123. // alignment period. This aligner is valid for `GAUGE` and `DELTA`
  124. // metrics with numeric and distribution values. The `value_type` of the
  125. // aligned result is the same as the `value_type` of the input.
  126. ALIGN_SUM = 14;
  127. // Align the time series by returning the standard deviation of the values
  128. // in each alignment period. This aligner is valid for `GAUGE` and
  129. // `DELTA` metrics with numeric values. The `value_type` of the output is
  130. // `DOUBLE`.
  131. ALIGN_STDDEV = 15;
  132. // Align the time series by returning the number of `True` values in
  133. // each alignment period. This aligner is valid for `GAUGE` metrics with
  134. // Boolean values. The `value_type` of the output is `INT64`.
  135. ALIGN_COUNT_TRUE = 16;
  136. // Align the time series by returning the number of `False` values in
  137. // each alignment period. This aligner is valid for `GAUGE` metrics with
  138. // Boolean values. The `value_type` of the output is `INT64`.
  139. ALIGN_COUNT_FALSE = 24;
  140. // Align the time series by returning the ratio of the number of `True`
  141. // values to the total number of values in each alignment period. This
  142. // aligner is valid for `GAUGE` metrics with Boolean values. The output
  143. // value is in the range [0.0, 1.0] and has `value_type` `DOUBLE`.
  144. ALIGN_FRACTION_TRUE = 17;
  145. // Align the time series by using [percentile
  146. // aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting
  147. // data point in each alignment period is the 99th percentile of all data
  148. // points in the period. This aligner is valid for `GAUGE` and `DELTA`
  149. // metrics with distribution values. The output is a `GAUGE` metric with
  150. // `value_type` `DOUBLE`.
  151. ALIGN_PERCENTILE_99 = 18;
  152. // Align the time series by using [percentile
  153. // aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting
  154. // data point in each alignment period is the 95th percentile of all data
  155. // points in the period. This aligner is valid for `GAUGE` and `DELTA`
  156. // metrics with distribution values. The output is a `GAUGE` metric with
  157. // `value_type` `DOUBLE`.
  158. ALIGN_PERCENTILE_95 = 19;
  159. // Align the time series by using [percentile
  160. // aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting
  161. // data point in each alignment period is the 50th percentile of all data
  162. // points in the period. This aligner is valid for `GAUGE` and `DELTA`
  163. // metrics with distribution values. The output is a `GAUGE` metric with
  164. // `value_type` `DOUBLE`.
  165. ALIGN_PERCENTILE_50 = 20;
  166. // Align the time series by using [percentile
  167. // aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting
  168. // data point in each alignment period is the 5th percentile of all data
  169. // points in the period. This aligner is valid for `GAUGE` and `DELTA`
  170. // metrics with distribution values. The output is a `GAUGE` metric with
  171. // `value_type` `DOUBLE`.
  172. ALIGN_PERCENTILE_05 = 21;
  173. // Align and convert to a percentage change. This aligner is valid for
  174. // `GAUGE` and `DELTA` metrics with numeric values. This alignment returns
  175. // `((current - previous)/previous) * 100`, where the value of `previous` is
  176. // determined based on the `alignment_period`.
  177. //
  178. // If the values of `current` and `previous` are both 0, then the returned
  179. // value is 0. If only `previous` is 0, the returned value is infinity.
  180. //
  181. // A 10-minute moving mean is computed at each point of the alignment period
  182. // prior to the above calculation to smooth the metric and prevent false
  183. // positives from very short-lived spikes. The moving mean is only
  184. // applicable for data whose values are `>= 0`. Any values `< 0` are
  185. // treated as a missing datapoint, and are ignored. While `DELTA`
  186. // metrics are accepted by this alignment, special care should be taken that
  187. // the values for the metric will always be positive. The output is a
  188. // `GAUGE` metric with `value_type` `DOUBLE`.
  189. ALIGN_PERCENT_CHANGE = 23;
  190. }
  191. // A Reducer operation describes how to aggregate data points from multiple
  192. // time series into a single time series, where the value of each data point
  193. // in the resulting series is a function of all the already aligned values in
  194. // the input time series.
  195. enum Reducer {
  196. // No cross-time series reduction. The output of the `Aligner` is
  197. // returned.
  198. REDUCE_NONE = 0;
  199. // Reduce by computing the mean value across time series for each
  200. // alignment period. This reducer is valid for
  201. // [DELTA][google.api.MetricDescriptor.MetricKind.DELTA] and
  202. // [GAUGE][google.api.MetricDescriptor.MetricKind.GAUGE] metrics with
  203. // numeric or distribution values. The `value_type` of the output is
  204. // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
  205. REDUCE_MEAN = 1;
  206. // Reduce by computing the minimum value across time series for each
  207. // alignment period. This reducer is valid for `DELTA` and `GAUGE` metrics
  208. // with numeric values. The `value_type` of the output is the same as the
  209. // `value_type` of the input.
  210. REDUCE_MIN = 2;
  211. // Reduce by computing the maximum value across time series for each
  212. // alignment period. This reducer is valid for `DELTA` and `GAUGE` metrics
  213. // with numeric values. The `value_type` of the output is the same as the
  214. // `value_type` of the input.
  215. REDUCE_MAX = 3;
  216. // Reduce by computing the sum across time series for each
  217. // alignment period. This reducer is valid for `DELTA` and `GAUGE` metrics
  218. // with numeric and distribution values. The `value_type` of the output is
  219. // the same as the `value_type` of the input.
  220. REDUCE_SUM = 4;
  221. // Reduce by computing the standard deviation across time series
  222. // for each alignment period. This reducer is valid for `DELTA` and
  223. // `GAUGE` metrics with numeric or distribution values. The `value_type`
  224. // of the output is `DOUBLE`.
  225. REDUCE_STDDEV = 5;
  226. // Reduce by computing the number of data points across time series
  227. // for each alignment period. This reducer is valid for `DELTA` and
  228. // `GAUGE` metrics of numeric, Boolean, distribution, and string
  229. // `value_type`. The `value_type` of the output is `INT64`.
  230. REDUCE_COUNT = 6;
  231. // Reduce by computing the number of `True`-valued data points across time
  232. // series for each alignment period. This reducer is valid for `DELTA` and
  233. // `GAUGE` metrics of Boolean `value_type`. The `value_type` of the output
  234. // is `INT64`.
  235. REDUCE_COUNT_TRUE = 7;
  236. // Reduce by computing the number of `False`-valued data points across time
  237. // series for each alignment period. This reducer is valid for `DELTA` and
  238. // `GAUGE` metrics of Boolean `value_type`. The `value_type` of the output
  239. // is `INT64`.
  240. REDUCE_COUNT_FALSE = 15;
  241. // Reduce by computing the ratio of the number of `True`-valued data points
  242. // to the total number of data points for each alignment period. This
  243. // reducer is valid for `DELTA` and `GAUGE` metrics of Boolean `value_type`.
  244. // The output value is in the range [0.0, 1.0] and has `value_type`
  245. // `DOUBLE`.
  246. REDUCE_FRACTION_TRUE = 8;
  247. // Reduce by computing the [99th
  248. // percentile](https://en.wikipedia.org/wiki/Percentile) of data points
  249. // across time series for each alignment period. This reducer is valid for
  250. // `GAUGE` and `DELTA` metrics of numeric and distribution type. The value
  251. // of the output is `DOUBLE`.
  252. REDUCE_PERCENTILE_99 = 9;
  253. // Reduce by computing the [95th
  254. // percentile](https://en.wikipedia.org/wiki/Percentile) of data points
  255. // across time series for each alignment period. This reducer is valid for
  256. // `GAUGE` and `DELTA` metrics of numeric and distribution type. The value
  257. // of the output is `DOUBLE`.
  258. REDUCE_PERCENTILE_95 = 10;
  259. // Reduce by computing the [50th
  260. // percentile](https://en.wikipedia.org/wiki/Percentile) of data points
  261. // across time series for each alignment period. This reducer is valid for
  262. // `GAUGE` and `DELTA` metrics of numeric and distribution type. The value
  263. // of the output is `DOUBLE`.
  264. REDUCE_PERCENTILE_50 = 11;
  265. // Reduce by computing the [5th
  266. // percentile](https://en.wikipedia.org/wiki/Percentile) of data points
  267. // across time series for each alignment period. This reducer is valid for
  268. // `GAUGE` and `DELTA` metrics of numeric and distribution type. The value
  269. // of the output is `DOUBLE`.
  270. REDUCE_PERCENTILE_05 = 12;
  271. }
  272. // The `alignment_period` specifies a time interval, in seconds, that is used
  273. // to divide the data in all the
  274. // [time series][google.monitoring.v3.TimeSeries] into consistent blocks of
  275. // time. This will be done before the per-series aligner can be applied to
  276. // the data.
  277. //
  278. // The value must be at least 60 seconds. If a per-series aligner other than
  279. // `ALIGN_NONE` is specified, this field is required or an error is returned.
  280. // If no per-series aligner is specified, or the aligner `ALIGN_NONE` is
  281. // specified, then this field is ignored.
  282. //
  283. // The maximum value of the `alignment_period` is 2 years, or 104 weeks.
  284. google.protobuf.Duration alignment_period = 1;
  285. // An `Aligner` describes how to bring the data points in a single
  286. // time series into temporal alignment. Except for `ALIGN_NONE`, all
  287. // alignments cause all the data points in an `alignment_period` to be
  288. // mathematically grouped together, resulting in a single data point for
  289. // each `alignment_period` with end timestamp at the end of the period.
  290. //
  291. // Not all alignment operations may be applied to all time series. The valid
  292. // choices depend on the `metric_kind` and `value_type` of the original time
  293. // series. Alignment can change the `metric_kind` or the `value_type` of
  294. // the time series.
  295. //
  296. // Time series data must be aligned in order to perform cross-time
  297. // series reduction. If `cross_series_reducer` is specified, then
  298. // `per_series_aligner` must be specified and not equal to `ALIGN_NONE`
  299. // and `alignment_period` must be specified; otherwise, an error is
  300. // returned.
  301. Aligner per_series_aligner = 2;
  302. // The reduction operation to be used to combine time series into a single
  303. // time series, where the value of each data point in the resulting series is
  304. // a function of all the already aligned values in the input time series.
  305. //
  306. // Not all reducer operations can be applied to all time series. The valid
  307. // choices depend on the `metric_kind` and the `value_type` of the original
  308. // time series. Reduction can yield a time series with a different
  309. // `metric_kind` or `value_type` than the input time series.
  310. //
  311. // Time series data must first be aligned (see `per_series_aligner`) in order
  312. // to perform cross-time series reduction. If `cross_series_reducer` is
  313. // specified, then `per_series_aligner` must be specified, and must not be
  314. // `ALIGN_NONE`. An `alignment_period` must also be specified; otherwise, an
  315. // error is returned.
  316. Reducer cross_series_reducer = 4;
  317. // The set of fields to preserve when `cross_series_reducer` is
  318. // specified. The `group_by_fields` determine how the time series are
  319. // partitioned into subsets prior to applying the aggregation
  320. // operation. Each subset contains time series that have the same
  321. // value for each of the grouping fields. Each individual time
  322. // series is a member of exactly one subset. The
  323. // `cross_series_reducer` is applied to each subset of time series.
  324. // It is not possible to reduce across different resource types, so
  325. // this field implicitly contains `resource.type`. Fields not
  326. // specified in `group_by_fields` are aggregated away. If
  327. // `group_by_fields` is not specified and all the time series have
  328. // the same resource type, then the time series are aggregated into
  329. // a single output time series. If `cross_series_reducer` is not
  330. // defined, this field is ignored.
  331. repeated string group_by_fields = 5;
  332. }
  333. // Describes a ranking-based time series filter. Each input time series is
  334. // ranked with an aligner. The filter will allow up to `num_time_series` time
  335. // series to pass through it, selecting them based on the relative ranking.
  336. //
  337. // For example, if `ranking_method` is `METHOD_MEAN`,`direction` is `BOTTOM`,
  338. // and `num_time_series` is 3, then the 3 times series with the lowest mean
  339. // values will pass through the filter.
  340. message PickTimeSeriesFilter {
  341. // The value reducers that can be applied to a `PickTimeSeriesFilter`.
  342. enum Method {
  343. // Not allowed. You must specify a different `Method` if you specify a
  344. // `PickTimeSeriesFilter`.
  345. METHOD_UNSPECIFIED = 0;
  346. // Select the mean of all values.
  347. METHOD_MEAN = 1;
  348. // Select the maximum value.
  349. METHOD_MAX = 2;
  350. // Select the minimum value.
  351. METHOD_MIN = 3;
  352. // Compute the sum of all values.
  353. METHOD_SUM = 4;
  354. // Select the most recent value.
  355. METHOD_LATEST = 5;
  356. }
  357. // Describes the ranking directions.
  358. enum Direction {
  359. // Not allowed. You must specify a different `Direction` if you specify a
  360. // `PickTimeSeriesFilter`.
  361. DIRECTION_UNSPECIFIED = 0;
  362. // Pass the highest `num_time_series` ranking inputs.
  363. TOP = 1;
  364. // Pass the lowest `num_time_series` ranking inputs.
  365. BOTTOM = 2;
  366. }
  367. // `ranking_method` is applied to each time series independently to produce
  368. // the value which will be used to compare the time series to other time
  369. // series.
  370. Method ranking_method = 1;
  371. // How many time series to allow to pass through the filter.
  372. int32 num_time_series = 2;
  373. // How to use the ranking to select time series that pass through the filter.
  374. Direction direction = 3;
  375. }
  376. // A filter that ranks streams based on their statistical relation to other
  377. // streams in a request.
  378. // Note: This field is deprecated and completely ignored by the API.
  379. message StatisticalTimeSeriesFilter {
  380. // The filter methods that can be applied to a stream.
  381. enum Method {
  382. // Not allowed in well-formed requests.
  383. METHOD_UNSPECIFIED = 0;
  384. // Compute the outlier score of each stream.
  385. METHOD_CLUSTER_OUTLIER = 1;
  386. }
  387. // `rankingMethod` is applied to a set of time series, and then the produced
  388. // value for each individual time series is used to compare a given time
  389. // series to others.
  390. // These are methods that cannot be applied stream-by-stream, but rather
  391. // require the full context of a request to evaluate time series.
  392. Method ranking_method = 1;
  393. // How many time series to output.
  394. int32 num_time_series = 2;
  395. }