-
Notifications
You must be signed in to change notification settings - Fork 35
Add adapters for go-kit metrics and a factory for expvar #10
Conversation
glide.yaml
Outdated
import: | ||
- package: github.com/codahale/hdrhistogram | ||
- package: github.com/go-kit/kit | ||
subpackages: |
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.
it generated this without any subpackages?
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.
sorry, I tried to add them manually, but glide complained. Removed.
metrics/go-kit/expvar/factory.go
Outdated
return f.scope + "_" + name | ||
} | ||
|
||
func (f factory) Counter(name string, tags map[string]string) metrics.Counter { |
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.
does go-kit metrics not have a way to deal with tags?
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.
oops, you're correct, I got focused on expvar implementation that does not support tags
metrics/go-kit/expvar/factory.go
Outdated
return xkit.NewGauge(kit.NewGauge(f.subScope(name))) | ||
} | ||
|
||
// Namespace is a no-op for expvar, since i |
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.
eh?
1 similar 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.
LGTM
This implements the pattern I was asking for in go-kit/kit#378, simplified for our needs.