Class: Google::Cloud::Monitoring::V3::AlertPolicy::Condition

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/monitoring/v3/alert.rb

Overview

A condition is a true/false test that determines when an alerting policy should open an incident. If a condition evaluates to true, it signifies that something is wrong.

Defined Under Namespace

Classes: LogMatch, MetricAbsence, MetricThreshold, MonitoringQueryLanguageCondition, Trigger

Instance Attribute Summary collapse

Instance Attribute Details

#condition_absent::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::MetricAbsence

Returns A condition that checks that a time series continues to receive new data points.

Returns:



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'proto_docs/google/monitoring/v3/alert.rb', line 182

class Condition
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Specifies how many time series must fail a predicate to trigger a
  # condition. If not specified, then a `{count: 1}` trigger is used.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The absolute number of time series that must fail
  #     the predicate for the condition to be triggered.
  # @!attribute [rw] percent
  #   @return [::Float]
  #     The percentage of time series that must fail the
  #     predicate for the condition to be triggered.
  class Trigger
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that compares a collection of time series
  # against a threshold.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies which time series should be compared with the threshold.
  #
  #     The filter is similar to the one that is specified in the
  #     [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
  #     (that call is useful to verify the time series that will be retrieved /
  #     processed). The filter must specify the metric type and the resource
  #     type. Optionally, it can specify resource labels and metric labels.
  #     This field must not exceed 2048 Unicode characters in length.
  # @!attribute [rw] aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resrouces). Multiple aggregations
  #     are applied in the order specified.
  #
  #     This field is similar to the one in the [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
  #     It is advisable to use the `ListTimeSeries` method when debugging this
  #     field.
  # @!attribute [rw] denominator_filter
  #   @return [::String]
  #     A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies a time series that should be used as the denominator of a
  #     ratio that will be compared with the threshold. If a
  #     `denominator_filter` is specified, the time series specified by the
  #     `filter` field will be used as the numerator.
  #
  #     The filter must specify the metric type and optionally may contain
  #     restrictions on resource type, resource labels, and metric labels.
  #     This field may not exceed 2048 Unicode characters in length.
  # @!attribute [rw] denominator_aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series
  #     selected by `denominatorFilter` as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resources).
  #
  #     When computing ratios, the `aggregations` and
  #     `denominator_aggregations` fields must use the same alignment period
  #     and produce time series that have the same periodicity and labels.
  # @!attribute [rw] comparison
  #   @return [::Google::Cloud::Monitoring::V3::ComparisonType]
  #     The comparison to apply between the time series (indicated by `filter`
  #     and `aggregation`) and the threshold (indicated by `threshold_value`).
  #     The comparison is applied on each time series, with the time series
  #     on the left-hand side and the threshold on the right-hand side.
  #
  #     Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
  # @!attribute [rw] threshold_value
  #   @return [::Float]
  #     A value against which to compare the time series.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must violate the
  #     threshold to be considered failing. Currently, only values
  #     that are a multiple of a minute--e.g., 0, 60, 120, or 300
  #     seconds--are supported. If an invalid value is given, an
  #     error will be returned. When choosing a duration, it is useful to
  #     keep in mind the frequency of the underlying time series data
  #     (which may also be affected by any alignments specified in the
  #     `aggregations` field); a good duration is long enough so that a single
  #     outlier does not generate spurious alerts, but short enough that
  #     unhealthy states are detected and alerted on quickly.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`,
  #     or by the ratio, if `denominator_filter` and `denominator_aggregations`
  #     are specified.
  class MetricThreshold
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that checks that monitored resources
  # are reporting data. The configuration defines a metric and
  # a set of monitored resources. The predicate is considered in violation
  # when a time series for the specified metric of a monitored
  # resource does not include any data in the specified `duration`.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies which time series should be compared with the threshold.
  #
  #     The filter is similar to the one that is specified in the
  #     [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
  #     (that call is useful to verify the time series that will be retrieved /
  #     processed). The filter must specify the metric type and the resource
  #     type. Optionally, it can specify resource labels and metric labels.
  #     This field must not exceed 2048 Unicode characters in length.
  # @!attribute [rw] aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resrouces). Multiple aggregations
  #     are applied in the order specified.
  #
  #     This field is similar to the one in the [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
  #     It is advisable to use the `ListTimeSeries` method when debugging this
  #     field.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must fail to report new
  #     data to be considered failing. The minimum value of this field
  #     is 120 seconds. Larger values that are a multiple of a
  #     minute--for example, 240 or 300 seconds--are supported.
  #     If an invalid value is given, an
  #     error will be returned. The `Duration.nanos` field is
  #     ignored.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`.
  class MetricAbsence
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that checks whether a log message in the [scoping
  # project](https://cloud.google.com/monitoring/api/v3#project_name)
  # satisfies the given filter. Logs from other projects in the metrics
  # scope are not evaluated.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A logs-based filter. See [Advanced Logs
  #     Queries](/logging/docs/view/advanced-queries) for how this filter
  #     should be constructed.
  # @!attribute [rw] label_extractors
  #   @return [::Google::Protobuf::Map{::String => ::String}]
  #     Optional. A map from a label key to an extractor expression, which is
  #     used to extract the value for this label key. Each entry in this map is
  #     a specification for how data should be extracted from log entries that
  #     match `filter`. Each combination of extracted values is treated as a
  #     separate rule for the purposes of triggering notifications. Label keys
  #     and corresponding values can be used in notifications generated by this
  #     condition.
  #
  #     Please see [the documentation on logs-based metric
  #     `valueExtractor`s](/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
  #     for syntax and examples.
  class LogMatch
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::String]
    class LabelExtractorsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A condition type that allows alert policies to be defined using
  # [Monitoring Query Language](https://cloud.google.com/monitoring/mql).
  # @!attribute [rw] query
  #   @return [::String]
  #     [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
  #     query that outputs a boolean stream.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must violate the
  #     threshold to be considered failing. Currently, only values
  #     that are a multiple of a minute--e.g., 0, 60, 120, or 300
  #     seconds--are supported. If an invalid value is given, an
  #     error will be returned. When choosing a duration, it is useful to
  #     keep in mind the frequency of the underlying time series data
  #     (which may also be affected by any alignments specified in the
  #     `aggregations` field); a good duration is long enough so that a single
  #     outlier does not generate spurious alerts, but short enough that
  #     unhealthy states are detected and alerted on quickly.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`,
  #     or by the ratio, if `denominator_filter` and `denominator_aggregations`
  #     are specified.
  class MonitoringQueryLanguageCondition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#condition_matched_log::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::LogMatch

Returns A condition that checks for log messages matching given constraints. If set, no other conditions can be present.

Returns:



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'proto_docs/google/monitoring/v3/alert.rb', line 182

class Condition
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Specifies how many time series must fail a predicate to trigger a
  # condition. If not specified, then a `{count: 1}` trigger is used.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The absolute number of time series that must fail
  #     the predicate for the condition to be triggered.
  # @!attribute [rw] percent
  #   @return [::Float]
  #     The percentage of time series that must fail the
  #     predicate for the condition to be triggered.
  class Trigger
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that compares a collection of time series
  # against a threshold.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies which time series should be compared with the threshold.
  #
  #     The filter is similar to the one that is specified in the
  #     [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
  #     (that call is useful to verify the time series that will be retrieved /
  #     processed). The filter must specify the metric type and the resource
  #     type. Optionally, it can specify resource labels and metric labels.
  #     This field must not exceed 2048 Unicode characters in length.
  # @!attribute [rw] aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resrouces). Multiple aggregations
  #     are applied in the order specified.
  #
  #     This field is similar to the one in the [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
  #     It is advisable to use the `ListTimeSeries` method when debugging this
  #     field.
  # @!attribute [rw] denominator_filter
  #   @return [::String]
  #     A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies a time series that should be used as the denominator of a
  #     ratio that will be compared with the threshold. If a
  #     `denominator_filter` is specified, the time series specified by the
  #     `filter` field will be used as the numerator.
  #
  #     The filter must specify the metric type and optionally may contain
  #     restrictions on resource type, resource labels, and metric labels.
  #     This field may not exceed 2048 Unicode characters in length.
  # @!attribute [rw] denominator_aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series
  #     selected by `denominatorFilter` as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resources).
  #
  #     When computing ratios, the `aggregations` and
  #     `denominator_aggregations` fields must use the same alignment period
  #     and produce time series that have the same periodicity and labels.
  # @!attribute [rw] comparison
  #   @return [::Google::Cloud::Monitoring::V3::ComparisonType]
  #     The comparison to apply between the time series (indicated by `filter`
  #     and `aggregation`) and the threshold (indicated by `threshold_value`).
  #     The comparison is applied on each time series, with the time series
  #     on the left-hand side and the threshold on the right-hand side.
  #
  #     Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
  # @!attribute [rw] threshold_value
  #   @return [::Float]
  #     A value against which to compare the time series.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must violate the
  #     threshold to be considered failing. Currently, only values
  #     that are a multiple of a minute--e.g., 0, 60, 120, or 300
  #     seconds--are supported. If an invalid value is given, an
  #     error will be returned. When choosing a duration, it is useful to
  #     keep in mind the frequency of the underlying time series data
  #     (which may also be affected by any alignments specified in the
  #     `aggregations` field); a good duration is long enough so that a single
  #     outlier does not generate spurious alerts, but short enough that
  #     unhealthy states are detected and alerted on quickly.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`,
  #     or by the ratio, if `denominator_filter` and `denominator_aggregations`
  #     are specified.
  class MetricThreshold
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that checks that monitored resources
  # are reporting data. The configuration defines a metric and
  # a set of monitored resources. The predicate is considered in violation
  # when a time series for the specified metric of a monitored
  # resource does not include any data in the specified `duration`.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies which time series should be compared with the threshold.
  #
  #     The filter is similar to the one that is specified in the
  #     [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
  #     (that call is useful to verify the time series that will be retrieved /
  #     processed). The filter must specify the metric type and the resource
  #     type. Optionally, it can specify resource labels and metric labels.
  #     This field must not exceed 2048 Unicode characters in length.
  # @!attribute [rw] aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resrouces). Multiple aggregations
  #     are applied in the order specified.
  #
  #     This field is similar to the one in the [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
  #     It is advisable to use the `ListTimeSeries` method when debugging this
  #     field.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must fail to report new
  #     data to be considered failing. The minimum value of this field
  #     is 120 seconds. Larger values that are a multiple of a
  #     minute--for example, 240 or 300 seconds--are supported.
  #     If an invalid value is given, an
  #     error will be returned. The `Duration.nanos` field is
  #     ignored.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`.
  class MetricAbsence
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that checks whether a log message in the [scoping
  # project](https://cloud.google.com/monitoring/api/v3#project_name)
  # satisfies the given filter. Logs from other projects in the metrics
  # scope are not evaluated.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A logs-based filter. See [Advanced Logs
  #     Queries](/logging/docs/view/advanced-queries) for how this filter
  #     should be constructed.
  # @!attribute [rw] label_extractors
  #   @return [::Google::Protobuf::Map{::String => ::String}]
  #     Optional. A map from a label key to an extractor expression, which is
  #     used to extract the value for this label key. Each entry in this map is
  #     a specification for how data should be extracted from log entries that
  #     match `filter`. Each combination of extracted values is treated as a
  #     separate rule for the purposes of triggering notifications. Label keys
  #     and corresponding values can be used in notifications generated by this
  #     condition.
  #
  #     Please see [the documentation on logs-based metric
  #     `valueExtractor`s](/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
  #     for syntax and examples.
  class LogMatch
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::String]
    class LabelExtractorsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A condition type that allows alert policies to be defined using
  # [Monitoring Query Language](https://cloud.google.com/monitoring/mql).
  # @!attribute [rw] query
  #   @return [::String]
  #     [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
  #     query that outputs a boolean stream.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must violate the
  #     threshold to be considered failing. Currently, only values
  #     that are a multiple of a minute--e.g., 0, 60, 120, or 300
  #     seconds--are supported. If an invalid value is given, an
  #     error will be returned. When choosing a duration, it is useful to
  #     keep in mind the frequency of the underlying time series data
  #     (which may also be affected by any alignments specified in the
  #     `aggregations` field); a good duration is long enough so that a single
  #     outlier does not generate spurious alerts, but short enough that
  #     unhealthy states are detected and alerted on quickly.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`,
  #     or by the ratio, if `denominator_filter` and `denominator_aggregations`
  #     are specified.
  class MonitoringQueryLanguageCondition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#condition_monitoring_query_language::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::MonitoringQueryLanguageCondition

Returns A condition that uses the Monitoring Query Language to define alerts.

Returns:



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'proto_docs/google/monitoring/v3/alert.rb', line 182

class Condition
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Specifies how many time series must fail a predicate to trigger a
  # condition. If not specified, then a `{count: 1}` trigger is used.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The absolute number of time series that must fail
  #     the predicate for the condition to be triggered.
  # @!attribute [rw] percent
  #   @return [::Float]
  #     The percentage of time series that must fail the
  #     predicate for the condition to be triggered.
  class Trigger
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that compares a collection of time series
  # against a threshold.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies which time series should be compared with the threshold.
  #
  #     The filter is similar to the one that is specified in the
  #     [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
  #     (that call is useful to verify the time series that will be retrieved /
  #     processed). The filter must specify the metric type and the resource
  #     type. Optionally, it can specify resource labels and metric labels.
  #     This field must not exceed 2048 Unicode characters in length.
  # @!attribute [rw] aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resrouces). Multiple aggregations
  #     are applied in the order specified.
  #
  #     This field is similar to the one in the [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
  #     It is advisable to use the `ListTimeSeries` method when debugging this
  #     field.
  # @!attribute [rw] denominator_filter
  #   @return [::String]
  #     A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies a time series that should be used as the denominator of a
  #     ratio that will be compared with the threshold. If a
  #     `denominator_filter` is specified, the time series specified by the
  #     `filter` field will be used as the numerator.
  #
  #     The filter must specify the metric type and optionally may contain
  #     restrictions on resource type, resource labels, and metric labels.
  #     This field may not exceed 2048 Unicode characters in length.
  # @!attribute [rw] denominator_aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series
  #     selected by `denominatorFilter` as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resources).
  #
  #     When computing ratios, the `aggregations` and
  #     `denominator_aggregations` fields must use the same alignment period
  #     and produce time series that have the same periodicity and labels.
  # @!attribute [rw] comparison
  #   @return [::Google::Cloud::Monitoring::V3::ComparisonType]
  #     The comparison to apply between the time series (indicated by `filter`
  #     and `aggregation`) and the threshold (indicated by `threshold_value`).
  #     The comparison is applied on each time series, with the time series
  #     on the left-hand side and the threshold on the right-hand side.
  #
  #     Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
  # @!attribute [rw] threshold_value
  #   @return [::Float]
  #     A value against which to compare the time series.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must violate the
  #     threshold to be considered failing. Currently, only values
  #     that are a multiple of a minute--e.g., 0, 60, 120, or 300
  #     seconds--are supported. If an invalid value is given, an
  #     error will be returned. When choosing a duration, it is useful to
  #     keep in mind the frequency of the underlying time series data
  #     (which may also be affected by any alignments specified in the
  #     `aggregations` field); a good duration is long enough so that a single
  #     outlier does not generate spurious alerts, but short enough that
  #     unhealthy states are detected and alerted on quickly.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`,
  #     or by the ratio, if `denominator_filter` and `denominator_aggregations`
  #     are specified.
  class MetricThreshold
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that checks that monitored resources
  # are reporting data. The configuration defines a metric and
  # a set of monitored resources. The predicate is considered in violation
  # when a time series for the specified metric of a monitored
  # resource does not include any data in the specified `duration`.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies which time series should be compared with the threshold.
  #
  #     The filter is similar to the one that is specified in the
  #     [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
  #     (that call is useful to verify the time series that will be retrieved /
  #     processed). The filter must specify the metric type and the resource
  #     type. Optionally, it can specify resource labels and metric labels.
  #     This field must not exceed 2048 Unicode characters in length.
  # @!attribute [rw] aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resrouces). Multiple aggregations
  #     are applied in the order specified.
  #
  #     This field is similar to the one in the [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
  #     It is advisable to use the `ListTimeSeries` method when debugging this
  #     field.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must fail to report new
  #     data to be considered failing. The minimum value of this field
  #     is 120 seconds. Larger values that are a multiple of a
  #     minute--for example, 240 or 300 seconds--are supported.
  #     If an invalid value is given, an
  #     error will be returned. The `Duration.nanos` field is
  #     ignored.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`.
  class MetricAbsence
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that checks whether a log message in the [scoping
  # project](https://cloud.google.com/monitoring/api/v3#project_name)
  # satisfies the given filter. Logs from other projects in the metrics
  # scope are not evaluated.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A logs-based filter. See [Advanced Logs
  #     Queries](/logging/docs/view/advanced-queries) for how this filter
  #     should be constructed.
  # @!attribute [rw] label_extractors
  #   @return [::Google::Protobuf::Map{::String => ::String}]
  #     Optional. A map from a label key to an extractor expression, which is
  #     used to extract the value for this label key. Each entry in this map is
  #     a specification for how data should be extracted from log entries that
  #     match `filter`. Each combination of extracted values is treated as a
  #     separate rule for the purposes of triggering notifications. Label keys
  #     and corresponding values can be used in notifications generated by this
  #     condition.
  #
  #     Please see [the documentation on logs-based metric
  #     `valueExtractor`s](/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
  #     for syntax and examples.
  class LogMatch
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::String]
    class LabelExtractorsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A condition type that allows alert policies to be defined using
  # [Monitoring Query Language](https://cloud.google.com/monitoring/mql).
  # @!attribute [rw] query
  #   @return [::String]
  #     [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
  #     query that outputs a boolean stream.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must violate the
  #     threshold to be considered failing. Currently, only values
  #     that are a multiple of a minute--e.g., 0, 60, 120, or 300
  #     seconds--are supported. If an invalid value is given, an
  #     error will be returned. When choosing a duration, it is useful to
  #     keep in mind the frequency of the underlying time series data
  #     (which may also be affected by any alignments specified in the
  #     `aggregations` field); a good duration is long enough so that a single
  #     outlier does not generate spurious alerts, but short enough that
  #     unhealthy states are detected and alerted on quickly.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`,
  #     or by the ratio, if `denominator_filter` and `denominator_aggregations`
  #     are specified.
  class MonitoringQueryLanguageCondition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#condition_threshold::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::MetricThreshold

