-
Notifications
You must be signed in to change notification settings - Fork 34
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
Use an interface instead of a concrete type #42
Conversation
Signed-off-by: Pavel Nikolov <pavel.nikolov@fairfaxmedia.com.au>
dfe0087
to
cd00b0c
Compare
I noticed that you use version
Please, advise. |
I just read the comments on #33 it seems that this PR can solve this problem. type observer interface {
Observe(v float64)
}
type timer struct {
histogram observer
} This would solve #33, without having to upgrade your dependencies to newer version of Prometheus. Once prometheus |
Signed-off-by: Pavel Nikolov <pavel.nikolov@fairfaxmedia.com.au>
23adc92
to
d55a606
Compare
Codecov Report
@@ Coverage Diff @@
## master #42 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 25 25
Lines 710 710
=====================================
Hits 710 710
Continue to review full report at Codecov.
|
/assign @yurishkuro |
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.
nice solution!
Thanks, @pavelnikolov |
@pavelnikolov a couple questions:
|
|
@pavelnikolov released as 1.5.0 |
I am using the following versions:
If we use a histogram and try to create a new tracer (using
jaeger-client-go
) with metrics, for example:I get the following error:
This PR fixes this issue, while all unit tests still pass. It just replaces a concrete type with a single-method interface.