syntax = "proto3"; package v1; import "model.proto"; option go_package = "github.com/polarismesh/specification/source/go/api/v1/fault_tolerance"; option java_package = "com.tencent.polaris.specification.api.v1.fault.tolerance"; option java_outer_classname = "FaultDetectorProto"; message FaultDetector { // fault detect rules for current service repeated FaultDetectRule rules = 1; // total revision for the fault detect rules string revision = 2; } message FaultDetectRule { string id = 1; // rule name string name = 2; // namespace of rule string namespace = 3; // revision routing version string revision = 4; // ctime create time of the rules string ctime = 5; // mtime modify time of the rules string mtime = 6; // description simple description rules string description = 7; // reserve for metadata reserved 8 to 20; message DestinationService { string service = 1; string namespace = 2; // deprecated_filed use api.path instead MatchString method = 3 [deprecated = true]; API api = 4; } // detect target DestinationService target_service = 21; // detect interval uint32 interval = 22; // detect timeout uint32 timeout = 23; // detect port uint32 port = 24; // detect protocol enum Protocol { UNKNOWN = 0; HTTP = 1; TCP = 2; UDP = 3; } Protocol protocol = 25; // http detect config HttpProtocolConfig http_config = 26; // tcp detect config TcpProtocolConfig tcp_config = 27; // udp detect config UdpProtocolConfig udp_config = 28; // priority rules priority uint32 priority = 29 [ json_name = "priority" ]; // 探测规则标签数据 map metadata = 30 [ json_name = "metadata" ]; // extend info, put some custom info to display in console map extendInfo = 31 [ json_name = "extend_info" ]; // 操作标志位 bool editable = 40 [ json_name = "editable" ]; bool deleteable = 41 [ json_name = "deleteable" ]; } message HttpProtocolConfig { string method = 1; string url = 2; message MessageHeader { string key = 1; string value = 2; } repeated MessageHeader headers = 3; string body = 4; } message TcpProtocolConfig { string send = 1; repeated string receive = 2; } message UdpProtocolConfig { string send = 1; repeated string receive = 2; }