1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.monitoring.v3; 18 19import "google/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21import "google/monitoring/v3/common.proto"; 22import "google/monitoring/v3/mutation_record.proto"; 23import "google/protobuf/duration.proto"; 24import "google/protobuf/wrappers.proto"; 25import "google/rpc/status.proto"; 26 27option csharp_namespace = "Google.Cloud.Monitoring.V3"; 28option go_package = "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb"; 29option java_multiple_files = true; 30option java_outer_classname = "AlertProto"; 31option java_package = "com.google.monitoring.v3"; 32option php_namespace = "Google\\Cloud\\Monitoring\\V3"; 33option ruby_package = "Google::Cloud::Monitoring::V3"; 34 35// A description of the conditions under which some aspect of your system is 36// considered to be "unhealthy" and the ways to notify people or services about 37// this state. For an overview of alert policies, see 38// [Introduction to Alerting](https://cloud.google.com/monitoring/alerts/). 39// 40message AlertPolicy { 41 option (google.api.resource) = { 42 type: "monitoring.googleapis.com/AlertPolicy" 43 pattern: "projects/{project}/alertPolicies/{alert_policy}" 44 pattern: "organizations/{organization}/alertPolicies/{alert_policy}" 45 pattern: "folders/{folder}/alertPolicies/{alert_policy}" 46 pattern: "*" 47 }; 48 49 // Documentation that is included in the notifications and incidents 50 // pertaining to this policy. 51 message Documentation { 52 // The body of the documentation, interpreted according to `mime_type`. 53 // The content may not exceed 8,192 Unicode characters and may not exceed 54 // more than 10,240 bytes when encoded in UTF-8 format, whichever is 55 // smaller. This text can be [templatized by using 56 // variables](https://cloud.google.com/monitoring/alerts/doc-variables). 57 string content = 1; 58 59 // The format of the `content` field. Presently, only the value 60 // `"text/markdown"` is supported. See 61 // [Markdown](https://en.wikipedia.org/wiki/Markdown) for more information. 62 string mime_type = 2; 63 64 // Optional. The subject line of the notification. The subject line may not 65 // exceed 10,240 bytes. In notifications generated by this policy, the 66 // contents of the subject line after variable expansion will be truncated 67 // to 255 bytes or shorter at the latest UTF-8 character boundary. The 68 // 255-byte limit is recommended by [this 69 // thread](https://stackoverflow.com/questions/1592291/what-is-the-email-subject-length-limit). 70 // It is both the limit imposed by some third-party ticketing products and 71 // it is common to define textual fields in databases as VARCHAR(255). 72 // 73 // The contents of the subject line can be [templatized by using 74 // variables](https://cloud.google.com/monitoring/alerts/doc-variables). 75 // If this field is missing or empty, a default subject line will be 76 // generated. 77 string subject = 3 [(google.api.field_behavior) = OPTIONAL]; 78 } 79 80 // A condition is a true/false test that determines when an alerting policy 81 // should open an incident. If a condition evaluates to true, it signifies 82 // that something is wrong. 83 message Condition { 84 option (google.api.resource) = { 85 type: "monitoring.googleapis.com/AlertPolicyCondition" 86 pattern: "projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}" 87 pattern: "organizations/{organization}/alertPolicies/{alert_policy}/conditions/{condition}" 88 pattern: "folders/{folder}/alertPolicies/{alert_policy}/conditions/{condition}" 89 pattern: "*" 90 }; 91 92 // Specifies how many time series must fail a predicate to trigger a 93 // condition. If not specified, then a `{count: 1}` trigger is used. 94 message Trigger { 95 // A type of trigger. 96 oneof type { 97 // The absolute number of time series that must fail 98 // the predicate for the condition to be triggered. 99 int32 count = 1; 100 101 // The percentage of time series that must fail the 102 // predicate for the condition to be triggered. 103 double percent = 2; 104 } 105 } 106 107 // A condition control that determines how metric-threshold conditions 108 // are evaluated when data stops arriving. 109 // This control doesn't affect metric-absence policies. 110 enum EvaluationMissingData { 111 // An unspecified evaluation missing data option. Equivalent to 112 // EVALUATION_MISSING_DATA_NO_OP. 113 EVALUATION_MISSING_DATA_UNSPECIFIED = 0; 114 115 // If there is no data to evaluate the condition, then evaluate the 116 // condition as false. 117 EVALUATION_MISSING_DATA_INACTIVE = 1; 118 119 // If there is no data to evaluate the condition, then evaluate the 120 // condition as true. 121 EVALUATION_MISSING_DATA_ACTIVE = 2; 122 123 // Do not evaluate the condition to any value if there is no data. 124 EVALUATION_MISSING_DATA_NO_OP = 3; 125 } 126 127 // A condition type that compares a collection of time series 128 // against a threshold. 129 message MetricThreshold { 130 // Options used when forecasting the time series and testing 131 // the predicted value against the threshold. 132 message ForecastOptions { 133 // Required. The length of time into the future to forecast whether a 134 // time series will violate the threshold. If the predicted value is 135 // found to violate the threshold, and the violation is observed in all 136 // forecasts made for the configured `duration`, then the time series is 137 // considered to be failing. 138 // The forecast horizon can range from 1 hour to 60 hours. 139 google.protobuf.Duration forecast_horizon = 1 140 [(google.api.field_behavior) = REQUIRED]; 141 } 142 143 // Required. A 144 // [filter](https://cloud.google.com/monitoring/api/v3/filters) that 145 // identifies which time series should be compared with the threshold. 146 // 147 // The filter is similar to the one that is specified in the 148 // [`ListTimeSeries` 149 // request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) 150 // (that call is useful to verify the time series that will be retrieved / 151 // processed). The filter must specify the metric type and the resource 152 // type. Optionally, it can specify resource labels and metric labels. 153 // This field must not exceed 2048 Unicode characters in length. 154 string filter = 2 [(google.api.field_behavior) = REQUIRED]; 155 156 // Specifies the alignment of data points in individual time series as 157 // well as how to combine the retrieved time series together (such as 158 // when aggregating multiple streams on each resource to a single 159 // stream for each resource or when aggregating streams across all 160 // members of a group of resources). Multiple aggregations 161 // are applied in the order specified. 162 // 163 // This field is similar to the one in the [`ListTimeSeries` 164 // request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). 165 // It is advisable to use the `ListTimeSeries` method when debugging this 166 // field. 167 repeated Aggregation aggregations = 8; 168 169 // A [filter](https://cloud.google.com/monitoring/api/v3/filters) that 170 // identifies a time series that should be used as the denominator of a 171 // ratio that will be compared with the threshold. If a 172 // `denominator_filter` is specified, the time series specified by the 173 // `filter` field will be used as the numerator. 174 // 175 // The filter must specify the metric type and optionally may contain 176 // restrictions on resource type, resource labels, and metric labels. 177 // This field may not exceed 2048 Unicode characters in length. 178 string denominator_filter = 9; 179 180 // Specifies the alignment of data points in individual time series 181 // selected by `denominatorFilter` as 182 // well as how to combine the retrieved time series together (such as 183 // when aggregating multiple streams on each resource to a single 184 // stream for each resource or when aggregating streams across all 185 // members of a group of resources). 186 // 187 // When computing ratios, the `aggregations` and 188 // `denominator_aggregations` fields must use the same alignment period 189 // and produce time series that have the same periodicity and labels. 190 repeated Aggregation denominator_aggregations = 10; 191 192 // When this field is present, the `MetricThreshold` condition forecasts 193 // whether the time series is predicted to violate the threshold within 194 // the `forecast_horizon`. When this field is not set, the 195 // `MetricThreshold` tests the current value of the timeseries against the 196 // threshold. 197 ForecastOptions forecast_options = 12; 198 199 // The comparison to apply between the time series (indicated by `filter` 200 // and `aggregation`) and the threshold (indicated by `threshold_value`). 201 // The comparison is applied on each time series, with the time series 202 // on the left-hand side and the threshold on the right-hand side. 203 // 204 // Only `COMPARISON_LT` and `COMPARISON_GT` are supported currently. 205 ComparisonType comparison = 4; 206 207 // A value against which to compare the time series. 208 double threshold_value = 5; 209 210 // The amount of time that a time series must violate the 211 // threshold to be considered failing. Currently, only values 212 // that are a multiple of a minute--e.g., 0, 60, 120, or 300 213 // seconds--are supported. If an invalid value is given, an 214 // error will be returned. When choosing a duration, it is useful to 215 // keep in mind the frequency of the underlying time series data 216 // (which may also be affected by any alignments specified in the 217 // `aggregations` field); a good duration is long enough so that a single 218 // outlier does not generate spurious alerts, but short enough that 219 // unhealthy states are detected and alerted on quickly. 220 google.protobuf.Duration duration = 6; 221 222 // The number/percent of time series for which the comparison must hold 223 // in order for the condition to trigger. If unspecified, then the 224 // condition will trigger if the comparison is true for any of the 225 // time series that have been identified by `filter` and `aggregations`, 226 // or by the ratio, if `denominator_filter` and `denominator_aggregations` 227 // are specified. 228 Trigger trigger = 7; 229 230 // A condition control that determines how metric-threshold conditions 231 // are evaluated when data stops arriving. To use this control, the value 232 // of the `duration` field must be greater than or equal to 60 seconds. 233 EvaluationMissingData evaluation_missing_data = 11; 234 } 235 236 // A condition type that checks that monitored resources 237 // are reporting data. The configuration defines a metric and 238 // a set of monitored resources. The predicate is considered in violation 239 // when a time series for the specified metric of a monitored 240 // resource does not include any data in the specified `duration`. 241 message MetricAbsence { 242 // Required. A 243 // [filter](https://cloud.google.com/monitoring/api/v3/filters) that 244 // identifies which time series should be compared with the threshold. 245 // 246 // The filter is similar to the one that is specified in the 247 // [`ListTimeSeries` 248 // request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list) 249 // (that call is useful to verify the time series that will be retrieved / 250 // processed). The filter must specify the metric type and the resource 251 // type. Optionally, it can specify resource labels and metric labels. 252 // This field must not exceed 2048 Unicode characters in length. 253 string filter = 1 [(google.api.field_behavior) = REQUIRED]; 254 255 // Specifies the alignment of data points in individual time series as 256 // well as how to combine the retrieved time series together (such as 257 // when aggregating multiple streams on each resource to a single 258 // stream for each resource or when aggregating streams across all 259 // members of a group of resources). Multiple aggregations 260 // are applied in the order specified. 261 // 262 // This field is similar to the one in the [`ListTimeSeries` 263 // request](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list). 264 // It is advisable to use the `ListTimeSeries` method when debugging this 265 // field. 266 repeated Aggregation aggregations = 5; 267 268 // The amount of time that a time series must fail to report new 269 // data to be considered failing. The minimum value of this field 270 // is 120 seconds. Larger values that are a multiple of a 271 // minute--for example, 240 or 300 seconds--are supported. 272 // If an invalid value is given, an 273 // error will be returned. The `Duration.nanos` field is 274 // ignored. 275 google.protobuf.Duration duration = 2; 276 277 // The number/percent of time series for which the comparison must hold 278 // in order for the condition to trigger. If unspecified, then the 279 // condition will trigger if the comparison is true for any of the 280 // time series that have been identified by `filter` and `aggregations`. 281 Trigger trigger = 3; 282 } 283 284 // A condition type that checks whether a log message in the [scoping 285 // project](https://cloud.google.com/monitoring/api/v3#project_name) 286 // satisfies the given filter. Logs from other projects in the metrics 287 // scope are not evaluated. 288 message LogMatch { 289 // Required. A logs-based filter. See [Advanced Logs 290 // Queries](https://cloud.google.com/logging/docs/view/advanced-queries) 291 // for how this filter should be constructed. 292 string filter = 1 [(google.api.field_behavior) = REQUIRED]; 293 294 // Optional. A map from a label key to an extractor expression, which is 295 // used to extract the value for this label key. Each entry in this map is 296 // a specification for how data should be extracted from log entries that 297 // match `filter`. Each combination of extracted values is treated as a 298 // separate rule for the purposes of triggering notifications. Label keys 299 // and corresponding values can be used in notifications generated by this 300 // condition. 301 // 302 // Please see [the documentation on logs-based metric 303 // `valueExtractor`s](https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.metrics#LogMetric.FIELDS.value_extractor) 304 // for syntax and examples. 305 map<string, string> label_extractors = 2; 306 } 307 308 // A condition type that allows alert policies to be defined using 309 // [Monitoring Query Language](https://cloud.google.com/monitoring/mql). 310 message MonitoringQueryLanguageCondition { 311 // [Monitoring Query Language](https://cloud.google.com/monitoring/mql) 312 // query that outputs a boolean stream. 313 string query = 1; 314 315 // The amount of time that a time series must violate the 316 // threshold to be considered failing. Currently, only values 317 // that are a multiple of a minute--e.g., 0, 60, 120, or 300 318 // seconds--are supported. If an invalid value is given, an 319 // error will be returned. When choosing a duration, it is useful to 320 // keep in mind the frequency of the underlying time series data 321 // (which may also be affected by any alignments specified in the 322 // `aggregations` field); a good duration is long enough so that a single 323 // outlier does not generate spurious alerts, but short enough that 324 // unhealthy states are detected and alerted on quickly. 325 google.protobuf.Duration duration = 2; 326 327 // The number/percent of time series for which the comparison must hold 328 // in order for the condition to trigger. If unspecified, then the 329 // condition will trigger if the comparison is true for any of the 330 // time series that have been identified by `filter` and `aggregations`, 331 // or by the ratio, if `denominator_filter` and `denominator_aggregations` 332 // are specified. 333 Trigger trigger = 3; 334 335 // A condition control that determines how metric-threshold conditions 336 // are evaluated when data stops arriving. 337 EvaluationMissingData evaluation_missing_data = 4; 338 } 339 340 // A condition type that allows alert policies to be defined using 341 // [Prometheus Query Language 342 // (PromQL)](https://prometheus.io/docs/prometheus/latest/querying/basics/). 343 // 344 // The PrometheusQueryLanguageCondition message contains information 345 // from a Prometheus alerting rule and its associated rule group. 346 // 347 // A Prometheus alerting rule is described 348 // [here](https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/). 349 // The semantics of a Prometheus alerting rule is described 350 // [here](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/#rule). 351 // 352 // A Prometheus rule group is described 353 // [here](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/). 354 // The semantics of a Prometheus rule group is described 355 // [here](https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/#rule_group). 356 // 357 // Because Cloud Alerting has no representation of a Prometheus rule 358 // group resource, we must embed the information of the parent rule 359 // group inside each of the conditions that refer to it. We must also 360 // update the contents of all Prometheus alerts in case the information 361 // of their rule group changes. 362 // 363 // The PrometheusQueryLanguageCondition protocol buffer combines the 364 // information of the corresponding rule group and alerting rule. 365 // The structure of the PrometheusQueryLanguageCondition protocol buffer 366 // does NOT mimic the structure of the Prometheus rule group and alerting 367 // rule YAML declarations. The PrometheusQueryLanguageCondition protocol 368 // buffer may change in the future to support future rule group and/or 369 // alerting rule features. There are no new such features at the present 370 // time (2023-06-26). 371 message PrometheusQueryLanguageCondition { 372 // Required. The PromQL expression to evaluate. Every evaluation cycle 373 // this expression is evaluated at the current time, and all resultant 374 // time series become pending/firing alerts. This field must not be empty. 375 string query = 1 [(google.api.field_behavior) = REQUIRED]; 376 377 // Optional. Alerts are considered firing once their PromQL expression was 378 // evaluated to be "true" for this long. 379 // Alerts whose PromQL expression was not evaluated to be "true" for 380 // long enough are considered pending. 381 // Must be a non-negative duration or missing. 382 // This field is optional. Its default value is zero. 383 google.protobuf.Duration duration = 2 384 [(google.api.field_behavior) = OPTIONAL]; 385 386 // Optional. How often this rule should be evaluated. 387 // Must be a positive multiple of 30 seconds or missing. 388 // This field is optional. Its default value is 30 seconds. 389 // If this PrometheusQueryLanguageCondition was generated from a 390 // Prometheus alerting rule, then this value should be taken from the 391 // enclosing rule group. 392 google.protobuf.Duration evaluation_interval = 3 393 [(google.api.field_behavior) = OPTIONAL]; 394 395 // Optional. Labels to add to or overwrite in the PromQL query result. 396 // Label names [must be 397 // valid](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). 398 // Label values can be [templatized by using 399 // variables](https://cloud.google.com/monitoring/alerts/doc-variables). 400 // The only available variable names are the names of the labels in the 401 // PromQL result, including "__name__" and "value". "labels" may be empty. 402 map<string, string> labels = 4 [(google.api.field_behavior) = OPTIONAL]; 403 404 // Optional. The rule group name of this alert in the corresponding 405 // Prometheus configuration file. 406 // 407 // Some external tools may require this field to be populated correctly 408 // in order to refer to the original Prometheus configuration file. 409 // The rule group name and the alert name are necessary to update the 410 // relevant AlertPolicies in case the definition of the rule group changes 411 // in the future. 412 // 413 // This field is optional. If this field is not empty, then it must 414 // contain a valid UTF-8 string. 415 // This field may not exceed 2048 Unicode characters in length. 416 string rule_group = 5 [(google.api.field_behavior) = OPTIONAL]; 417 418 // Optional. The alerting rule name of this alert in the corresponding 419 // Prometheus configuration file. 420 // 421 // Some external tools may require this field to be populated correctly 422 // in order to refer to the original Prometheus configuration file. 423 // The rule group name and the alert name are necessary to update the 424 // relevant AlertPolicies in case the definition of the rule group changes 425 // in the future. 426 // 427 // This field is optional. If this field is not empty, then it must be a 428 // [valid Prometheus label 429 // name](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels). 430 // This field may not exceed 2048 Unicode characters in length. 431 string alert_rule = 6 [(google.api.field_behavior) = OPTIONAL]; 432 } 433 434 // Required if the condition exists. The unique resource name for this 435 // condition. Its format is: 436 // 437 // projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[POLICY_ID]/conditions/[CONDITION_ID] 438 // 439 // `[CONDITION_ID]` is assigned by Cloud Monitoring when the 440 // condition is created as part of a new or updated alerting policy. 441 // 442 // When calling the 443 // [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] 444 // method, do not include the `name` field in the conditions of the 445 // requested alerting policy. Cloud Monitoring creates the 446 // condition identifiers and includes them in the new policy. 447 // 448 // When calling the 449 // [alertPolicies.update][google.monitoring.v3.AlertPolicyService.UpdateAlertPolicy] 450 // method to update a policy, including a condition `name` causes the 451 // existing condition to be updated. Conditions without names are added to 452 // the updated policy. Existing conditions are deleted if they are not 453 // updated. 454 // 455 // Best practice is to preserve `[CONDITION_ID]` if you make only small 456 // changes, such as those to condition thresholds, durations, or trigger 457 // values. Otherwise, treat the change as a new condition and let the 458 // existing condition be deleted. 459 string name = 12; 460 461 // A short name or phrase used to identify the condition in dashboards, 462 // notifications, and incidents. To avoid confusion, don't use the same 463 // display name for multiple conditions in the same policy. 464 string display_name = 6; 465 466 // Only one of the following condition types will be specified. 467 oneof condition { 468 // A condition that compares a time series against a threshold. 469 MetricThreshold condition_threshold = 1; 470 471 // A condition that checks that a time series continues to 472 // receive new data points. 473 MetricAbsence condition_absent = 2; 474 475 // A condition that checks for log messages matching given constraints. If 476 // set, no other conditions can be present. 477 LogMatch condition_matched_log = 20; 478 479 // A condition that uses the Monitoring Query Language to define 480 // alerts. 481 MonitoringQueryLanguageCondition condition_monitoring_query_language = 19; 482 483 // A condition that uses the Prometheus query language to define alerts. 484 PrometheusQueryLanguageCondition condition_prometheus_query_language = 21; 485 } 486 } 487 488 // Operators for combining conditions. 489 enum ConditionCombinerType { 490 // An unspecified combiner. 491 COMBINE_UNSPECIFIED = 0; 492 493 // Combine conditions using the logical `AND` operator. An 494 // incident is created only if all the conditions are met 495 // simultaneously. This combiner is satisfied if all conditions are 496 // met, even if they are met on completely different resources. 497 AND = 1; 498 499 // Combine conditions using the logical `OR` operator. An incident 500 // is created if any of the listed conditions is met. 501 OR = 2; 502 503 // Combine conditions using logical `AND` operator, but unlike the regular 504 // `AND` option, an incident is created only if all conditions are met 505 // simultaneously on at least one resource. 506 AND_WITH_MATCHING_RESOURCE = 3; 507 } 508 509 // Control over how the notification channels in `notification_channels` 510 // are notified when this alert fires. 511 message AlertStrategy { 512 // Control over the rate of notifications sent to this alert policy's 513 // notification channels. 514 message NotificationRateLimit { 515 // Not more than one notification per `period`. 516 google.protobuf.Duration period = 1; 517 } 518 519 // Control over how the notification channels in `notification_channels` 520 // are notified when this alert fires, on a per-channel basis. 521 message NotificationChannelStrategy { 522 // The full REST resource name for the notification channels that these 523 // settings apply to. Each of these correspond to the name field in one 524 // of the NotificationChannel objects referenced in the 525 // notification_channels field of this AlertPolicy. 526 // The format is: 527 // 528 // projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] 529 repeated string notification_channel_names = 1; 530 531 // The frequency at which to send reminder notifications for open 532 // incidents. 533 google.protobuf.Duration renotify_interval = 2; 534 } 535 536 // Required for alert policies with a `LogMatch` condition. 537 // 538 // This limit is not implemented for alert policies that are not log-based. 539 NotificationRateLimit notification_rate_limit = 1; 540 541 // If an alert policy that was active has no data for this long, any open 542 // incidents will close 543 google.protobuf.Duration auto_close = 3; 544 545 // Control how notifications will be sent out, on a per-channel basis. 546 repeated NotificationChannelStrategy notification_channel_strategy = 4; 547 } 548 549 // An enumeration of possible severity level for an Alert Policy. 550 enum Severity { 551 // No severity is specified. This is the default value. 552 SEVERITY_UNSPECIFIED = 0; 553 554 // This is the highest severity level. Use this if the problem could 555 // cause significant damage or downtime. 556 CRITICAL = 1; 557 558 // This is the medium severity level. Use this if the problem could 559 // cause minor damage or downtime. 560 ERROR = 2; 561 562 // This is the lowest severity level. Use this if the problem is not causing 563 // any damage or downtime, but could potentially lead to a problem in the 564 // future. 565 WARNING = 3; 566 } 567 568 // Required if the policy exists. The resource name for this policy. The 569 // format is: 570 // 571 // projects/[PROJECT_ID_OR_NUMBER]/alertPolicies/[ALERT_POLICY_ID] 572 // 573 // `[ALERT_POLICY_ID]` is assigned by Cloud Monitoring when the policy 574 // is created. When calling the 575 // [alertPolicies.create][google.monitoring.v3.AlertPolicyService.CreateAlertPolicy] 576 // method, do not include the `name` field in the alerting policy passed as 577 // part of the request. 578 string name = 1; 579 580 // A short name or phrase used to identify the policy in dashboards, 581 // notifications, and incidents. To avoid confusion, don't use the same 582 // display name for multiple policies in the same project. The name is 583 // limited to 512 Unicode characters. 584 // 585 // The convention for the display_name of a PrometheusQueryLanguageCondition 586 // is "{rule group name}/{alert name}", where the {rule group name} and 587 // {alert name} should be taken from the corresponding Prometheus 588 // configuration file. This convention is not enforced. 589 // In any case the display_name is not a unique key of the AlertPolicy. 590 string display_name = 2; 591 592 // Documentation that is included with notifications and incidents related to 593 // this policy. Best practice is for the documentation to include information 594 // to help responders understand, mitigate, escalate, and correct the 595 // underlying problems detected by the alerting policy. Notification channels 596 // that have limited capacity might not show this documentation. 597 Documentation documentation = 13; 598 599 // User-supplied key/value data to be used for organizing and 600 // identifying the `AlertPolicy` objects. 601 // 602 // The field can contain up to 64 entries. Each key and value is limited to 603 // 63 Unicode characters or 128 bytes, whichever is smaller. Labels and 604 // values can contain only lowercase letters, numerals, underscores, and 605 // dashes. Keys must begin with a letter. 606 // 607 // Note that Prometheus {alert name} is a 608 // [valid Prometheus label 609 // names](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels), 610 // whereas Prometheus {rule group} is an unrestricted UTF-8 string. 611 // This means that they cannot be stored as-is in user labels, because 612 // they may contain characters that are not allowed in user-label values. 613 map<string, string> user_labels = 16; 614 615 // A list of conditions for the policy. The conditions are combined by AND or 616 // OR according to the `combiner` field. If the combined conditions evaluate 617 // to true, then an incident is created. A policy can have from one to six 618 // conditions. 619 // If `condition_time_series_query_language` is present, it must be the only 620 // `condition`. 621 // If `condition_monitoring_query_language` is present, it must be the only 622 // `condition`. 623 repeated Condition conditions = 12; 624 625 // How to combine the results of multiple conditions to determine if an 626 // incident should be opened. 627 // If `condition_time_series_query_language` is present, this must be 628 // `COMBINE_UNSPECIFIED`. 629 ConditionCombinerType combiner = 6; 630 631 // Whether or not the policy is enabled. On write, the default interpretation 632 // if unset is that the policy is enabled. On read, clients should not make 633 // any assumption about the state if it has not been populated. The 634 // field should always be populated on List and Get operations, unless 635 // a field projection has been specified that strips it out. 636 google.protobuf.BoolValue enabled = 17; 637 638 // Read-only description of how the alert policy is invalid. This field is 639 // only set when the alert policy is invalid. An invalid alert policy will not 640 // generate incidents. 641 google.rpc.Status validity = 18; 642 643 // Identifies the notification channels to which notifications should be sent 644 // when incidents are opened or closed or when new violations occur on 645 // an already opened incident. Each element of this array corresponds to 646 // the `name` field in each of the 647 // [`NotificationChannel`][google.monitoring.v3.NotificationChannel] 648 // objects that are returned from the [`ListNotificationChannels`] 649 // [google.monitoring.v3.NotificationChannelService.ListNotificationChannels] 650 // method. The format of the entries in this field is: 651 // 652 // projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] 653 repeated string notification_channels = 14; 654 655 // A read-only record of the creation of the alerting policy. If provided 656 // in a call to create or update, this field will be ignored. 657 MutationRecord creation_record = 10; 658 659 // A read-only record of the most recent change to the alerting policy. If 660 // provided in a call to create or update, this field will be ignored. 661 MutationRecord mutation_record = 11; 662 663 // Control over how this alert policy's notification channels are notified. 664 AlertStrategy alert_strategy = 21; 665 666 // Optional. The severity of an alert policy indicates how important incidents 667 // generated by that policy are. The severity level will be displayed on the 668 // Incident detail page and in notifications. 669 Severity severity = 22 [(google.api.field_behavior) = OPTIONAL]; 670} 671