diff --git a/api/v1/fault_tolerance/circuitbreaker.proto b/api/v1/fault_tolerance/circuitbreaker.proto index 97d51238..1355a9ce 100644 --- a/api/v1/fault_tolerance/circuitbreaker.proto +++ b/api/v1/fault_tolerance/circuitbreaker.proto @@ -224,7 +224,8 @@ message RuleMatcher { message DestinationService { string service = 1; string namespace = 2; - MatchString method = 3; + // deprecated_filed using api.path in blockConfig instead + MatchString method = 3 [deprecated = true]; } SourceService source = 1; DestinationService destination = 2; @@ -268,10 +269,10 @@ message CircuitBreakerRule { Level level = 21; // match condition for this rule RuleMatcher rule_matcher = 22; - // error conditions to judge an invocation as an error - repeated ErrorCondition error_conditions = 23; - // trigger condition to trigger circuitbreaking - repeated TriggerCondition trigger_condition = 24; + // deprecated_filed error conditions to judge an invocation as an error + repeated ErrorCondition error_conditions = 23 [deprecated = true]; + // deprecated_filed trigger condition to trigger circuitbreaking + repeated TriggerCondition trigger_condition = 24 [deprecated = true]; // the maximum % of an upstream cluster that can be ejected uint32 max_ejection_percent = 25; // recover condition to make resource open to close @@ -280,6 +281,10 @@ message CircuitBreakerRule { FaultDetectConfig faultDetectConfig = 27; // fall back configuration FallbackConfig fallbackConfig = 28; + // list for block configuration + repeated BlockConfig block_configs = 29 [ json_name = "block_configs" ]; + // priority rules priority + uint32 priority = 30 [ json_name = "priority" ]; } // the condition to judge an input invocation as an error @@ -307,6 +312,7 @@ message TriggerCondition { uint32 minimum_request = 5; } +// circuitbreaking OPEN status recover message RecoverCondition { // seconds from open to half-open uint32 sleep_window = 1; @@ -314,15 +320,18 @@ message RecoverCondition { uint32 consecutiveSuccess = 2; } +// fault detect config within circuitbreaking message FaultDetectConfig { bool enable = 1; } +// fallback config message FallbackConfig { bool enable = 1; FallbackResponse response = 2; } +// fallback response message FallbackResponse { int32 code = 1; message MessageHeader { @@ -331,4 +340,15 @@ message FallbackResponse { } repeated MessageHeader headers = 2; string body = 3; +} + +// blocking strategy +message BlockConfig { + string name = 1 [ json_name = "name" ]; + // blocking target api + API api = 2 [ json_name = "api" ]; + // conditions to judge an invocation as an error + repeated ErrorCondition error_conditions = 3 [ json_name = "error_conditions" ]; + // trigger condition to trigger circuitbreaking + repeated TriggerCondition trigger_conditions = 4 [ json_name = "trigger_conditions" ]; } \ No newline at end of file diff --git a/api/v1/fault_tolerance/fault_detector.proto b/api/v1/fault_tolerance/fault_detector.proto index a2baa7ea..e03889f9 100644 --- a/api/v1/fault_tolerance/fault_detector.proto +++ b/api/v1/fault_tolerance/fault_detector.proto @@ -36,7 +36,9 @@ message FaultDetectRule { message DestinationService { string service = 1; string namespace = 2; - MatchString method = 3; + // deprecated_filed use api.path instead + MatchString method = 3 [deprecated = true]; + API api = 4; } // detect target DestinationService target_service = 21; @@ -60,6 +62,8 @@ message FaultDetectRule { TcpProtocolConfig tcp_config = 27; // udp detect config UdpProtocolConfig udp_config = 28; + // priority rules priority + uint32 priority = 29 [ json_name = "priority" ]; } message HttpProtocolConfig { diff --git a/api/v1/model/model.proto b/api/v1/model/model.proto index 6677db2a..b24d8547 100644 --- a/api/v1/model/model.proto +++ b/api/v1/model/model.proto @@ -59,3 +59,13 @@ message ClientLabel { string key = 1; MatchString value = 2; } + +// API统一数据结构 +message API { + // API的协议,*或者为空代表全部 + string protocol = 1 [ json_name = "protocol" ]; + // API的方法,*或者为空代表全部 + string method = 2 [ json_name = "method" ]; + // API的路径,支持多种匹配方式 + MatchString path = 3 [ json_name = "path" ]; +} \ No newline at end of file diff --git a/api/v1/traffic_manage/routing.proto b/api/v1/traffic_manage/routing.proto index a942b833..de8f404d 100644 --- a/api/v1/traffic_manage/routing.proto +++ b/api/v1/traffic_manage/routing.proto @@ -180,11 +180,11 @@ message NearbyRoutingConfig { // RuleRoutingConfig routing configuration message RuleRoutingConfig { // source source info - // deprecated: only for compatible to the old version server - repeated SourceService sources = 1; + // deprecated_filed only for compatible to the old version server + repeated SourceService sources = 1 [deprecated = true]; // destination destinations info - // deprecated: only for compatible to the old version server - repeated DestinationGroup destinations = 2; + // deprecated_filed only for compatible to the old version server + repeated DestinationGroup destinations = 2 [deprecated = true]; // rule route chain repeated SubRuleRouting rules = 3; } @@ -260,6 +260,8 @@ message SourceMatch { PATH = 5; // cookie match http cookie COOKIE = 6; + // indicate the caller instance metadata + CALLER_METADATA = 7; } Type type = 1; // header key or query key