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

fix: add traffic-type label to distinguish pass type, fix #501 #502

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

qshuai
Copy link

@qshuai qshuai commented Jan 16, 2023

Describe what this PR does / why we need it

Does this pull request fix one issue?

Describe how you did it

Describe how to verify it

Special notes for reviews

@CLAassistant
Copy link

CLAassistant commented Jan 16, 2023

CLA assistant check
All committers have signed the CLA.

@sczyh30 sczyh30 added the area/metrics Issue related to metrics and monitoring label Jan 17, 2023
@sczyh30
Copy link
Member

sczyh30 commented Jan 17, 2023

Hi, could you please sign the CLA here: https://cla-assistant.io/alibaba/sentinel-golang?pullRequest=502

@qshuai
Copy link
Author

qshuai commented Jan 17, 2023

Hi, could you please sign the CLA here: https://cla-assistant.io/alibaba/sentinel-golang?pullRequest=502

done

jnan806
jnan806 previously approved these changes Jan 17, 2023
Copy link
Contributor

@jnan806 jnan806 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qshuai

This PR only distinguish TrafficType inbound / outbound.

but issue #501 request to distinguish circuitbreak / flow

image

@qshuai
Copy link
Author

qshuai commented Jan 17, 2023

@qshuai

This PR only distinguish TrafficType inbound / outbound.

but issue #501 request to distinguish circuitbreak / flow

image

好的,我想这个地方有个前提假设:inbound block的流量往往和限流有关,而outbound block流量和熔断有关。

@@ -52,7 +52,7 @@ func (s *Slot) OnEntryPassed(ctx *base.EntryContext) {
s.recordPassFor(InboundNode(), ctx.Input.BatchCount)
}

handledCounter.Add(float64(ctx.Input.BatchCount), ctx.Resource.Name(), ResultPass, "")
handledCounter.Add(float64(ctx.Input.BatchCount), ctx.Resource.Name(), ResultPass, "", ctx.Resource.FlowType().String())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用flowType 只能区分出inboud/outbound。 如果要区分出具体命中的rule类型,可以将命中的规则类型,暂存到ctx的data map中,然后在这里提取。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是的,我添加了命中规则的名称,请帮忙审阅一下

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/metrics Issue related to metrics and monitoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants