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

Add Exceptions to trace or ignore in Tracer #766

Merged
merged 2 commits into from
May 22, 2019

Conversation

CarpenterLee
Copy link
Contributor

Signed-off-by: Carpenter Lee hooleeucas@163.com

Describe what this PR does / why we need it

Exception statistics are the basis for degradation or circuit breaker, and Tracer.trace() will trace any exception besides BlockException, this means any kinds of exception except for BlockException will have an effect on degradation.

Sometimes we may want to ignore some kind of exceptions in the statistics.

This PR Supports inclusive or exclusive Exception types in exception tracing.

Does this pull request fix one issue?

Fixes #761

Describe how you did it

Add Tracer.setExceptionsToTrace() and Tracer.setExceptionsToIgnore() in Tracer, to supports inclusive or exclusive Exception types in exception tracing.

Describe how to verify it

Run test cases.

Signed-off-by: Carpenter Lee <hooleeucas@163.com>
@CarpenterLee CarpenterLee added the to-review To review label May 16, 2019
@codecov-io
Copy link

codecov-io commented May 16, 2019

Codecov Report

Merging #766 into master will increase coverage by 0.07%.
The diff coverage is 67.85%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #766      +/-   ##
============================================
+ Coverage        41%   41.07%   +0.07%     
- Complexity     1334     1346      +12     
============================================
  Files           301      301              
  Lines          8629     8654      +25     
  Branches       1159     1166       +7     
============================================
+ Hits           3538     3555      +17     
- Misses         4665     4670       +5     
- Partials        426      429       +3
Impacted Files Coverage Δ Complexity Δ
...src/main/java/com/alibaba/csp/sentinel/Tracer.java 31.14% <67.85%> (+31.14%) 12 <12> (+12) ⬆️
...tinel/slots/block/flow/param/ParamFlowChecker.java 52.7% <0%> (-2.71%) 28% <0%> (-1%)
...java/com/alibaba/csp/sentinel/util/AssertUtil.java 26.66% <0%> (+13.33%) 3% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83ab401...8b19060. Read the comment docs.

Signed-off-by: Carpenter Lee <hooleeucas@163.com>
Copy link
Member

@sczyh30 sczyh30 left a comment

Choose a reason for hiding this comment

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

LGTM

@sczyh30 sczyh30 merged commit f3e705c into master May 22, 2019
@sczyh30 sczyh30 deleted the feature/inclusive_exclusive_exception_types branch May 22, 2019 02:06
@sczyh30 sczyh30 removed the to-review To review label May 22, 2019
@sczyh30 sczyh30 added this to the 1.6.1 milestone May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support inclusive or exclusive Exception types in exception tracing
3 participants