-
Notifications
You must be signed in to change notification settings - Fork 92
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
Added possibility to customize span operationName #77
Conversation
Extended TracerConfig with OperationNameFunc which allows to override default operation name during span creation. If there is no OperationNameFunc provided then fallback will be used which covers most of the use-cases.
Codecov Report
@@ Coverage Diff @@
## master #77 +/- ##
==========================================
+ Coverage 59.43% 59.79% +0.35%
==========================================
Files 8 8
Lines 673 679 +6
==========================================
+ Hits 400 406 +6
Misses 252 252
Partials 21 21
Continue to review full report at Codecov.
|
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.
Other than this one remark everything else seems ok!
jaegertracing/jaegertracing.go
Outdated
@@ -62,6 +62,9 @@ type ( | |||
// http body limit size (in bytes) | |||
// NOTE: don't specify values larger than 60000 as jaeger can't handle values in span.LogKV larger than 60000 bytes | |||
LimitSize int | |||
|
|||
// OperationNameFunc composes operation name based on context. Can be used to override default naming | |||
OperationNameFunc func(ctx echo.Context) string |
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.
Please rename that parameter from ctx
to c
. Named parameters are handy when your IDE (for example GoLand by Jetbrains) does autocompletion and helps to autofill names. By convention echo.Context
is usually named as c
.
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.
Done
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.
lgtm
Extended
TracerConfig
withOperationNameFunc
property which allows to override default operation name during span creation.If there is no
OperationNameFunc
provided then fallback will be used which covers most of the use-cases.