github.com/yankunsam/loki/v2@v2.6.3-0.20220817130409-389df5235c27/pkg/ruler/base/ruler.proto (about) 1 // Ruler Service Representation 2 // This service is used to retrieve the current state of rules running across 3 // all Rulers in a cluster. 4 syntax = "proto3"; 5 6 package base; 7 8 import "github.com/gogo/protobuf/gogoproto/gogo.proto"; 9 import "google/protobuf/duration.proto"; 10 import "google/protobuf/timestamp.proto"; 11 import "pkg/logproto/logproto.proto"; 12 import "pkg/ruler/rulespb/rules.proto"; 13 14 option (gogoproto.marshaler_all) = true; 15 option (gogoproto.unmarshaler_all) = true; 16 17 service Ruler { 18 rpc Rules(RulesRequest) returns (RulesResponse) {} 19 } 20 21 message RulesRequest {} 22 23 message RulesResponse { 24 repeated GroupStateDesc groups = 1; 25 } 26 27 // GroupStateDesc is a proto representation of a rule group 28 message GroupStateDesc { 29 rules.RuleGroupDesc group = 1; 30 repeated RuleStateDesc active_rules = 2; 31 google.protobuf.Timestamp evaluationTimestamp = 3 [ 32 (gogoproto.nullable) = false, 33 (gogoproto.stdtime) = true 34 ]; 35 google.protobuf.Duration evaluationDuration = 4 [ 36 (gogoproto.nullable) = false, 37 (gogoproto.stdduration) = true 38 ]; 39 } 40 41 // RuleStateDesc is a proto representation of a Prometheus Rule 42 message RuleStateDesc { 43 rules.RuleDesc rule = 1; 44 string state = 2; 45 string health = 3; 46 string lastError = 4; 47 repeated AlertStateDesc alerts = 5; 48 google.protobuf.Timestamp evaluationTimestamp = 6 [ 49 (gogoproto.nullable) = false, 50 (gogoproto.stdtime) = true 51 ]; 52 google.protobuf.Duration evaluationDuration = 7 [ 53 (gogoproto.nullable) = false, 54 (gogoproto.stdduration) = true 55 ]; 56 } 57 58 message AlertStateDesc { 59 string state = 1; 60 repeated logproto.LegacyLabelPair labels = 2 [ 61 (gogoproto.nullable) = false, 62 (gogoproto.customtype) = "github.com/grafana/loki/pkg/logproto.LabelAdapter" 63 ]; 64 repeated logproto.LegacyLabelPair annotations = 3 [ 65 (gogoproto.nullable) = false, 66 (gogoproto.customtype) = "github.com/grafana/loki/pkg/logproto.LabelAdapter" 67 ]; 68 double value = 4; 69 google.protobuf.Timestamp active_at = 5 [ 70 (gogoproto.nullable) = false, 71 (gogoproto.stdtime) = true 72 ]; 73 google.protobuf.Timestamp fired_at = 6 [ 74 (gogoproto.nullable) = false, 75 (gogoproto.stdtime) = true 76 ]; 77 google.protobuf.Timestamp resolved_at = 7 [ 78 (gogoproto.nullable) = false, 79 (gogoproto.stdtime) = true 80 ]; 81 google.protobuf.Timestamp last_sent_at = 8 [ 82 (gogoproto.nullable) = false, 83 (gogoproto.stdtime) = true 84 ]; 85 google.protobuf.Timestamp valid_until = 9 [ 86 (gogoproto.nullable) = false, 87 (gogoproto.stdtime) = true 88 ]; 89 }