-
Notifications
You must be signed in to change notification settings - Fork 35
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
Allow overriding scope and tags separator #20
Conversation
Prometheus does not allow '-' or '.' in metric names.
Defaults to expvar. Prometheus metrics currently don't work because it does not allow dots in the names (jaegertracing/jaeger-lib#20) and requires pre-declaring all tag keys, which is not supported by the Jaeger's metrics API.
metrics/go-kit/factory.go
Outdated
@@ -90,6 +111,7 @@ func (f *factory) nameAndTagsList(nom string, tags map[string]string) (name stri | |||
|
|||
func (f *factory) Counter(name string, tags map[string]string) metrics.Counter { | |||
name, tagsList := f.nameAndTagsList(name, tags) | |||
println(name) |
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.
needed?
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.
nope
hist.Observe(10.5) | ||
m := findMetric(t, "namespace_subsystem_gokit_prom_hist") | ||
require.NotNil(t, m) | ||
assert.Equal(t, 10.5, m[0].GetHistogram().GetSampleSum()) | ||
} | ||
|
||
func TestWrapper(t *testing.T) { | ||
f := NewFactory("", "", nil) | ||
wf := xkit.Wrap("foo", f, xkit.ScopeSeparator(":")) |
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 looks like whoever uses prometheus has to remember to add the scope and tags separator FactoryOption to xkit because it currently defaults to '.' and if they forget everything blows up? Scary.
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's a good point. I think we should design this differently. In practice nobody cares that prometheus factory is creates via xkit.Wrap, so I think a better design would be
metrics/
api files
go-kit/
the wrapper thing
prometheus/
something that uses go-kit wrapper but actually returns the real metrics.Factory
this way the constructor for prometheus can specify its separators
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.
a thing for a separate PR, however
Defaults to expvar. Prometheus metrics currently don't work because it does not allow dots in the names (jaegertracing/jaeger-lib#20) and requires pre-declaring all tag keys, which is not supported by the Jaeger's metrics API.
Defaults to expvar. Prometheus metrics currently don't work because it does not allow dots in the names (jaegertracing/jaeger-lib#20) and requires pre-declaring all tag keys, which is not supported by the Jaeger's metrics API.
Defaults to expvar. Prometheus metrics currently don't work because it does not allow dots in the names (jaegertracing/jaeger-lib#20) and requires pre-declaring all tag keys, which is not supported by the Jaeger's metrics API.
Defaults to expvar. Prometheus metrics currently don't work because it does not allow dots in the names (jaegertracing/jaeger-lib#20) and requires pre-declaring all tag keys, which is not supported by the Jaeger's metrics API.
Defaults to expvar. Prometheus metrics currently don't work because it does not allow dots in the names (jaegertracing/jaeger-lib#20) and requires pre-declaring all tag keys, which is not supported by the Jaeger's metrics API.
Prometheus does not allow '-' or '.' in metric names.
Cf: https://github.com/uber/jaeger/issues/273