Returns A condition that compares a time series against a threshold.

Returns:



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'proto_docs/google/monitoring/v3/alert.rb', line 182

class Condition
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Specifies how many time series must fail a predicate to trigger a
  # condition. If not specified, then a `{count: 1}` trigger is used.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The absolute number of time series that must fail
  #     the predicate for the condition to be triggered.
  # @!attribute [rw] percent
  #   @return [::Float]
  #     The percentage of time series that must fail the
  #     predicate for the condition to be triggered.
  class Trigger
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that compares a collection of time series
  # against a threshold.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies which time series should be compared with the threshold.
  #
  #     The filter is similar to the one that is specified in the
  #     [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
  #     (that call is useful to verify the time series that will be retrieved /
  #     processed). The filter must specify the metric type and the resource
  #     type. Optionally, it can specify resource labels and metric labels.
  #     This field must not exceed 2048 Unicode characters in length.
  # @!attribute [rw] aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resrouces). Multiple aggregations
  #     are applied in the order specified.
  #
  #     This field is similar to the one in the [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
  #     It is advisable to use the `ListTimeSeries` method when debugging this
  #     field.
  # @!attribute [rw] denominator_filter
  #   @return [::String]
  #     A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies a time series that should be used as the denominator of a
  #     ratio that will be compared with the threshold. If a
  #     `denominator_filter` is specified, the time series specified by the
  #     `filter` field will be used as the numerator.
  #
  #     The filter must specify the metric type and optionally may contain
  #     restrictions on resource type, resource labels, and metric labels.
  #     This field may not exceed 2048 Unicode characters in length.
  # @!attribute [rw] denominator_aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series
  #     selected by `denominatorFilter` as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resources).
  #
  #     When computing ratios, the `aggregations` and
  #     `denominator_aggregations` fields must use the same alignment period
  #     and produce time series that have the same periodicity and labels.
  # @!attribute [rw] comparison
  #   @return [::Google::Cloud::Monitoring::V3::ComparisonType]
  #     The comparison to apply between the time series (indicated by `filter`
  #     and `aggregation`) and the threshold (indicated by `threshold_value`).
  #     The comparison is applied on each time series, with the time series
  #     on the left-hand side and the threshold on the right-hand side.
  #
  #     Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
  # @!attribute [rw] threshold_value
  #   @return [::Float]
  #     A value against which to compare the time series.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must violate the
  #     threshold to be considered failing. Currently, only values
  #     that are a multiple of a minute--e.g., 0, 60, 120, or 300
  #     seconds--are supported. If an invalid value is given, an
  #     error will be returned. When choosing a duration, it is useful to
  #     keep in mind the frequency of the underlying time series data
  #     (which may also be affected by any alignments specified in the
  #     `aggregations` field); a good duration is long enough so that a single
  #     outlier does not generate spurious alerts, but short enough that
  #     unhealthy states are detected and alerted on quickly.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`,
  #     or by the ratio, if `denominator_filter` and `denominator_aggregations`
  #     are specified.
  class MetricThreshold
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that checks that monitored resources
  # are reporting data. The configuration defines a metric and
  # a set of monitored resources. The predicate is considered in violation
  # when a time series for the specified metric of a monitored
  # resource does not include any data in the specified `duration`.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies which time series should be compared with the threshold.
  #
  #     The filter is similar to the one that is specified in the
  #     [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
  #     (that call is useful to verify the time series that will be retrieved /
  #     processed). The filter must specify the metric type and the resource
  #     type. Optionally, it can specify resource labels and metric labels.
  #     This field must not exceed 2048 Unicode characters in length.
  # @!attribute [rw] aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resrouces). Multiple aggregations
  #     are applied in the order specified.
  #
  #     This field is similar to the one in the [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
  #     It is advisable to use the `ListTimeSeries` method when debugging this
  #     field.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must fail to report new
  #     data to be considered failing. The minimum value of this field
  #     is 120 seconds. Larger values that are a multiple of a
  #     minute--for example, 240 or 300 seconds--are supported.
  #     If an invalid value is given, an
  #     error will be returned. The `Duration.nanos` field is
  #     ignored.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`.
  class MetricAbsence
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that checks whether a log message in the [scoping
  # project](https://cloud.google.com/monitoring/api/v3#project_name)
  # satisfies the given filter. Logs from other projects in the metrics
  # scope are not evaluated.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A logs-based filter. See [Advanced Logs
  #     Queries](/logging/docs/view/advanced-queries) for how this filter
  #     should be constructed.
  # @!attribute [rw] label_extractors
  #   @return [::Google::Protobuf::Map{::String => ::String}]
  #     Optional. A map from a label key to an extractor expression, which is
  #     used to extract the value for this label key. Each entry in this map is
  #     a specification for how data should be extracted from log entries that
  #     match `filter`. Each combination of extracted values is treated as a
  #     separate rule for the purposes of triggering notifications. Label keys
  #     and corresponding values can be used in notifications generated by this
  #     condition.
  #
  #     Please see [the documentation on logs-based metric
  #     `valueExtractor`s](/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
  #     for syntax and examples.
  class LogMatch
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::String]
    class LabelExtractorsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A condition type that allows alert policies to be defined using
  # [Monitoring Query Language](https://cloud.google.com/monitoring/mql).
  # @!attribute [rw] query
  #   @return [::String]
  #     [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
  #     query that outputs a boolean stream.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must violate the
  #     threshold to be considered failing. Currently, only values
  #     that are a multiple of a minute--e.g., 0, 60, 120, or 300
  #     seconds--are supported. If an invalid value is given, an
  #     error will be returned. When choosing a duration, it is useful to
  #     keep in mind the frequency of the underlying time series data
  #     (which may also be affected by any alignments specified in the
  #     `aggregations` field); a good duration is long enough so that a single
  #     outlier does not generate spurious alerts, but short enough that
  #     unhealthy states are detected and alerted on quickly.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`,
  #     or by the ratio, if `denominator_filter` and `denominator_aggregations`
  #     are specified.
  class MonitoringQueryLanguageCondition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#display_name::String

