From bfc8e3cd3979f7e08753362265480dc9a959d742 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 2 Jan 2024 11:23:34 -0800 Subject: [PATCH] feat: [monitoring] Added support for severity in AlertPolicy (#10137) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Added support for severity in AlertPolicy docs: add value range to comment on field forecast_horizon PiperOrigin-RevId: 589949568 Source-Link: https://github.com/googleapis/googleapis/commit/54bc5b6f20c29a97a0a2dc07b3282b57095c8afa Source-Link: https://github.com/googleapis/googleapis-gen/commit/5284b323830b15a79b4bf2799ba8d83bd1013c6a Copy-Tag: eyJwIjoiamF2YS1tb25pdG9yaW5nLy5Pd2xCb3QueWFtbCIsImgiOiI1Mjg0YjMyMzgzMGIxNWE3OWI0YmYyNzk5YmE4ZDgzYmQxMDEzYzZhIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot --- java-monitoring/README.md | 2 +- .../reflect-config.json | 9 + .../com/google/monitoring/v3/AlertPolicy.java | 380 ++++++++++++++++++ .../monitoring/v3/AlertPolicyOrBuilder.java | 33 ++ .../com/google/monitoring/v3/AlertProto.java | 203 +++++----- .../proto/google/monitoring/v3/alert.proto | 25 ++ 6 files changed, 552 insertions(+), 100 deletions(-) diff --git a/java-monitoring/README.md b/java-monitoring/README.md index 6ed7b0632ede..9e00bae6b8ee 100644 --- a/java-monitoring/README.md +++ b/java-monitoring/README.md @@ -195,7 +195,7 @@ Java is a registered trademark of Oracle and/or its affiliates. [kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html [stability-image]: https://img.shields.io/badge/stability-stable-green [maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-monitoring.svg -[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-monitoring/3.31.0 +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-monitoring/3.33.0 [authentication]: https://github.com/googleapis/google-cloud-java#authentication [auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes [predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles diff --git a/java-monitoring/google-cloud-monitoring/src/main/resources/META-INF/native-image/com.google.cloud.monitoring.v3/reflect-config.json b/java-monitoring/google-cloud-monitoring/src/main/resources/META-INF/native-image/com.google.cloud.monitoring.v3/reflect-config.json index 5021e69939b8..8d247d01bd5d 100644 --- a/java-monitoring/google-cloud-monitoring/src/main/resources/META-INF/native-image/com.google.cloud.monitoring.v3/reflect-config.json +++ b/java-monitoring/google-cloud-monitoring/src/main/resources/META-INF/native-image/com.google.cloud.monitoring.v3/reflect-config.json @@ -944,6 +944,15 @@ "allDeclaredClasses": true, "allPublicClasses": true }, + { + "name": "com.google.monitoring.v3.AlertPolicy$Severity", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, { "name": "com.google.monitoring.v3.BasicSli", "queryAllDeclaredConstructors": true, diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java index 75474ed83751..e790ffcf1918 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicy.java @@ -46,6 +46,7 @@ private AlertPolicy() { conditions_ = java.util.Collections.emptyList(); combiner_ = 0; notificationChannels_ = com.google.protobuf.LazyStringArrayList.emptyList(); + severity_ = 0; } @java.lang.Override @@ -274,6 +275,193 @@ private ConditionCombinerType(int value) { // @@protoc_insertion_point(enum_scope:google.monitoring.v3.AlertPolicy.ConditionCombinerType) } + /** + * + * + *
+   * An enumeration of possible severity level for an Alert Policy.
+   * 
+ * + * Protobuf enum {@code google.monitoring.v3.AlertPolicy.Severity} + */ + public enum Severity implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * No severity is specified. This is the default value.
+     * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + SEVERITY_UNSPECIFIED(0), + /** + * + * + *
+     * This is the highest severity level. Use this if the problem could
+     * cause significant damage or downtime.
+     * 
+ * + * CRITICAL = 1; + */ + CRITICAL(1), + /** + * + * + *
+     * This is the medium severity level. Use this if the problem could
+     * cause minor damage or downtime.
+     * 
+ * + * ERROR = 2; + */ + ERROR(2), + /** + * + * + *
+     * This is the lowest severity level. Use this if the problem is not causing
+     * any damage or downtime, but could potentially lead to a problem in the
+     * future.
+     * 
+ * + * WARNING = 3; + */ + WARNING(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * No severity is specified. This is the default value.
+     * 
+ * + * SEVERITY_UNSPECIFIED = 0; + */ + public static final int SEVERITY_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * This is the highest severity level. Use this if the problem could
+     * cause significant damage or downtime.
+     * 
+ * + * CRITICAL = 1; + */ + public static final int CRITICAL_VALUE = 1; + /** + * + * + *
+     * This is the medium severity level. Use this if the problem could
+     * cause minor damage or downtime.
+     * 
+ * + * ERROR = 2; + */ + public static final int ERROR_VALUE = 2; + /** + * + * + *
+     * This is the lowest severity level. Use this if the problem is not causing
+     * any damage or downtime, but could potentially lead to a problem in the
+     * future.
+     * 
+ * + * WARNING = 3; + */ + public static final int WARNING_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Severity valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Severity forNumber(int value) { + switch (value) { + case 0: + return SEVERITY_UNSPECIFIED; + case 1: + return CRITICAL; + case 2: + return ERROR; + case 3: + return WARNING; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Severity findValueByNumber(int number) { + return Severity.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.monitoring.v3.AlertPolicy.getDescriptor().getEnumTypes().get(1); + } + + private static final Severity[] VALUES = values(); + + public static Severity valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Severity(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.monitoring.v3.AlertPolicy.Severity) + } + public interface DocumentationOrBuilder extends // @@protoc_insertion_point(interface_extends:google.monitoring.v3.AlertPolicy.Documentation) @@ -3503,6 +3691,7 @@ public interface ForecastOptionsOrBuilder * found to violate the threshold, and the violation is observed in all * forecasts made for the configured `duration`, then the time series is * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. * * * @@ -3521,6 +3710,7 @@ public interface ForecastOptionsOrBuilder * found to violate the threshold, and the violation is observed in all * forecasts made for the configured `duration`, then the time series is * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. * * * @@ -3539,6 +3729,7 @@ public interface ForecastOptionsOrBuilder * found to violate the threshold, and the violation is observed in all * forecasts made for the configured `duration`, then the time series is * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. * * * @@ -3604,6 +3795,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * found to violate the threshold, and the violation is observed in all * forecasts made for the configured `duration`, then the time series is * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. * * * @@ -3625,6 +3817,7 @@ public boolean hasForecastHorizon() { * found to violate the threshold, and the violation is observed in all * forecasts made for the configured `duration`, then the time series is * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. * * * @@ -3648,6 +3841,7 @@ public com.google.protobuf.Duration getForecastHorizon() { * found to violate the threshold, and the violation is observed in all * forecasts made for the configured `duration`, then the time series is * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. * * * @@ -4070,6 +4264,7 @@ public Builder mergeFrom( * found to violate the threshold, and the violation is observed in all * forecasts made for the configured `duration`, then the time series is * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. * * * @@ -4090,6 +4285,7 @@ public boolean hasForecastHorizon() { * found to violate the threshold, and the violation is observed in all * forecasts made for the configured `duration`, then the time series is * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. * * * @@ -4116,6 +4312,7 @@ public com.google.protobuf.Duration getForecastHorizon() { * found to violate the threshold, and the violation is observed in all * forecasts made for the configured `duration`, then the time series is * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. * * * @@ -4144,6 +4341,7 @@ public Builder setForecastHorizon(com.google.protobuf.Duration value) { * found to violate the threshold, and the violation is observed in all * forecasts made for the configured `duration`, then the time series is * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. * * * @@ -4169,6 +4367,7 @@ public Builder setForecastHorizon(com.google.protobuf.Duration.Builder builderFo * found to violate the threshold, and the violation is observed in all * forecasts made for the configured `duration`, then the time series is * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. * * * @@ -4200,6 +4399,7 @@ public Builder mergeForecastHorizon(com.google.protobuf.Duration value) { * found to violate the threshold, and the violation is observed in all * forecasts made for the configured `duration`, then the time series is * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. * * * @@ -4225,6 +4425,7 @@ public Builder clearForecastHorizon() { * found to violate the threshold, and the violation is observed in all * forecasts made for the configured `duration`, then the time series is * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. * * * @@ -4245,6 +4446,7 @@ public com.google.protobuf.Duration.Builder getForecastHorizonBuilder() { * found to violate the threshold, and the violation is observed in all * forecasts made for the configured `duration`, then the time series is * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. * * * @@ -4269,6 +4471,7 @@ public com.google.protobuf.DurationOrBuilder getForecastHorizonOrBuilder() { * found to violate the threshold, and the violation is observed in all * forecasts made for the configured `duration`, then the time series is * considered to be failing. + * The forecast horizon can range from 1 hour to 60 hours. * * * @@ -23511,6 +23714,49 @@ public com.google.monitoring.v3.AlertPolicy.AlertStrategyOrBuilder getAlertStrat : alertStrategy_; } + public static final int SEVERITY_FIELD_NUMBER = 22; + private int severity_ = 0; + /** + * + * + *
+   * Optional. The severity of an alert policy indicates how important incidents
+   * generated by that policy are. The severity level will be displayed on the
+   * Incident detail page and in notifications.
+   * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+   * Optional. The severity of an alert policy indicates how important incidents
+   * generated by that policy are. The severity level will be displayed on the
+   * Incident detail page and in notifications.
+   * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The severity. + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Severity getSeverity() { + com.google.monitoring.v3.AlertPolicy.Severity result = + com.google.monitoring.v3.AlertPolicy.Severity.forNumber(severity_); + return result == null ? com.google.monitoring.v3.AlertPolicy.Severity.UNRECOGNIZED : result; + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -23563,6 +23809,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (alertStrategy_ != null) { output.writeMessage(21, getAlertStrategy()); } + if (severity_ + != com.google.monitoring.v3.AlertPolicy.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + output.writeEnum(22, severity_); + } getUnknownFields().writeTo(output); } @@ -23622,6 +23872,10 @@ public int getSerializedSize() { if (alertStrategy_ != null) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getAlertStrategy()); } + if (severity_ + != com.google.monitoring.v3.AlertPolicy.Severity.SEVERITY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(22, severity_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -23667,6 +23921,7 @@ public boolean equals(final java.lang.Object obj) { if (hasAlertStrategy()) { if (!getAlertStrategy().equals(other.getAlertStrategy())) return false; } + if (severity_ != other.severity_) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @@ -23720,6 +23975,8 @@ public int hashCode() { hash = (37 * hash) + ALERT_STRATEGY_FIELD_NUMBER; hash = (53 * hash) + getAlertStrategy().hashCode(); } + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; @@ -23923,6 +24180,7 @@ public Builder clear() { alertStrategyBuilder_.dispose(); alertStrategyBuilder_ = null; } + severity_ = 0; return this; } @@ -24010,6 +24268,9 @@ private void buildPartial0(com.google.monitoring.v3.AlertPolicy result) { result.alertStrategy_ = alertStrategyBuilder_ == null ? alertStrategy_ : alertStrategyBuilder_.build(); } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.severity_ = severity_; + } } @java.lang.Override @@ -24127,6 +24388,9 @@ public Builder mergeFrom(com.google.monitoring.v3.AlertPolicy other) { if (other.hasAlertStrategy()) { mergeAlertStrategy(other.getAlertStrategy()); } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; @@ -24239,6 +24503,12 @@ public Builder mergeFrom( bitField0_ |= 0x00000800; break; } // case 170 + case 176: + { + severity_ = input.readEnum(); + bitField0_ |= 0x00001000; + break; + } // case 176 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { @@ -26856,6 +27126,116 @@ public com.google.monitoring.v3.AlertPolicy.AlertStrategyOrBuilder getAlertStrat return alertStrategyBuilder_; } + private int severity_ = 0; + /** + * + * + *
+     * Optional. The severity of an alert policy indicates how important incidents
+     * generated by that policy are. The severity level will be displayed on the
+     * Incident detail page and in notifications.
+     * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for severity. + */ + @java.lang.Override + public int getSeverityValue() { + return severity_; + } + /** + * + * + *
+     * Optional. The severity of an alert policy indicates how important incidents
+     * generated by that policy are. The severity level will be displayed on the
+     * Incident detail page and in notifications.
+     * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for severity to set. + * @return This builder for chaining. + */ + public Builder setSeverityValue(int value) { + severity_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The severity of an alert policy indicates how important incidents
+     * generated by that policy are. The severity level will be displayed on the
+     * Incident detail page and in notifications.
+     * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The severity. + */ + @java.lang.Override + public com.google.monitoring.v3.AlertPolicy.Severity getSeverity() { + com.google.monitoring.v3.AlertPolicy.Severity result = + com.google.monitoring.v3.AlertPolicy.Severity.forNumber(severity_); + return result == null ? com.google.monitoring.v3.AlertPolicy.Severity.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. The severity of an alert policy indicates how important incidents
+     * generated by that policy are. The severity level will be displayed on the
+     * Incident detail page and in notifications.
+     * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The severity to set. + * @return This builder for chaining. + */ + public Builder setSeverity(com.google.monitoring.v3.AlertPolicy.Severity value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00001000; + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The severity of an alert policy indicates how important incidents
+     * generated by that policy are. The severity level will be displayed on the
+     * Incident detail page and in notifications.
+     * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearSeverity() { + bitField0_ = (bitField0_ & ~0x00001000); + severity_ = 0; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyOrBuilder.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyOrBuilder.java index 5e8a65b28b4f..66ab9144266a 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyOrBuilder.java +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertPolicyOrBuilder.java @@ -682,4 +682,37 @@ java.lang.String getUserLabelsOrDefault( * .google.monitoring.v3.AlertPolicy.AlertStrategy alert_strategy = 21; */ com.google.monitoring.v3.AlertPolicy.AlertStrategyOrBuilder getAlertStrategyOrBuilder(); + + /** + * + * + *
+   * Optional. The severity of an alert policy indicates how important incidents
+   * generated by that policy are. The severity level will be displayed on the
+   * Incident detail page and in notifications.
+   * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for severity. + */ + int getSeverityValue(); + /** + * + * + *
+   * Optional. The severity of an alert policy indicates how important incidents
+   * generated by that policy are. The severity level will be displayed on the
+   * Incident detail page and in notifications.
+   * 
+ * + * + * .google.monitoring.v3.AlertPolicy.Severity severity = 22 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The severity. + */ + com.google.monitoring.v3.AlertPolicy.Severity getSeverity(); } diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java index c0579be51495..6e763e1e8960 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/java/com/google/monitoring/v3/AlertProto.java @@ -107,7 +107,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "monitoring/v3/mutation_record.proto\032\036goo" + "gle/protobuf/duration.proto\032\036google/prot" + "obuf/wrappers.proto\032\027google/rpc/status.p" - + "roto\"\222\"\n\013AlertPolicy\022\014\n\004name\030\001 \001(\t\022\024\n\014di" + + "roto\"\242#\n\013AlertPolicy\022\014\n\004name\030\001 \001(\t\022\024\n\014di" + "splay_name\030\002 \001(\t\022F\n\rdocumentation\030\r \001(\0132" + "/.google.monitoring.v3.AlertPolicy.Docum" + "entation\022F\n\013user_labels\030\020 \003(\01321.google.m" @@ -123,105 +123,109 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "\017mutation_record\030\013 \001(\0132$.google.monitori" + "ng.v3.MutationRecord\022G\n\016alert_strategy\030\025" + " \001(\0132/.google.monitoring.v3.AlertPolicy." - + "AlertStrategy\032J\n\rDocumentation\022\017\n\007conten" - + "t\030\001 \001(\t\022\021\n\tmime_type\030\002 \001(\t\022\025\n\007subject\030\003 " - + "\001(\tB\004\342A\001\001\032\201\026\n\tCondition\022\014\n\004name\030\014 \001(\t\022\024\n" - + "\014display_name\030\006 \001(\t\022Z\n\023condition_thresho" - + "ld\030\001 \001(\0132;.google.monitoring.v3.AlertPol" - + "icy.Condition.MetricThresholdH\000\022U\n\020condi" - + "tion_absent\030\002 \001(\01329.google.monitoring.v3" - + ".AlertPolicy.Condition.MetricAbsenceH\000\022U" - + "\n\025condition_matched_log\030\024 \001(\01324.google.m" - + "onitoring.v3.AlertPolicy.Condition.LogMa" - + "tchH\000\022{\n#condition_monitoring_query_lang" - + "uage\030\023 \001(\0132L.google.monitoring.v3.AlertP" - + "olicy.Condition.MonitoringQueryLanguageC" - + "onditionH\000\022{\n#condition_prometheus_query" - + "_language\030\025 \001(\0132L.google.monitoring.v3.A" - + "lertPolicy.Condition.PrometheusQueryLang" - + "uageConditionH\000\0325\n\007Trigger\022\017\n\005count\030\001 \001(" - + "\005H\000\022\021\n\007percent\030\002 \001(\001H\000B\006\n\004type\032\240\005\n\017Metri" - + "cThreshold\022\024\n\006filter\030\002 \001(\tB\004\342A\001\002\0227\n\014aggr" - + "egations\030\010 \003(\0132!.google.monitoring.v3.Ag" - + "gregation\022\032\n\022denominator_filter\030\t \001(\t\022C\n" - + "\030denominator_aggregations\030\n \003(\0132!.google" - + ".monitoring.v3.Aggregation\022e\n\020forecast_o" - + "ptions\030\014 \001(\0132K.google.monitoring.v3.Aler" - + "tPolicy.Condition.MetricThreshold.Foreca" - + "stOptions\0228\n\ncomparison\030\004 \001(\0162$.google.m" - + "onitoring.v3.ComparisonType\022\027\n\017threshold" - + "_value\030\005 \001(\001\022+\n\010duration\030\006 \001(\0132\031.google." - + "protobuf.Duration\022D\n\007trigger\030\007 \001(\01323.goo" - + "gle.monitoring.v3.AlertPolicy.Condition." - + "Trigger\022b\n\027evaluation_missing_data\030\013 \001(\016" - + "2A.google.monitoring.v3.AlertPolicy.Cond" - + "ition.EvaluationMissingData\032L\n\017ForecastO" - + "ptions\0229\n\020forecast_horizon\030\001 \001(\0132\031.googl" - + "e.protobuf.DurationB\004\342A\001\002\032\321\001\n\rMetricAbse" - + "nce\022\024\n\006filter\030\001 \001(\tB\004\342A\001\002\0227\n\014aggregation" - + "s\030\005 \003(\0132!.google.monitoring.v3.Aggregati" - + "on\022+\n\010duration\030\002 \001(\0132\031.google.protobuf.D" - + "uration\022D\n\007trigger\030\003 \001(\01323.google.monito" - + "ring.v3.AlertPolicy.Condition.Trigger\032\275\001" - + "\n\010LogMatch\022\024\n\006filter\030\001 \001(\tB\004\342A\001\002\022c\n\020labe" - + "l_extractors\030\002 \003(\0132I.google.monitoring.v" - + "3.AlertPolicy.Condition.LogMatch.LabelEx" - + "tractorsEntry\0326\n\024LabelExtractorsEntry\022\013\n" - + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032\210\002\n Monito" - + "ringQueryLanguageCondition\022\r\n\005query\030\001 \001(" - + "\t\022+\n\010duration\030\002 \001(\0132\031.google.protobuf.Du" - + "ration\022D\n\007trigger\030\003 \001(\01323.google.monitor" - + "ing.v3.AlertPolicy.Condition.Trigger\022b\n\027" - + "evaluation_missing_data\030\004 \001(\0162A.google.m" - + "onitoring.v3.AlertPolicy.Condition.Evalu" - + "ationMissingData\032\373\002\n PrometheusQueryLang" - + "uageCondition\022\023\n\005query\030\001 \001(\tB\004\342A\001\002\0221\n\010du" - + "ration\030\002 \001(\0132\031.google.protobuf.DurationB" - + "\004\342A\001\001\022<\n\023evaluation_interval\030\003 \001(\0132\031.goo" - + "gle.protobuf.DurationB\004\342A\001\001\022n\n\006labels\030\004 " - + "\003(\0132X.google.monitoring.v3.AlertPolicy.C" + + "AlertStrategy\022B\n\010severity\030\026 \001(\0162*.google" + + ".monitoring.v3.AlertPolicy.SeverityB\004\342A\001" + + "\001\032J\n\rDocumentation\022\017\n\007content\030\001 \001(\t\022\021\n\tm" + + "ime_type\030\002 \001(\t\022\025\n\007subject\030\003 \001(\tB\004\342A\001\001\032\201\026" + + "\n\tCondition\022\014\n\004name\030\014 \001(\t\022\024\n\014display_nam" + + "e\030\006 \001(\t\022Z\n\023condition_threshold\030\001 \001(\0132;.g" + + "oogle.monitoring.v3.AlertPolicy.Conditio" + + "n.MetricThresholdH\000\022U\n\020condition_absent\030" + + "\002 \001(\01329.google.monitoring.v3.AlertPolicy" + + ".Condition.MetricAbsenceH\000\022U\n\025condition_" + + "matched_log\030\024 \001(\01324.google.monitoring.v3" + + ".AlertPolicy.Condition.LogMatchH\000\022{\n#con" + + "dition_monitoring_query_language\030\023 \001(\0132L" + + ".google.monitoring.v3.AlertPolicy.Condit" + + "ion.MonitoringQueryLanguageConditionH\000\022{" + + "\n#condition_prometheus_query_language\030\025 " + + "\001(\0132L.google.monitoring.v3.AlertPolicy.C" + "ondition.PrometheusQueryLanguageConditio" - + "n.LabelsEntryB\004\342A\001\001\022\030\n\nrule_group\030\005 \001(\tB" - + "\004\342A\001\001\022\030\n\nalert_rule\030\006 \001(\tB\004\342A\001\001\032-\n\013Label" - + "sEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\255" - + "\001\n\025EvaluationMissingData\022\'\n#EVALUATION_M" - + "ISSING_DATA_UNSPECIFIED\020\000\022$\n EVALUATION_" - + "MISSING_DATA_INACTIVE\020\001\022\"\n\036EVALUATION_MI" - + "SSING_DATA_ACTIVE\020\002\022!\n\035EVALUATION_MISSIN" - + "G_DATA_NO_OP\020\003:\227\002\352A\223\002\n.monitoring.google" - + "apis.com/AlertPolicyCondition\022Fprojects/" - + "{project}/alertPolicies/{alert_policy}/c" - + "onditions/{condition}\022Porganizations/{or" - + "ganization}/alertPolicies/{alert_policy}" - + "/conditions/{condition}\022Dfolders/{folder" - + "}/alertPolicies/{alert_policy}/condition" - + "s/{condition}\022\001*B\013\n\tcondition\032\327\003\n\rAlertS" - + "trategy\022f\n\027notification_rate_limit\030\001 \001(\013" - + "2E.google.monitoring.v3.AlertPolicy.Aler" - + "tStrategy.NotificationRateLimit\022-\n\nauto_" - + "close\030\003 \001(\0132\031.google.protobuf.Duration\022r" - + "\n\035notification_channel_strategy\030\004 \003(\0132K." - + "google.monitoring.v3.AlertPolicy.AlertSt" - + "rategy.NotificationChannelStrategy\032B\n\025No" - + "tificationRateLimit\022)\n\006period\030\001 \001(\0132\031.go" - + "ogle.protobuf.Duration\032w\n\033NotificationCh" - + "annelStrategy\022\"\n\032notification_channel_na" - + "mes\030\001 \003(\t\0224\n\021renotify_interval\030\002 \001(\0132\031.g" - + "oogle.protobuf.Duration\0321\n\017UserLabelsEnt" - + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"a\n\025Co" - + "nditionCombinerType\022\027\n\023COMBINE_UNSPECIFI" - + "ED\020\000\022\007\n\003AND\020\001\022\006\n\002OR\020\002\022\036\n\032AND_WITH_MATCHI" - + "NG_RESOURCE\020\003:\311\001\352A\305\001\n%monitoring.googlea" - + "pis.com/AlertPolicy\022/projects/{project}/" - + "alertPolicies/{alert_policy}\0229organizati" - + "ons/{organization}/alertPolicies/{alert_" - + "policy}\022-folders/{folder}/alertPolicies/" - + "{alert_policy}\022\001*B\305\001\n\030com.google.monitor" - + "ing.v3B\nAlertProtoP\001ZAcloud.google.com/g" - + "o/monitoring/apiv3/v2/monitoringpb;monit" - + "oringpb\252\002\032Google.Cloud.Monitoring.V3\312\002\032G" - + "oogle\\Cloud\\Monitoring\\V3\352\002\035Google::Clou" - + "d::Monitoring::V3b\006proto3" + + "nH\000\0325\n\007Trigger\022\017\n\005count\030\001 \001(\005H\000\022\021\n\007perce" + + "nt\030\002 \001(\001H\000B\006\n\004type\032\240\005\n\017MetricThreshold\022\024" + + "\n\006filter\030\002 \001(\tB\004\342A\001\002\0227\n\014aggregations\030\010 \003" + + "(\0132!.google.monitoring.v3.Aggregation\022\032\n" + + "\022denominator_filter\030\t \001(\t\022C\n\030denominator" + + "_aggregations\030\n \003(\0132!.google.monitoring." + + "v3.Aggregation\022e\n\020forecast_options\030\014 \001(\013" + + "2K.google.monitoring.v3.AlertPolicy.Cond" + + "ition.MetricThreshold.ForecastOptions\0228\n" + + "\ncomparison\030\004 \001(\0162$.google.monitoring.v3" + + ".ComparisonType\022\027\n\017threshold_value\030\005 \001(\001" + + "\022+\n\010duration\030\006 \001(\0132\031.google.protobuf.Dur" + + "ation\022D\n\007trigger\030\007 \001(\01323.google.monitori" + + "ng.v3.AlertPolicy.Condition.Trigger\022b\n\027e" + + "valuation_missing_data\030\013 \001(\0162A.google.mo" + + "nitoring.v3.AlertPolicy.Condition.Evalua" + + "tionMissingData\032L\n\017ForecastOptions\0229\n\020fo" + + "recast_horizon\030\001 \001(\0132\031.google.protobuf.D" + + "urationB\004\342A\001\002\032\321\001\n\rMetricAbsence\022\024\n\006filte" + + "r\030\001 \001(\tB\004\342A\001\002\0227\n\014aggregations\030\005 \003(\0132!.go" + + "ogle.monitoring.v3.Aggregation\022+\n\010durati" + + "on\030\002 \001(\0132\031.google.protobuf.Duration\022D\n\007t" + + "rigger\030\003 \001(\01323.google.monitoring.v3.Aler" + + "tPolicy.Condition.Trigger\032\275\001\n\010LogMatch\022\024" + + "\n\006filter\030\001 \001(\tB\004\342A\001\002\022c\n\020label_extractors" + + "\030\002 \003(\0132I.google.monitoring.v3.AlertPolic" + + "y.Condition.LogMatch.LabelExtractorsEntr" + + "y\0326\n\024LabelExtractorsEntry\022\013\n\003key\030\001 \001(\t\022\r" + + "\n\005value\030\002 \001(\t:\0028\001\032\210\002\n MonitoringQueryLan" + + "guageCondition\022\r\n\005query\030\001 \001(\t\022+\n\010duratio" + + "n\030\002 \001(\0132\031.google.protobuf.Duration\022D\n\007tr" + + "igger\030\003 \001(\01323.google.monitoring.v3.Alert" + + "Policy.Condition.Trigger\022b\n\027evaluation_m" + + "issing_data\030\004 \001(\0162A.google.monitoring.v3" + + ".AlertPolicy.Condition.EvaluationMissing" + + "Data\032\373\002\n PrometheusQueryLanguageConditio" + + "n\022\023\n\005query\030\001 \001(\tB\004\342A\001\002\0221\n\010duration\030\002 \001(\013" + + "2\031.google.protobuf.DurationB\004\342A\001\001\022<\n\023eva" + + "luation_interval\030\003 \001(\0132\031.google.protobuf" + + ".DurationB\004\342A\001\001\022n\n\006labels\030\004 \003(\0132X.google" + + ".monitoring.v3.AlertPolicy.Condition.Pro" + + "metheusQueryLanguageCondition.LabelsEntr" + + "yB\004\342A\001\001\022\030\n\nrule_group\030\005 \001(\tB\004\342A\001\001\022\030\n\nale" + + "rt_rule\030\006 \001(\tB\004\342A\001\001\032-\n\013LabelsEntry\022\013\n\003ke" + + "y\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\255\001\n\025Evaluatio" + + "nMissingData\022\'\n#EVALUATION_MISSING_DATA_" + + "UNSPECIFIED\020\000\022$\n EVALUATION_MISSING_DATA" + + "_INACTIVE\020\001\022\"\n\036EVALUATION_MISSING_DATA_A" + + "CTIVE\020\002\022!\n\035EVALUATION_MISSING_DATA_NO_OP" + + "\020\003:\227\002\352A\223\002\n.monitoring.googleapis.com/Ale" + + "rtPolicyCondition\022Fprojects/{project}/al" + + "ertPolicies/{alert_policy}/conditions/{c" + + "ondition}\022Porganizations/{organization}/" + + "alertPolicies/{alert_policy}/conditions/" + + "{condition}\022Dfolders/{folder}/alertPolic" + + "ies/{alert_policy}/conditions/{condition" + + "}\022\001*B\013\n\tcondition\032\327\003\n\rAlertStrategy\022f\n\027n" + + "otification_rate_limit\030\001 \001(\0132E.google.mo" + + "nitoring.v3.AlertPolicy.AlertStrategy.No" + + "tificationRateLimit\022-\n\nauto_close\030\003 \001(\0132" + + "\031.google.protobuf.Duration\022r\n\035notificati" + + "on_channel_strategy\030\004 \003(\0132K.google.monit" + + "oring.v3.AlertPolicy.AlertStrategy.Notif" + + "icationChannelStrategy\032B\n\025NotificationRa" + + "teLimit\022)\n\006period\030\001 \001(\0132\031.google.protobu" + + "f.Duration\032w\n\033NotificationChannelStrateg" + + "y\022\"\n\032notification_channel_names\030\001 \003(\t\0224\n" + + "\021renotify_interval\030\002 \001(\0132\031.google.protob" + + "uf.Duration\0321\n\017UserLabelsEntry\022\013\n\003key\030\001 " + + "\001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"a\n\025ConditionCombi" + + "nerType\022\027\n\023COMBINE_UNSPECIFIED\020\000\022\007\n\003AND\020" + + "\001\022\006\n\002OR\020\002\022\036\n\032AND_WITH_MATCHING_RESOURCE\020" + + "\003\"J\n\010Severity\022\030\n\024SEVERITY_UNSPECIFIED\020\000\022" + + "\014\n\010CRITICAL\020\001\022\t\n\005ERROR\020\002\022\013\n\007WARNING\020\003:\311\001" + + "\352A\305\001\n%monitoring.googleapis.com/AlertPol" + + "icy\022/projects/{project}/alertPolicies/{a" + + "lert_policy}\0229organizations/{organizatio" + + "n}/alertPolicies/{alert_policy}\022-folders" + + "/{folder}/alertPolicies/{alert_policy}\022\001" + + "*B\305\001\n\030com.google.monitoring.v3B\nAlertPro" + + "toP\001ZAcloud.google.com/go/monitoring/api" + + "v3/v2/monitoringpb;monitoringpb\252\002\032Google" + + ".Cloud.Monitoring.V3\312\002\032Google\\Cloud\\Moni" + + "toring\\V3\352\002\035Google::Cloud::Monitoring::V" + + "3b\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( @@ -253,6 +257,7 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { "CreationRecord", "MutationRecord", "AlertStrategy", + "Severity", }); internal_static_google_monitoring_v3_AlertPolicy_Documentation_descriptor = internal_static_google_monitoring_v3_AlertPolicy_descriptor.getNestedTypes().get(0); diff --git a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto index b746a5e47d52..8dafe88a235a 100644 --- a/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto +++ b/java-monitoring/proto-google-cloud-monitoring-v3/src/main/proto/google/monitoring/v3/alert.proto @@ -135,6 +135,7 @@ message AlertPolicy { // found to violate the threshold, and the violation is observed in all // forecasts made for the configured `duration`, then the time series is // considered to be failing. + // The forecast horizon can range from 1 hour to 60 hours. google.protobuf.Duration forecast_horizon = 1 [(google.api.field_behavior) = REQUIRED]; } @@ -544,6 +545,25 @@ message AlertPolicy { repeated NotificationChannelStrategy notification_channel_strategy = 4; } + // An enumeration of possible severity level for an Alert Policy. + enum Severity { + // No severity is specified. This is the default value. + SEVERITY_UNSPECIFIED = 0; + + // This is the highest severity level. Use this if the problem could + // cause significant damage or downtime. + CRITICAL = 1; + + // This is the medium severity level. Use this if the problem could + // cause minor damage or downtime. + ERROR = 2; + + // This is the lowest severity level. Use this if the problem is not causing + // any damage or downtime, but could potentially lead to a problem in the + // future. + WARNING = 3; + } + // Required if the policy exists. The resource name for this policy. The // format is: // @@ -641,4 +661,9 @@ message AlertPolicy { // Control over how this alert policy's notification channels are notified. AlertStrategy alert_strategy = 21; + + // Optional. The severity of an alert policy indicates how important incidents + // generated by that policy are. The severity level will be displayed on the + // Incident detail page and in notifications. + Severity severity = 22 [(google.api.field_behavior) = OPTIONAL]; }