Open tonfay opened 5 years ago
Could you provide more details?
Hi, could you please illustrate your requirement?
感谢alibaba 对sentinel的开源贡献! 正文: 例: A访问B项目,是否对接口的参数=1进行自动熔断,而非整个方法熔断降级 A访问B项目的B1接口,参数=1 业务正常,参数=2 业务异常.如果对B1资源开启自动降级规则,则无论参数为1或2都会被降级. 问: sentinel是否支持只对异常参数的方法进行降级处理呢?
I'd like to ask you why not throw custom biz Exception
instead of flag to recognize the service status.
And could you give the scenario in detail? For example: param is orderStatus
, value 1 for success, value 0 for failure.
@wchswchs 你好 我这边有一个这样的业务,对车机下发指令,车机终端的信号可能并不是很好. 下发指令就会有发生超时的情况,我对下发指令这里做了一个微服务接口供外部使用. 例: 对这个接口开启自动降级策略(异常数>=1则触发,持续时长为1min) 接口参数为deviceNo 当调用接口deviceNo=0001时 ,下发成功. 当调用接口deviceNo=0002 出现超时情况,此时触发接口的降级策略 当调用接口deviceNo=0003,接口已自动降级,则不对车机终端进行指令下发动作.
目标: 当调用接口deviceNo=0003时 ,应在这1min内,只要参数为0003都应触发服务降级策略.而0003以外的参数是不受到影响的.
I see, but I don't understand why keep the exception for 1 mins, it shouldn't keep problem for a long time, and Sentinel provide the strategy for auto degrade and recovery, you can refer to https://github.com/alibaba/Sentinel/wiki/%E7%86%94%E6%96%AD%E9%99%8D%E7%BA%A7.
降级周期只是个时间问题而已,我不关心时间的问题. sentinel 自动降级,是对方法或代码块级别的,我的问题是,是否能对参数进行自动降级策略. 麻烦您请多关注下问题.您也能更准确的帮助我解决问题.感谢!
降级周期只是个时间问题而已,我不关心时间的问题. sentinel 自动降级,是对方法或代码块级别的,我的问题是,是否能对参数进行自动降级策略. 麻烦您请多关注下问题.您也能更准确的帮助我解决问题.感谢!
I understand your meaning, you want to return the terminal device status by wrapping a service, I think you can get your service status by calling the metric api for the service. But maybe we haven't the degrade metric to record. Then I think we can add this api to get the service degrade metrics.
You can try to refer to this wiki: https://github.com/alibaba/Sentinel/wiki/%E5%AE%9E%E6%97%B6%E7%9B%91%E6%8E%A7, I'm not sure whether it can help you.
It's not resolved But thank you very much @wchswchs
It's not resolved But thank you very much @wchswchs
Ok, Then we can add this api to get the service degrade metrics.
It's not resolved But thank you very much @wchswchs
Ok, Then we can add this api to get the service degrade metrics.
I know that, but my requirements are parameters in the corresponding API.
Maybe I think you can do refer to the logic below:
I don't think it's a good practice to downgrade based on response parameters. The reasons are as follows:
@wchswchs 你好 我这边有一个这样的业务,对车机下发指令,车机终端的信号可能并不是很好. 下发指令就会有发生超时的情况,我对下发指令这里做了一个微服务接口供外部使用. 例: 对这个接口开启自动降级策略(异常数>=1则触发,持续时长为1min) 接口参数为deviceNo 当调用接口deviceNo=0001时 ,下发成功. 当调用接口deviceNo=0002 出现超时情况,此时触发接口的降级策略 当调用接口deviceNo=0003,接口已自动降级,则不对车机终端进行指令下发动作.
目标: 当调用接口deviceNo=0003时 ,应在这1min内,只要参数为0003都应触发服务降级策略.而0003以外的参数是不受到影响的.
请各位针对此问题进行讨论.否则我们会很耽误时间来聊其它问题.
Sentinel支持热点参数限流,参考 https://github.com/alibaba/Sentinel/wiki/热点参数限流#热点参数规则 但模式是QPS模式。
你说这个感觉有点像是参数+异常降级结合的形式。
目标: 当调用接口deviceNo=0003时 ,应在这1min内,只要参数为0003都应触发服务降级策略.而0003以外的参数是不受到影响的.
这里的deviceNo=0003
是不是写错了,是0002吧?
因为看你前面的说的,好像是仅对异常的参数,0003是新的参数啊
Sentinel支持热点参数限流,参考 https://github.com/alibaba/Sentinel/wiki/热点参数限流#热点参数规则 但模式是QPS模式。
你说这个感觉有点像是参数+异常降级结合的形式。
目标: 当调用接口deviceNo=0003时 ,应在这1min内,只要参数为0003都应触发服务降级策略.而0003以外的参数是不受到影响的.
这里的
deviceNo=0003
是不是写错了,是0002吧? 因为看你前面的说的,好像是仅对异常的参数,0003是新的参数啊
你好,很高兴您的回答, 参数+异常降级结合形式.我看sentinel 当前是只支持参数+流控, 还没有参数+异常降级的策略. 我的了解有错误嘛?
I also faced the same problem, Looking forward to progress.
Whether service degradation for automatic discovery parameters can be done