Returns A short name or phrase used to identify the condition in dashboards, notifications, and incidents. To avoid confusion, don't use the same display name for multiple conditions in the same policy.

Returns:

  • (::String)

    A short name or phrase used to identify the condition in dashboards, notifications, and incidents. To avoid confusion, don't use the same display name for multiple conditions in the same policy.



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'proto_docs/google/monitoring/v3/alert.rb', line 182

class Condition
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Specifies how many time series must fail a predicate to trigger a
  # condition. If not specified, then a `{count: 1}` trigger is used.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The absolute number of time series that must fail
  #     the predicate for the condition to be triggered.
  # @!attribute [rw] percent
  #   @return [::Float]
  #     The percentage of time series that must fail the
  #     predicate for the condition to be triggered.
  class Trigger
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that compares a collection of time series
  # against a threshold.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies which time series should be compared with the threshold.
  #
  #     The filter is similar to the one that is specified in the
  #     [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
  #     (that call is useful to verify the time series that will be retrieved /
  #     processed). The filter must specify the metric type and the resource
  #     type. Optionally, it can specify resource labels and metric labels.
  #     This field must not exceed 2048 Unicode characters in length.
  # @!attribute [rw] aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resrouces). Multiple aggregations
  #     are applied in the order specified.
  #
  #     This field is similar to the one in the [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
  #     It is advisable to use the `ListTimeSeries` method when debugging this
  #     field.
  # @!attribute [rw] denominator_filter
  #   @return [::String]
  #     A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies a time series that should be used as the denominator of a
  #     ratio that will be compared with the threshold. If a
  #     `denominator_filter` is specified, the time series specified by the
  #     `filter` field will be used as the numerator.
  #
  #     The filter must specify the metric type and optionally may contain
  #     restrictions on resource type, resource labels, and metric labels.
  #     This field may not exceed 2048 Unicode characters in length.
  # @!attribute [rw] denominator_aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series
  #     selected by `denominatorFilter` as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resources).
  #
  #     When computing ratios, the `aggregations` and
  #     `denominator_aggregations` fields must use the same alignment period
  #     and produce time series that have the same periodicity and labels.
  # @!attribute [rw] comparison
  #   @return [::Google::Cloud::Monitoring::V3::ComparisonType]
  #     The comparison to apply between the time series (indicated by `filter`
  #     and `aggregation`) and the threshold (indicated by `threshold_value`).
  #     The comparison is applied on each time series, with the time series
  #     on the left-hand side and the threshold on the right-hand side.
  #
  #     Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
  # @!attribute [rw] threshold_value
  #   @return [::Float]
  #     A value against which to compare the time series.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must violate the
  #     threshold to be considered failing. Currently, only values
  #     that are a multiple of a minute--e.g., 0, 60, 120, or 300
  #     seconds--are supported. If an invalid value is given, an
  #     error will be returned. When choosing a duration, it is useful to
  #     keep in mind the frequency of the underlying time series data
  #     (which may also be affected by any alignments specified in the
  #     `aggregations` field); a good duration is long enough so that a single
  #     outlier does not generate spurious alerts, but short enough that
  #     unhealthy states are detected and alerted on quickly.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`,
  #     or by the ratio, if `denominator_filter` and `denominator_aggregations`
  #     are specified.
  class MetricThreshold
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that checks that monitored resources
  # are reporting data. The configuration defines a metric and
  # a set of monitored resources. The predicate is considered in violation
  # when a time series for the specified metric of a monitored
  # resource does not include any data in the specified `duration`.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies which time series should be compared with the threshold.
  #
  #     The filter is similar to the one that is specified in the
  #     [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
  #     (that call is useful to verify the time series that will be retrieved /
  #     processed). The filter must specify the metric type and the resource
  #     type. Optionally, it can specify resource labels and metric labels.
  #     This field must not exceed 2048 Unicode characters in length.
  # @!attribute [rw] aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resrouces). Multiple aggregations
  #     are applied in the order specified.
  #
  #     This field is similar to the one in the [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
  #     It is advisable to use the `ListTimeSeries` method when debugging this
  #     field.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must fail to report new
  #     data to be considered failing. The minimum value of this field
  #     is 120 seconds. Larger values that are a multiple of a
  #     minute--for example, 240 or 300 seconds--are supported.
  #     If an invalid value is given, an
  #     error will be returned. The `Duration.nanos` field is
  #     ignored.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`.
  class MetricAbsence
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that checks whether a log message in the [scoping
  # project](https://cloud.google.com/monitoring/api/v3#project_name)
  # satisfies the given filter. Logs from other projects in the metrics
  # scope are not evaluated.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A logs-based filter. See [Advanced Logs
  #     Queries](/logging/docs/view/advanced-queries) for how this filter
  #     should be constructed.
  # @!attribute [rw] label_extractors
  #   @return [::Google::Protobuf::Map{::String => ::String}]
  #     Optional. A map from a label key to an extractor expression, which is
  #     used to extract the value for this label key. Each entry in this map is
  #     a specification for how data should be extracted from log entries that
  #     match `filter`. Each combination of extracted values is treated as a
  #     separate rule for the purposes of triggering notifications. Label keys
  #     and corresponding values can be used in notifications generated by this
  #     condition.
  #
  #     Please see [the documentation on logs-based metric
  #     `valueExtractor`s](/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
  #     for syntax and examples.
  class LogMatch
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::String]
    class LabelExtractorsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A condition type that allows alert policies to be defined using
  # [Monitoring Query Language](https://cloud.google.com/monitoring/mql).
  # @!attribute [rw] query
  #   @return [::String]
  #     [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
  #     query that outputs a boolean stream.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must violate the
  #     threshold to be considered failing. Currently, only values
  #     that are a multiple of a minute--e.g., 0, 60, 120, or 300
  #     seconds--are supported. If an invalid value is given, an
  #     error will be returned. When choosing a duration, it is useful to
  #     keep in mind the frequency of the underlying time series data
  #     (which may also be affected by any alignments specified in the
  #     `aggregations` field); a good duration is long enough so that a single
  #     outlier does not generate spurious alerts, but short enough that
  #     unhealthy states are detected and alerted on quickly.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`,
  #     or by the ratio, if `denominator_filter` and `denominator_aggregations`
  #     are specified.
  class MonitoringQueryLanguageCondition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#name::String

