-
Notifications
You must be signed in to change notification settings - Fork 740
Disable tracing error on middleware #209
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #209 +/- ##
=======================================
Coverage 73.09% 73.09%
=======================================
Files 36 36
Lines 1349 1349
=======================================
Hits 986 986
Misses 314 314
Partials 49 49
Continue to review full report at Codecov.
|
domgreen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @mmoustai if we are looking to disable the tracing of errors can we do so via opts into the interceptor and keep the default to true so that it does not unexpectedly change the default behavior for others.
Could you also look to add a test and example for the new opt. Thanks :)
| newCtx, serverSpan := newServerSpanFromInbound(ctx, o.tracer, info.FullMethod) | ||
| resp, err := handler(newCtx, req) | ||
| finishServerSpan(ctx, serverSpan, err) | ||
| finishServerSpan(ctx, serverSpan, err, false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets pass this via opts ... maybe something like DisableErrorTracing default to true so not to change behaviour
| } | ||
|
|
||
| func finishServerSpan(ctx context.Context, serverSpan opentracing.Span, err error) { | ||
| func finishServerSpan(ctx context.Context, serverSpan opentracing.Span, err error, active bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
active > o.DisableErrorTracing?
No description provided.