Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System overload rule does not take effect for customized resource| 自定义埋点 配置了系统规则 入口qps阈值,但不起作用 #2459

Closed
DeBruyne2020 opened this issue Nov 25, 2021 · 5 comments
Labels
kind/question Category issues related to questions or problems

Comments

@DeBruyne2020
Copy link

sentinel版本号1.8.1
springcloud版本号:Hoxton.RELEASE
springboot版本号:2.3.1.RELEASE
springCloudAlibaba版本号: 2.2.6.RELEASE

配置“系统规则”,配置阈值 入口qps=0,但没起作用 ,qps依然可以达到20
image
image

Issue Description

Type: bug report or feature request

Describe what happened (or what feature you want)

Describe what you expected to happen

How to reproduce it (as minimally and precisely as possible)

Tell us your environment

Anything else we need to know?

@DeBruyne2020 DeBruyne2020 changed the title 配置了系统规则 入口qps阈值,但不未起作用 配置了系统规则 入口qps阈值,但不起作用 Nov 25, 2021
@sczyh30 sczyh30 added the kind/question Category issues related to questions or problems label Nov 29, 2021
@wucheng1997
Copy link
Contributor

#2455 解决相关问题。

@DeBruyne2020
Copy link
Author

#2455 解决相关问题。

@wucheng1997
您好 ,我debug发现和2455情况不一样, 我debug出来的原因是因为resourceWrapper.getEntryType()是OUT,
走到了下面这个拦截
if (resourceWrapper.getEntryType() != EntryType.IN) {
return;
}

    所以触发不到SystemRule的代码
    
    附debug截图:

image

@sczyh30
Copy link
Member

sczyh30 commented Dec 23, 2021

如果是自定义埋点的话,需要指定为 EntryType.IN,代表 inbound traffic;系统规则从设计上仅对 inbound traffic 生效。


For customized resources, you may set EntryType to IN manually, indicating it's inbound traffic.

@sczyh30 sczyh30 changed the title 配置了系统规则 入口qps阈值,但不起作用 自定义埋点 配置了系统规则 入口qps阈值,但不起作用 Dec 23, 2021
@DeBruyne2020
Copy link
Author

如果是自定义埋点的话,需要指定为 EntryType.IN,代表 inbound traffic;系统规则从设计上仅对 inbound traffic 生效。

@sczyh30
大佬您好, 这个例子,奇怪的点在于我降低到sentinel1.7.2版本就可以触发SystemRule了,当时debug看得效果是降到sentinel1.7.2版本后,同样的请求,resourceWrapper.getEntryType() 就是EntryType.IN,

@sczyh30 sczyh30 changed the title 自定义埋点 配置了系统规则 入口qps阈值,但不起作用 System overload rule does not take effect for customized resource| 自定义埋点 配置了系统规则 入口qps阈值,但不起作用 Jan 10, 2022
@sczyh30
Copy link
Member

sczyh30 commented Jan 10, 2022

具体的 EntryType 都是由 SphU.entry 方式传入的(注解方式也类似),默认不传的话都为 OUT,若拿到的是 IN 则传入的就是 IN。Sentinel 自带的 Web 和 RPC provider 埋点都是自动标识为 inbound 的。

@sczyh30 sczyh30 closed this as completed Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Category issues related to questions or problems
Projects
None yet
Development

No branches or pull requests

3 participants