Returns Required if the condition exists. The unique resource name for this condition. Its format is:

projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]

[CONDITION_ID] is assigned by Stackdriver Monitoring when the condition is created as part of a new or updated alerting policy.

When calling the alertPolicies.create method, do not include the name field in the conditions of the requested alerting policy. Stackdriver Monitoring creates the condition identifiers and includes them in the new policy.

When calling the alertPolicies.update method to update a policy, including a condition name causes the existing condition to be updated. Conditions without names are added to the updated policy. Existing conditions are deleted if they are not updated.

Best practice is to preserve [CONDITION_ID] if you make only small changes, such as those to condition thresholds, durations, or trigger values. Otherwise, treat the change as a new condition and let the existing condition be deleted.

Returns:

  • (::String)

    Required if the condition exists. The unique resource name for this condition. Its format is:

    projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID]
    

    [CONDITION_ID] is assigned by Stackdriver Monitoring when the condition is created as part of a new or updated alerting policy.

    When calling the alertPolicies.create method, do not include the name field in the conditions of the requested alerting policy. Stackdriver Monitoring creates the condition identifiers and includes them in the new policy.

    When calling the alertPolicies.update method to update a policy, including a condition name causes the existing condition to be updated. Conditions without names are added to the updated policy. Existing conditions are deleted if they are not updated.

    Best practice is to preserve [CONDITION_ID] if you make only small changes, such as those to condition thresholds, durations, or trigger values. Otherwise, treat the change as a new condition and let the existing condition be deleted.



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'proto_docs/google/monitoring/v3/alert.rb', line 182

