-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Use the default metricsFactory if not provided #739
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 the default metricsFactory if not provided #739
Conversation
A test case was added, but an error is returned when
|
8bf18e5
to
c06df3f
Compare
The test is working now (had to re-create the |
looks like travis fails due to formatting, run |
c06df3f
to
efb5882
Compare
All green now! 👍 |
@@ -51,6 +94,10 @@ func TestAgentStartStop(t *testing.T) { | |||
HTTPServer: HTTPServerConfiguration{ | |||
HostPort: ":0", | |||
}, | |||
Metrics: jmetrics.Builder{ | |||
Backend: "prometheus", | |||
HTTPRoute: "/metrics", |
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.
I had to place the default values here as they are usually initialized using Viper
cmd/agent/app/agent_test.go
Outdated
} | ||
|
||
func withRunningAgent(t *testing.T, testcase func(string, chan error)) { | ||
withNewPrometheusRegistry() |
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: resetDefaultPrometheusRegistry
Signed-off-by: Louis-Etienne Dorval <louis-etienne.dorval@ticketmaster.com>
efb5882
to
e58bfe5
Compare
Thanks for the fix @ledor473 |
This will fix #738
I'm looking at adding a test to ensure the functionality will stay over time. I'll update the PR