common.proto 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. // Copyright 2021 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.v3;
  16. import "google/api/distribution.proto";
  17. import "google/protobuf/duration.proto";
  18. import "google/protobuf/timestamp.proto";
  19. option csharp_namespace = "Google.Cloud.Monitoring.V3";
  20. option go_package = "google.golang.org/genproto/googleapis/monitoring/v3;monitoring";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "CommonProto";
  23. option java_package = "com.google.monitoring.v3";
  24. option php_namespace = "Google\\Cloud\\Monitoring\\V3";
  25. option ruby_package = "Google::Cloud::Monitoring::V3";
  26. // A single strongly-typed value.
  27. message TypedValue {
  28. // The typed value field.
  29. oneof value {
  30. // A Boolean value: `true` or `false`.
  31. bool bool_value = 1;
  32. // A 64-bit integer. Its range is approximately &plusmn;9.2x10<sup>18</sup>.
  33. int64 int64_value = 2;
  34. // A 64-bit double-precision floating-point number. Its magnitude
  35. // is approximately &plusmn;10<sup>&plusmn;300</sup> and it has 16
  36. // significant digits of precision.
  37. double double_value = 3;
  38. // A variable-length string value.
  39. string string_value = 4;
  40. // A distribution value.
  41. google.api.Distribution distribution_value = 5;
  42. }
  43. }
  44. // A closed time interval. It extends from the start time to the end time, and includes both: `[startTime, endTime]`. Valid time intervals depend on the [`MetricKind`](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricKind) of the metric value. The end time must not be earlier than the start time. When writing data points, the start time must not be more than 25 hours in the past and the end time must not be more than five minutes in the future.
  45. //
  46. // * For `GAUGE` metrics, the `startTime` value is technically optional; if
  47. // no value is specified, the start time defaults to the value of the
  48. // end time, and the interval represents a single point in time. If both
  49. // start and end times are specified, they must be identical. Such an
  50. // interval is valid only for `GAUGE` metrics, which are point-in-time
  51. // measurements. The end time of a new interval must be at least a
  52. // millisecond after the end time of the previous interval.
  53. //
  54. // * For `DELTA` metrics, the start time and end time must specify a
  55. // non-zero interval, with subsequent points specifying contiguous and
  56. // non-overlapping intervals. For `DELTA` metrics, the start time of
  57. // the next interval must be at least a millisecond after the end time
  58. // of the previous interval.
  59. //
  60. // * For `CUMULATIVE` metrics, the start time and end time must specify a
  61. // non-zero interval, with subsequent points specifying the same
  62. // start time and increasing end times, until an event resets the
  63. // cumulative value to zero and sets a new start time for the following
  64. // points. The new start time must be at least a millisecond after the
  65. // end time of the previous interval.
  66. //
  67. // * The start time of a new interval must be at least a millisecond after the
  68. // end time of the previous interval because intervals are closed. If the
  69. // start time of a new interval is the same as the end time of the previous
  70. // interval, then data written at the new start time could overwrite data
  71. // written at the previous end time.
  72. message TimeInterval {
  73. // Required. The end of the time interval.
  74. google.protobuf.Timestamp end_time = 2;
  75. // Optional. The beginning of the time interval. The default value
  76. // for the start time is the end time. The start time must not be
  77. // later than the end time.
  78. google.protobuf.Timestamp start_time = 1;
  79. }
  80. // Describes how to combine multiple time series to provide a different view of
  81. // the data. Aggregation of time series is done in two steps. First, each time
  82. // series in the set is _aligned_ to the same time interval boundaries, then the
  83. // set of time series is optionally _reduced_ in number.
  84. //
  85. // Alignment consists of applying the `per_series_aligner` operation
  86. // to each time series after its data has been divided into regular
  87. // `alignment_period` time intervals. This process takes _all_ of the data
  88. // points in an alignment period, applies a mathematical transformation such as
  89. // averaging, minimum, maximum, delta, etc., and converts them into a single
  90. // data point per period.
  91. //
  92. // Reduction is when the aligned and transformed time series can optionally be
  93. // combined, reducing the number of time series through similar mathematical
  94. // transformations. Reduction involves applying a `cross_series_reducer` to
  95. // all the time series, optionally sorting the time series into subsets with
  96. // `group_by_fields`, and applying the reducer to each subset.
  97. //
  98. // The raw time series data can contain a huge amount of information from
  99. // multiple sources. Alignment and reduction transforms this mass of data into
  100. // a more manageable and representative collection of data, for example "the
  101. // 95% latency across the average of all tasks in a cluster". This
  102. // representative data can be more easily graphed and comprehended, and the
  103. // individual time series data is still available for later drilldown. For more
  104. // details, see [Filtering and
  105. // aggregation](https://cloud.google.com/monitoring/api/v3/aggregation).
  106. message Aggregation {
  107. // The `Aligner` specifies the operation that will be applied to the data
  108. // points in each alignment period in a time series. Except for
  109. // `ALIGN_NONE`, which specifies that no operation be applied, each alignment
  110. // operation replaces the set of data values in each alignment period with
  111. // a single value: the result of applying the operation to the data values.
  112. // An aligned time series has a single data value at the end of each
  113. // `alignment_period`.
  114. //
  115. // An alignment operation can change the data type of the values, too. For
  116. // example, if you apply a counting operation to boolean values, the data
  117. // `value_type` in the original time series is `BOOLEAN`, but the `value_type`
  118. // in the aligned result is `INT64`.
  119. enum Aligner {
  120. // No alignment. Raw data is returned. Not valid if cross-series reduction
  121. // is requested. The `value_type` of the result is the same as the
  122. // `value_type` of the input.
  123. ALIGN_NONE = 0;
  124. // Align and convert to
  125. // [DELTA][google.api.MetricDescriptor.MetricKind.DELTA].
  126. // The output is `delta = y1 - y0`.
  127. //
  128. // This alignment is valid for
  129. // [CUMULATIVE][google.api.MetricDescriptor.MetricKind.CUMULATIVE] and
  130. // `DELTA` metrics. If the selected alignment period results in periods
  131. // with no data, then the aligned value for such a period is created by
  132. // interpolation. The `value_type` of the aligned result is the same as
  133. // the `value_type` of the input.
  134. ALIGN_DELTA = 1;
  135. // Align and convert to a rate. The result is computed as
  136. // `rate = (y1 - y0)/(t1 - t0)`, or "delta over time".
  137. // Think of this aligner as providing the slope of the line that passes
  138. // through the value at the start and at the end of the `alignment_period`.
  139. //
  140. // This aligner is valid for `CUMULATIVE`
  141. // and `DELTA` metrics with numeric values. If the selected alignment
  142. // period results in periods with no data, then the aligned value for
  143. // such a period is created by interpolation. The output is a `GAUGE`
  144. // metric with `value_type` `DOUBLE`.
  145. //
  146. // If, by "rate", you mean "percentage change", see the
  147. // `ALIGN_PERCENT_CHANGE` aligner instead.
  148. ALIGN_RATE = 2;
  149. // Align by interpolating between adjacent points around the alignment
  150. // period boundary. This aligner is valid for `GAUGE` metrics with
  151. // numeric values. The `value_type` of the aligned result is the same as the
  152. // `value_type` of the input.
  153. ALIGN_INTERPOLATE = 3;
  154. // Align by moving the most recent data point before the end of the
  155. // alignment period to the boundary at the end of the alignment
  156. // period. This aligner is valid for `GAUGE` metrics. The `value_type` of
  157. // the aligned result is the same as the `value_type` of the input.
  158. ALIGN_NEXT_OLDER = 4;
  159. // Align the time series by returning the minimum value in each alignment
  160. // period. This aligner is valid for `GAUGE` and `DELTA` metrics with
  161. // numeric values. The `value_type` of the aligned result is the same as
  162. // the `value_type` of the input.
  163. ALIGN_MIN = 10;
  164. // Align the time series by returning the maximum value in each alignment
  165. // period. This aligner is valid for `GAUGE` and `DELTA` metrics with
  166. // numeric values. The `value_type` of the aligned result is the same as
  167. // the `value_type` of the input.
  168. ALIGN_MAX = 11;
  169. // Align the time series by returning the mean value in each alignment
  170. // period. This aligner is valid for `GAUGE` and `DELTA` metrics with
  171. // numeric values. The `value_type` of the aligned result is `DOUBLE`.
  172. ALIGN_MEAN = 12;
  173. // Align the time series by returning the number of values in each alignment
  174. // period. This aligner is valid for `GAUGE` and `DELTA` metrics with
  175. // numeric or Boolean values. The `value_type` of the aligned result is
  176. // `INT64`.
  177. ALIGN_COUNT = 13;
  178. // Align the time series by returning the sum of the values in each
  179. // alignment period. This aligner is valid for `GAUGE` and `DELTA`
  180. // metrics with numeric and distribution values. The `value_type` of the
  181. // aligned result is the same as the `value_type` of the input.
  182. ALIGN_SUM = 14;
  183. // Align the time series by returning the standard deviation of the values
  184. // in each alignment period. This aligner is valid for `GAUGE` and
  185. // `DELTA` metrics with numeric values. The `value_type` of the output is
  186. // `DOUBLE`.
  187. ALIGN_STDDEV = 15;
  188. // Align the time series by returning the number of `True` values in
  189. // each alignment period. This aligner is valid for `GAUGE` metrics with
  190. // Boolean values. The `value_type` of the output is `INT64`.
  191. ALIGN_COUNT_TRUE = 16;
  192. // Align the time series by returning the number of `False` values in
  193. // each alignment period. This aligner is valid for `GAUGE` metrics with
  194. // Boolean values. The `value_type` of the output is `INT64`.
  195. ALIGN_COUNT_FALSE = 24;
  196. // Align the time series by returning the ratio of the number of `True`
  197. // values to the total number of values in each alignment period. This
  198. // aligner is valid for `GAUGE` metrics with Boolean values. The output
  199. // value is in the range [0.0, 1.0] and has `value_type` `DOUBLE`.
  200. ALIGN_FRACTION_TRUE = 17;
  201. // Align the time series by using [percentile
  202. // aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting
  203. // data point in each alignment period is the 99th percentile of all data
  204. // points in the period. This aligner is valid for `GAUGE` and `DELTA`
  205. // metrics with distribution values. The output is a `GAUGE` metric with
  206. // `value_type` `DOUBLE`.
  207. ALIGN_PERCENTILE_99 = 18;
  208. // Align the time series by using [percentile
  209. // aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting
  210. // data point in each alignment period is the 95th percentile of all data
  211. // points in the period. This aligner is valid for `GAUGE` and `DELTA`
  212. // metrics with distribution values. The output is a `GAUGE` metric with
  213. // `value_type` `DOUBLE`.
  214. ALIGN_PERCENTILE_95 = 19;
  215. // Align the time series by using [percentile
  216. // aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting
  217. // data point in each alignment period is the 50th percentile of all data
  218. // points in the period. This aligner is valid for `GAUGE` and `DELTA`
  219. // metrics with distribution values. The output is a `GAUGE` metric with
  220. // `value_type` `DOUBLE`.
  221. ALIGN_PERCENTILE_50 = 20;
  222. // Align the time series by using [percentile
  223. // aggregation](https://en.wikipedia.org/wiki/Percentile). The resulting
  224. // data point in each alignment period is the 5th percentile of all data
  225. // points in the period. This aligner is valid for `GAUGE` and `DELTA`
  226. // metrics with distribution values. The output is a `GAUGE` metric with
  227. // `value_type` `DOUBLE`.
  228. ALIGN_PERCENTILE_05 = 21;
  229. // Align and convert to a percentage change. This aligner is valid for
  230. // `GAUGE` and `DELTA` metrics with numeric values. This alignment returns
  231. // `((current - previous)/previous) * 100`, where the value of `previous` is
  232. // determined based on the `alignment_period`.
  233. //
  234. // If the values of `current` and `previous` are both 0, then the returned
  235. // value is 0. If only `previous` is 0, the returned value is infinity.
  236. //
  237. // A 10-minute moving mean is computed at each point of the alignment period
  238. // prior to the above calculation to smooth the metric and prevent false
  239. // positives from very short-lived spikes. The moving mean is only
  240. // applicable for data whose values are `>= 0`. Any values `< 0` are
  241. // treated as a missing datapoint, and are ignored. While `DELTA`
  242. // metrics are accepted by this alignment, special care should be taken that
  243. // the values for the metric will always be positive. The output is a
  244. // `GAUGE` metric with `value_type` `DOUBLE`.
  245. ALIGN_PERCENT_CHANGE = 23;
  246. }
  247. // A Reducer operation describes how to aggregate data points from multiple
  248. // time series into a single time series, where the value of each data point
  249. // in the resulting series is a function of all the already aligned values in
  250. // the input time series.
  251. enum Reducer {
  252. // No cross-time series reduction. The output of the `Aligner` is
  253. // returned.
  254. REDUCE_NONE = 0;
  255. // Reduce by computing the mean value across time series for each
  256. // alignment period. This reducer is valid for
  257. // [DELTA][google.api.MetricDescriptor.MetricKind.DELTA] and
  258. // [GAUGE][google.api.MetricDescriptor.MetricKind.GAUGE] metrics with
  259. // numeric or distribution values. The `value_type` of the output is
  260. // [DOUBLE][google.api.MetricDescriptor.ValueType.DOUBLE].
  261. REDUCE_MEAN = 1;
  262. // Reduce by computing the minimum value across time series for each
  263. // alignment period. This reducer is valid for `DELTA` and `GAUGE` metrics
  264. // with numeric values. The `value_type` of the output is the same as the
  265. // `value_type` of the input.
  266. REDUCE_MIN = 2;
  267. // Reduce by computing the maximum value across time series for each
  268. // alignment period. This reducer is valid for `DELTA` and `GAUGE` metrics
  269. // with numeric values. The `value_type` of the output is the same as the
  270. // `value_type` of the input.
  271. REDUCE_MAX = 3;
  272. // Reduce by computing the sum across time series for each
  273. // alignment period. This reducer is valid for `DELTA` and `GAUGE` metrics
  274. // with numeric and distribution values. The `value_type` of the output is
  275. // the same as the `value_type` of the input.
  276. REDUCE_SUM = 4;
  277. // Reduce by computing the standard deviation across time series
  278. // for each alignment period. This reducer is valid for `DELTA` and
  279. // `GAUGE` metrics with numeric or distribution values. The `value_type`
  280. // of the output is `DOUBLE`.
  281. REDUCE_STDDEV = 5;
  282. // Reduce by computing the number of data points across time series
  283. // for each alignment period. This reducer is valid for `DELTA` and
  284. // `GAUGE` metrics of numeric, Boolean, distribution, and string
  285. // `value_type`. The `value_type` of the output is `INT64`.
  286. REDUCE_COUNT = 6;
  287. // Reduce by computing the number of `True`-valued data points across time
  288. // series for each alignment period. This reducer is valid for `DELTA` and
  289. // `GAUGE` metrics of Boolean `value_type`. The `value_type` of the output
  290. // is `INT64`.
  291. REDUCE_COUNT_TRUE = 7;
  292. // Reduce by computing the number of `False`-valued data points across time
  293. // series for each alignment period. This reducer is valid for `DELTA` and
  294. // `GAUGE` metrics of Boolean `value_type`. The `value_type` of the output
  295. // is `INT64`.
  296. REDUCE_COUNT_FALSE = 15;
  297. // Reduce by computing the ratio of the number of `True`-valued data points
  298. // to the total number of data points for each alignment period. This
  299. // reducer is valid for `DELTA` and `GAUGE` metrics of Boolean `value_type`.
  300. // The output value is in the range [0.0, 1.0] and has `value_type`
  301. // `DOUBLE`.
  302. REDUCE_FRACTION_TRUE = 8;
  303. // Reduce by computing the [99th
  304. // percentile](https://en.wikipedia.org/wiki/Percentile) of data points
  305. // across time series for each alignment period. This reducer is valid for
  306. // `GAUGE` and `DELTA` metrics of numeric and distribution type. The value
  307. // of the output is `DOUBLE`.
  308. REDUCE_PERCENTILE_99 = 9;
  309. // Reduce by computing the [95th
  310. // percentile](https://en.wikipedia.org/wiki/Percentile) of data points
  311. // across time series for each alignment period. This reducer is valid for
  312. // `GAUGE` and `DELTA` metrics of numeric and distribution type. The value
  313. // of the output is `DOUBLE`.
  314. REDUCE_PERCENTILE_95 = 10;
  315. // Reduce by computing the [50th
  316. // percentile](https://en.wikipedia.org/wiki/Percentile) of data points
  317. // across time series for each alignment period. This reducer is valid for
  318. // `GAUGE` and `DELTA` metrics of numeric and distribution type. The value
  319. // of the output is `DOUBLE`.
  320. REDUCE_PERCENTILE_50 = 11;
  321. // Reduce by computing the [5th
  322. // percentile](https://en.wikipedia.org/wiki/Percentile) of data points
  323. // across time series for each alignment period. This reducer is valid for
  324. // `GAUGE` and `DELTA` metrics of numeric and distribution type. The value
  325. // of the output is `DOUBLE`.
  326. REDUCE_PERCENTILE_05 = 12;
  327. }
  328. // The `alignment_period` specifies a time interval, in seconds, that is used
  329. // to divide the data in all the
  330. // [time series][google.monitoring.v3.TimeSeries] into consistent blocks of
  331. // time. This will be done before the per-series aligner can be applied to
  332. // the data.
  333. //
  334. // The value must be at least 60 seconds. If a per-series
  335. // aligner other than `ALIGN_NONE` is specified, this field is required or an
  336. // error is returned. If no per-series aligner is specified, or the aligner
  337. // `ALIGN_NONE` is specified, then this field is ignored.
  338. //
  339. // The maximum value of the `alignment_period` is 104 weeks (2 years) for
  340. // charts, and 90,000 seconds (25 hours) for alerting policies.
  341. google.protobuf.Duration alignment_period = 1;
  342. // An `Aligner` describes how to bring the data points in a single
  343. // time series into temporal alignment. Except for `ALIGN_NONE`, all
  344. // alignments cause all the data points in an `alignment_period` to be
  345. // mathematically grouped together, resulting in a single data point for
  346. // each `alignment_period` with end timestamp at the end of the period.
  347. //
  348. // Not all alignment operations may be applied to all time series. The valid
  349. // choices depend on the `metric_kind` and `value_type` of the original time
  350. // series. Alignment can change the `metric_kind` or the `value_type` of
  351. // the time series.
  352. //
  353. // Time series data must be aligned in order to perform cross-time
  354. // series reduction. If `cross_series_reducer` is specified, then
  355. // `per_series_aligner` must be specified and not equal to `ALIGN_NONE`
  356. // and `alignment_period` must be specified; otherwise, an error is
  357. // returned.
  358. Aligner per_series_aligner = 2;
  359. // The reduction operation to be used to combine time series into a single
  360. // time series, where the value of each data point in the resulting series is
  361. // a function of all the already aligned values in the input time series.
  362. //
  363. // Not all reducer operations can be applied to all time series. The valid
  364. // choices depend on the `metric_kind` and the `value_type` of the original
  365. // time series. Reduction can yield a time series with a different
  366. // `metric_kind` or `value_type` than the input time series.
  367. //
  368. // Time series data must first be aligned (see `per_series_aligner`) in order
  369. // to perform cross-time series reduction. If `cross_series_reducer` is
  370. // specified, then `per_series_aligner` must be specified, and must not be
  371. // `ALIGN_NONE`. An `alignment_period` must also be specified; otherwise, an
  372. // error is returned.
  373. Reducer cross_series_reducer = 4;
  374. // The set of fields to preserve when `cross_series_reducer` is
  375. // specified. The `group_by_fields` determine how the time series are
  376. // partitioned into subsets prior to applying the aggregation
  377. // operation. Each subset contains time series that have the same
  378. // value for each of the grouping fields. Each individual time
  379. // series is a member of exactly one subset. The
  380. // `cross_series_reducer` is applied to each subset of time series.
  381. // It is not possible to reduce across different resource types, so
  382. // this field implicitly contains `resource.type`. Fields not
  383. // specified in `group_by_fields` are aggregated away. If
  384. // `group_by_fields` is not specified and all the time series have
  385. // the same resource type, then the time series are aggregated into
  386. // a single output time series. If `cross_series_reducer` is not
  387. // defined, this field is ignored.
  388. repeated string group_by_fields = 5;
  389. }
  390. // Specifies an ordering relationship on two arguments, called `left` and
  391. // `right`.
  392. enum ComparisonType {
  393. // No ordering relationship is specified.
  394. COMPARISON_UNSPECIFIED = 0;
  395. // True if the left argument is greater than the right argument.
  396. COMPARISON_GT = 1;
  397. // True if the left argument is greater than or equal to the right argument.
  398. COMPARISON_GE = 2;
  399. // True if the left argument is less than the right argument.
  400. COMPARISON_LT = 3;
  401. // True if the left argument is less than or equal to the right argument.
  402. COMPARISON_LE = 4;
  403. // True if the left argument is equal to the right argument.
  404. COMPARISON_EQ = 5;
  405. // True if the left argument is not equal to the right argument.
  406. COMPARISON_NE = 6;
  407. }
  408. // The tier of service for a Workspace. Please see the
  409. // [service tiers
  410. // documentation](https://cloud.google.com/monitoring/workspaces/tiers) for more
  411. // details.
  412. enum ServiceTier {
  413. option deprecated = true;
  414. // An invalid sentinel value, used to indicate that a tier has not
  415. // been provided explicitly.
  416. SERVICE_TIER_UNSPECIFIED = 0;
  417. // The Stackdriver Basic tier, a free tier of service that provides basic
  418. // features, a moderate allotment of logs, and access to built-in metrics.
  419. // A number of features are not available in this tier. For more details,
  420. // see [the service tiers
  421. // documentation](https://cloud.google.com/monitoring/workspaces/tiers).
  422. SERVICE_TIER_BASIC = 1;
  423. // The Stackdriver Premium tier, a higher, more expensive tier of service
  424. // that provides access to all Stackdriver features, lets you use Stackdriver
  425. // with AWS accounts, and has a larger allotments for logs and metrics. For
  426. // more details, see [the service tiers
  427. // documentation](https://cloud.google.com/monitoring/workspaces/tiers).
  428. SERVICE_TIER_PREMIUM = 2;
  429. }