-
Notifications
You must be signed in to change notification settings - Fork 288
feat: extend configuration to support custom randomNumber func #555
feat: extend configuration to support custom randomNumber func #555
Conversation
Codecov Report
@@ Coverage Diff @@
## master #555 +/- ##
==========================================
+ Coverage 88.59% 88.61% +0.01%
==========================================
Files 61 61
Lines 3307 3311 +4
==========================================
+ Hits 2930 2934 +4
Misses 251 251
Partials 126 126
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.
Generally looks fine, but let's add some tests to cover the new functionality.
config/options.go
Outdated
@@ -147,6 +148,13 @@ func Extractor(format interface{}, extractor jaeger.Extractor) Option { | |||
} | |||
} | |||
|
|||
// WithRandonNunmber set the Tracer random number func | |||
func WithRandonNunmber(f func() uint64) Option { |
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.
nit: WithRandomNumber
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.
Emmmmmmmm, my mistake.
d1cab53
to
85164cb
Compare
Please make sure all commits are signed. Might be easier to squash them into one. See CONTRIBUTING.md. |
Signed-off-by: guanwenbo <[email protected]>
Signed-off-by: guanwenbo <[email protected]>
Signed-off-by: guanwenbo <[email protected]>
Signed-off-by: guanwenbo <[email protected]>
821b841
to
71e806a
Compare
Signed-off-by: guanwenbo <[email protected]>
Signed-off-by: guanwenbo <[email protected]>
Signed-off-by: guanwenbo <[email protected]>
Signed-off-by: guanwenbo <[email protected]>
…enbogit/jaeger-client-go into feature/with_random_number
Signed-off-by: guanwenbo <[email protected]>
config/config_test.go
Outdated
} | ||
randomNum := func() uint64 { return traceID } | ||
tracer, closer, err := cfg.NewTracer(WithRandomNumber(randomNum)) | ||
span:=tracer.StartSpan("test-span") |
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.
needs make fmt
config/config_test.go
Outdated
spanCtx := span.Context().(jaeger.SpanContext) | ||
|
||
assert.NoError(t, err) | ||
assert.Equal(t, spanCtx.TraceID().Low ,traceID) |
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.
nit: wrong argument order, expected value (traceID) goes first
Signed-off-by: guanwenbo <[email protected]>
6078ed8
to
379fcac
Compare
Signed-off-by: guanwenbo <[email protected]>
379fcac
to
4e06150
Compare
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!
Which problem is this PR solving?
Short description of the changes