diff --git a/go/types/v1/alert.pb.go b/go/types/v1/alert.pb.go index ff81679..694e106 100644 --- a/go/types/v1/alert.pb.go +++ b/go/types/v1/alert.pb.go @@ -478,9 +478,12 @@ type AlertRuleStatus struct { // *AlertRuleStatus_Ok // *AlertRuleStatus_Pending // *AlertRuleStatus_Firing - Status isAlertRuleStatus_Status `protobuf_oneof:"status"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache + Status isAlertRuleStatus_Status `protobuf_oneof:"status"` + LastEvaluatedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=last_evaluated_at,json=lastEvaluatedAt,proto3" json:"last_evaluated_at,omitempty"` + LastEvaluationMetrics *QueryMetrics `protobuf:"bytes,5,opt,name=last_evaluation_metrics,json=lastEvaluationMetrics,proto3" json:"last_evaluation_metrics,omitempty"` + Error *string `protobuf:"bytes,6,opt,name=error,proto3,oneof" json:"error,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *AlertRuleStatus) Reset() { @@ -570,6 +573,27 @@ func (x *AlertRuleStatus) GetFiring() *AlertFiring { return nil } +func (x *AlertRuleStatus) GetLastEvaluatedAt() *timestamppb.Timestamp { + if x != nil { + return x.LastEvaluatedAt + } + return nil +} + +func (x *AlertRuleStatus) GetLastEvaluationMetrics() *QueryMetrics { + if x != nil { + return x.LastEvaluationMetrics + } + return nil +} + +func (x *AlertRuleStatus) GetError() string { + if x != nil && x.Error != nil { + return *x.Error + } + return "" +} + type isAlertRuleStatus_Status interface { isAlertRuleStatus_Status() } @@ -858,7 +882,7 @@ var File_types_v1_alert_proto protoreflect.FileDescriptor const file_types_v1_alert_proto_rawDesc = "" + "\n" + - "\x14types/v1/alert.proto\x12\btypes.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x14types/v1/query.proto\x1a\x14types/v1/types.proto\"\x9c\x01\n" + + "\x14types/v1/alert.proto\x12\btypes.v1\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x14types/v1/query.proto\x1a\x1ctypes/v1/query_metrics.proto\x1a\x14types/v1/types.proto\"\x9c\x01\n" + "\n" + "AlertGroup\x12,\n" + "\x04meta\x18\x01 \x01(\v2\x18.types.v1.AlertGroupMetaR\x04meta\x12,\n" + @@ -898,15 +922,19 @@ const file_types_v1_alert_proto_rawDesc = "" + "\x06labels\x18\x03 \x01(\v2\r.types.v1.ObjR\x06labels\x12/\n" + "\vannotations\x18\x04 \x01(\v2\r.types.v1.ObjR\vannotations\x12+\n" + "\x03for\x183 \x01(\v2\x19.google.protobuf.DurationR\x03for\x12A\n" + - "\x0fkeep_firing_for\x184 \x01(\v2\x19.google.protobuf.DurationR\rkeepFiringFor\"\xe4\x02\n" + + "\x0fkeep_firing_for\x184 \x01(\v2\x19.google.protobuf.DurationR\rkeepFiringFor\"\xa1\x04\n" + "\x0fAlertRuleStatus\x12C\n" + "\x0ftransitioned_at\x18\x01 \x01(\v2\x1a.google.protobuf.TimestampR\x0etransitionedAt\x12@\n" + "\x0elast_firing_at\x18\x02 \x01(\v2\x1a.google.protobuf.TimestampR\flastFiringAt\x123\n" + "\aunknown\x18\xac\x02 \x01(\v2\x16.types.v1.AlertUnknownH\x00R\aunknown\x12$\n" + "\x02ok\x18\xad\x02 \x01(\v2\x11.types.v1.AlertOkH\x00R\x02ok\x123\n" + "\apending\x18\xae\x02 \x01(\v2\x16.types.v1.AlertPendingH\x00R\apending\x120\n" + - "\x06firing\x18\xaf\x02 \x01(\v2\x15.types.v1.AlertFiringH\x00R\x06firingB\b\n" + - "\x06status\"\x0e\n" + + "\x06firing\x18\xaf\x02 \x01(\v2\x15.types.v1.AlertFiringH\x00R\x06firing\x12F\n" + + "\x11last_evaluated_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\x0flastEvaluatedAt\x12N\n" + + "\x17last_evaluation_metrics\x18\x05 \x01(\v2\x16.types.v1.QueryMetricsR\x15lastEvaluationMetrics\x12\x19\n" + + "\x05error\x18\x06 \x01(\tH\x01R\x05error\x88\x01\x01B\b\n" + + "\x06statusB\b\n" + + "\x06_error\"\x0e\n" + "\fAlertUnknown\"\t\n" + "\aAlertOk\"\x0e\n" + "\fAlertPending\"4\n" + @@ -947,6 +975,7 @@ var file_types_v1_alert_proto_goTypes = []any{ (*Obj)(nil), // 15: types.v1.Obj (*timestamppb.Timestamp)(nil), // 16: google.protobuf.Timestamp (*Query)(nil), // 17: types.v1.Query + (*QueryMetrics)(nil), // 18: types.v1.QueryMetrics } var file_types_v1_alert_proto_depIdxs = []int32{ 1, // 0: types.v1.AlertGroup.meta:type_name -> types.v1.AlertGroupMeta @@ -973,14 +1002,16 @@ var file_types_v1_alert_proto_depIdxs = []int32{ 9, // 21: types.v1.AlertRuleStatus.ok:type_name -> types.v1.AlertOk 10, // 22: types.v1.AlertRuleStatus.pending:type_name -> types.v1.AlertPending 11, // 23: types.v1.AlertRuleStatus.firing:type_name -> types.v1.AlertFiring - 15, // 24: types.v1.AlertFiring.labels:type_name -> types.v1.Obj - 6, // 25: types.v1.AlertGroupSpec.NamedAlertRuleSpec.spec:type_name -> types.v1.AlertRuleSpec - 7, // 26: types.v1.AlertGroupStatus.NamedAlertRuleStatus.status:type_name -> types.v1.AlertRuleStatus - 27, // [27:27] is the sub-list for method output_type - 27, // [27:27] is the sub-list for method input_type - 27, // [27:27] is the sub-list for extension type_name - 27, // [27:27] is the sub-list for extension extendee - 0, // [0:27] is the sub-list for field type_name + 16, // 24: types.v1.AlertRuleStatus.last_evaluated_at:type_name -> google.protobuf.Timestamp + 18, // 25: types.v1.AlertRuleStatus.last_evaluation_metrics:type_name -> types.v1.QueryMetrics + 15, // 26: types.v1.AlertFiring.labels:type_name -> types.v1.Obj + 6, // 27: types.v1.AlertGroupSpec.NamedAlertRuleSpec.spec:type_name -> types.v1.AlertRuleSpec + 7, // 28: types.v1.AlertGroupStatus.NamedAlertRuleStatus.status:type_name -> types.v1.AlertRuleStatus + 29, // [29:29] is the sub-list for method output_type + 29, // [29:29] is the sub-list for method input_type + 29, // [29:29] is the sub-list for extension type_name + 29, // [29:29] is the sub-list for extension extendee + 0, // [0:29] is the sub-list for field type_name } func init() { file_types_v1_alert_proto_init() } @@ -989,6 +1020,7 @@ func file_types_v1_alert_proto_init() { return } file_types_v1_query_proto_init() + file_types_v1_query_metrics_proto_init() file_types_v1_types_proto_init() file_types_v1_alert_proto_msgTypes[7].OneofWrappers = []any{ (*AlertRuleStatus_Unknown)(nil), diff --git a/js/types/v1/alert_pb.ts b/js/types/v1/alert_pb.ts index 53634db..e4fb3d3 100644 --- a/js/types/v1/alert_pb.ts +++ b/js/types/v1/alert_pb.ts @@ -8,6 +8,8 @@ import type { Duration, Timestamp } from "@bufbuild/protobuf/wkt"; import { file_google_protobuf_duration, file_google_protobuf_timestamp } from "@bufbuild/protobuf/wkt"; import type { Query } from "./query_pb"; import { file_types_v1_query } from "./query_pb"; +import type { QueryMetrics } from "./query_metrics_pb"; +import { file_types_v1_query_metrics } from "./query_metrics_pb"; import type { Obj } from "./types_pb"; import { file_types_v1_types } from "./types_pb"; import type { Message } from "@bufbuild/protobuf"; @@ -16,7 +18,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file types/v1/alert.proto. */ export const file_types_v1_alert: GenFile = /*@__PURE__*/ - fileDesc("ChR0eXBlcy92MS9hbGVydC5wcm90bxIIdHlwZXMudjEiiAEKCkFsZXJ0R3JvdXASJgoEbWV0YRgBIAEoCzIYLnR5cGVzLnYxLkFsZXJ0R3JvdXBNZXRhEiYKBHNwZWMYAiABKAsyGC50eXBlcy52MS5BbGVydEdyb3VwU3BlYxIqCgZzdGF0dXMYAyABKAsyGi50eXBlcy52MS5BbGVydEdyb3VwU3RhdHVzIhwKDkFsZXJ0R3JvdXBNZXRhEgoKAmlkGAEgASgJIq8CCg5BbGVydEdyb3VwU3BlYxIMCgRuYW1lGAEgASgJEisKCGludGVydmFsGAIgASgLMhkuZ29vZ2xl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LMg0udHlwZXMudjEuT2JqEiYKA2ZvchgzIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbhIyCg9rZWVwX2ZpcmluZ19mb3IYNCABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24iqAIKD0FsZXJ0UnVsZVN0YXR1cxIzCg90cmFuc2l0aW9uZWRfYXQYASABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEjIKDmxhc3RfZmlyaW5nX2F0GAIgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIqCgd1bmtub3duGKwCIAEoCzIWLnR5cGVzLnYxLkFsZXJ0VW5rbm93bkgAEiAKAm9rGK0CIAEoCzIRLnR5cGVzLnYxLkFsZXJ0T2tIABIqCgdwZW5kaW5nGK4CIAEoCzIWLnR5cGVzLnYxLkFsZXJ0UGVuZGluZ0gAEigKBmZpcmluZxivAiABKAsyFS50eXBlcy52MS5BbGVydEZpcmluZ0gAQggKBnN0YXR1cyIOCgxBbGVydFVua25vd24iCQoHQWxlcnRPayIOCgxBbGVydFBlbmRpbmciLAoLQWxlcnRGaXJpbmcSHQoGbGFiZWxzGAEgASgLMg0udHlwZXMudjEuT2JqQooBCgxjb20udHlwZXMudjFCCkFsZXJ0UHJvdG9QAVotZ2l0aHViLmNvbS9odW1hbmxvZ2lvL2FwaS9nby90eXBlcy92MTt0eXBlc3YxogIDVFhYqgIIVHlwZXMuVjHKAghUeXBlc1xWMeICFFR5cGVzXFYxXEdQQk1ldGFkYXRh6gIJVHlwZXM6OlYxYgZwcm90bzM", [file_google_protobuf_duration, file_google_protobuf_timestamp, file_types_v1_query, file_types_v1_types]); + fileDesc("ChR0eXBlcy92MS9hbGVydC5wcm90bxIIdHlwZXMudjEiiAEKCkFsZXJ0R3JvdXASJgoEbWV0YRgBIAEoCzIYLnR5cGVzLnYxLkFsZXJ0R3JvdXBNZXRhEiYKBHNwZWMYAiABKAsyGC50eXBlcy52MS5BbGVydEdyb3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3RvUAFaLWdpdGh1Yi5jb20vaHVtYW5sb2dpby9hcGkvZ28vdHlwZXMvdjE7dHlwZXN2MaICA1RYWKoCCFR5cGVzLlYxygIIVHlwZXNcVjHiAhRUeXBlc1xWMVxHUEJNZXRhZGF0YeoCCVR5cGVzOjpWMWIGcHJvdG8z", [file_google_protobuf_duration, file_google_protobuf_timestamp, file_types_v1_query, file_types_v1_query_metrics, file_types_v1_types]); /** * @generated from message types.v1.AlertGroup @@ -310,6 +312,21 @@ export type AlertRuleStatus = Message<"types.v1.AlertRuleStatus"> & { value: AlertFiring; case: "firing"; } | { case: undefined; value?: undefined }; + + /** + * @generated from field: google.protobuf.Timestamp last_evaluated_at = 4; + */ + lastEvaluatedAt?: Timestamp; + + /** + * @generated from field: types.v1.QueryMetrics last_evaluation_metrics = 5; + */ + lastEvaluationMetrics?: QueryMetrics; + + /** + * @generated from field: optional string error = 6; + */ + error?: string; }; /** diff --git a/proto/types/v1/alert.proto b/proto/types/v1/alert.proto index e3fc55a..2bdf7d9 100644 --- a/proto/types/v1/alert.proto +++ b/proto/types/v1/alert.proto @@ -5,6 +5,7 @@ package types.v1; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; import "types/v1/query.proto"; +import "types/v1/query_metrics.proto"; import "types/v1/types.proto"; option go_package = "types/v1;typesv1"; @@ -74,6 +75,10 @@ message AlertRuleStatus { AlertPending pending = 302; AlertFiring firing = 303; } + + google.protobuf.Timestamp last_evaluated_at = 4; + types.v1.QueryMetrics last_evaluation_metrics = 5; + optional string error = 6; } message AlertUnknown {}