class Condition
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Specifies how many time series must fail a predicate to trigger a
  # condition. If not specified, then a `{count: 1}` trigger is used.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The absolute number of time series that must fail
  #     the predicate for the condition to be triggered.
  # @!attribute [rw] percent
  #   @return [::Float]
  #     The percentage of time series that must fail the
  #     predicate for the condition to be triggered.
  class Trigger
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that compares a collection of time series
  # against a threshold.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies which time series should be compared with the threshold.
  #
  #     The filter is similar to the one that is specified in the
  #     [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
  #     (that call is useful to verify the time series that will be retrieved /
  #     processed). The filter must specify the metric type and the resource
  #     type. Optionally, it can specify resource labels and metric labels.
  #     This field must not exceed 2048 Unicode characters in length.
  # @!attribute [rw] aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resrouces). Multiple aggregations
  #     are applied in the order specified.
  #
  #     This field is similar to the one in the [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
  #     It is advisable to use the `ListTimeSeries` method when debugging this
  #     field.
  # @!attribute [rw] denominator_filter
  #   @return [::String]
  #     A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies a time series that should be used as the denominator of a
  #     ratio that will be compared with the threshold. If a
  #     `denominator_filter` is specified, the time series specified by the
  #     `filter` field will be used as the numerator.
  #
  #     The filter must specify the metric type and optionally may contain
  #     restrictions on resource type, resource labels, and metric labels.
  #     This field may not exceed 2048 Unicode characters in length.
  # @!attribute [rw] denominator_aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series
  #     selected by `denominatorFilter` as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resources).
  #
  #     When computing ratios, the `aggregations` and
  #     `denominator_aggregations` fields must use the same alignment period
  #     and produce time series that have the same periodicity and labels.
  # @!attribute [rw] comparison
  #   @return [::Google::Cloud::Monitoring::V3::ComparisonType]
  #     The comparison to apply between the time series (indicated by `filter`
  #     and `aggregation`) and the threshold (indicated by `threshold_value`).
  #     The comparison is applied on each time series, with the time series
  #     on the left-hand side and the threshold on the right-hand side.
  #
  #     Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently.
  # @!attribute [rw] threshold_value
  #   @return [::Float]
  #     A value against which to compare the time series.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must violate the
  #     threshold to be considered failing. Currently, only values
  #     that are a multiple of a minute--e.g., 0, 60, 120, or 300
  #     seconds--are supported. If an invalid value is given, an
  #     error will be returned. When choosing a duration, it is useful to
  #     keep in mind the frequency of the underlying time series data
  #     (which may also be affected by any alignments specified in the
  #     `aggregations` field); a good duration is long enough so that a single
  #     outlier does not generate spurious alerts, but short enough that
  #     unhealthy states are detected and alerted on quickly.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`,
  #     or by the ratio, if `denominator_filter` and `denominator_aggregations`
  #     are specified.
  class MetricThreshold
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that checks that monitored resources
  # are reporting data. The configuration defines a metric and
  # a set of monitored resources. The predicate is considered in violation
  # when a time series for the specified metric of a monitored
  # resource does not include any data in the specified `duration`.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A [filter](https://cloud.google.com/monitoring/api/v3/filters) that
  #     identifies which time series should be compared with the threshold.
  #
  #     The filter is similar to the one that is specified in the
  #     [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list)
  #     (that call is useful to verify the time series that will be retrieved /
  #     processed). The filter must specify the metric type and the resource
  #     type. Optionally, it can specify resource labels and metric labels.
  #     This field must not exceed 2048 Unicode characters in length.
  # @!attribute [rw] aggregations
  #   @return [::Array<::Google::Cloud::Monitoring::V3::Aggregation>]
  #     Specifies the alignment of data points in individual time series as
  #     well as how to combine the retrieved time series together (such as
  #     when aggregating multiple streams on each resource to a single
  #     stream for each resource or when aggregating streams across all
  #     members of a group of resrouces). Multiple aggregations
  #     are applied in the order specified.
  #
  #     This field is similar to the one in the [`ListTimeSeries`
  #     request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
  #     It is advisable to use the `ListTimeSeries` method when debugging this
  #     field.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must fail to report new
  #     data to be considered failing. The minimum value of this field
  #     is 120 seconds. Larger values that are a multiple of a
  #     minute--for example, 240 or 300 seconds--are supported.
  #     If an invalid value is given, an
  #     error will be returned. The `Duration.nanos` field is
  #     ignored.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`.
  class MetricAbsence
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A condition type that checks whether a log message in the [scoping
  # project](https://cloud.google.com/monitoring/api/v3#project_name)
  # satisfies the given filter. Logs from other projects in the metrics
  # scope are not evaluated.
  # @!attribute [rw] filter
  #   @return [::String]
  #     Required. A logs-based filter. See [Advanced Logs
  #     Queries](/logging/docs/view/advanced-queries) for how this filter
  #     should be constructed.
  # @!attribute [rw] label_extractors
  #   @return [::Google::Protobuf::Map{::String => ::String}]
  #     Optional. A map from a label key to an extractor expression, which is
  #     used to extract the value for this label key. Each entry in this map is
  #     a specification for how data should be extracted from log entries that
  #     match `filter`. Each combination of extracted values is treated as a
  #     separate rule for the purposes of triggering notifications. Label keys
  #     and corresponding values can be used in notifications generated by this
  #     condition.
  #
  #     Please see [the documentation on logs-based metric
  #     `valueExtractor`s](/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor)
  #     for syntax and examples.
  class LogMatch
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # @!attribute [rw] key
    #   @return [::String]
    # @!attribute [rw] value
    #   @return [::String]
    class LabelExtractorsEntry
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # A condition type that allows alert policies to be defined using
  # [Monitoring Query Language](https://cloud.google.com/monitoring/mql).
  # @!attribute [rw] query
  #   @return [::String]
  #     [Monitoring Query Language](https://cloud.google.com/monitoring/mql)
  #     query that outputs a boolean stream.
  # @!attribute [rw] duration
  #   @return [::Google::Protobuf::Duration]
  #     The amount of time that a time series must violate the
  #     threshold to be considered failing. Currently, only values
  #     that are a multiple of a minute--e.g., 0, 60, 120, or 300
  #     seconds--are supported. If an invalid value is given, an
  #     error will be returned. When choosing a duration, it is useful to
  #     keep in mind the frequency of the underlying time series data
  #     (which may also be affected by any alignments specified in the
  #     `aggregations` field); a good duration is long enough so that a single
  #     outlier does not generate spurious alerts, but short enough that
  #     unhealthy states are detected and alerted on quickly.
  # @!attribute [rw] trigger
  #   @return [::Google::Cloud::Monitoring::V3::AlertPolicy::Condition::Trigger]
  #     The number/percent of time series for which the comparison must hold
  #     in order for the condition to trigger. If unspecified, then the
  #     condition will trigger if the comparison is true for any of the
  #     time series that have been identified by `filter` and `aggregations`,
  #     or by the ratio, if `denominator_filter` and `denominator_aggregations`
  #     are specified.
  class MonitoringQueryLanguageCondition
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end