{"action":"created","issue":{"url":"https://api.github.com/repos/dropwizard/dropwizard/issues/1258","labels_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/1258/labels{/name}","comments_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/1258/comments","events_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/1258/events","html_url":"https://github.com/dropwizard/dropwizard/issues/1258","id":108024713,"number":1258,"title":"Metrics registry duplicate metric issue","user":{"login":"gautampriya","id":6620787,"avatar_url":"https://avatars.githubusercontent.com/u/6620787?v=3","gravatar_id":"","url":"https://api.github.com/users/gautampriya","html_url":"https://github.com/gautampriya","followers_url":"https://api.github.com/users/gautampriya/followers","following_url":"https://api.github.com/users/gautampriya/following{/other_user}","gists_url":"https://api.github.com/users/gautampriya/gists{/gist_id}","starred_url":"https://api.github.com/users/gautampriya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gautampriya/subscriptions","organizations_url":"https://api.github.com/users/gautampriya/orgs","repos_url":"https://api.github.com/users/gautampriya/repos","events_url":"https://api.github.com/users/gautampriya/events{/privacy}","received_events_url":"https://api.github.com/users/gautampriya/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-23T23:03:22Z","updated_at":"2015-11-25T18:36:12Z","closed_at":null,"body":"Referencing https://github.com/dropwizard/dropwizard/issues/832\r\n\r\nThis above issue still exists. I am struggling with it right now. While it is true that one can provide unique names, however, if I want to use a fresh client each time I need a new one in the same class/test class/(in general in the same context), then this issue is limiting my approaches. What are the reasons that the behaviour was changed in 0.8.0 in a way that introduces this bug/limitation. Can the metrics registry be cleared when a client is closed? Is there a plan to fix this issue? What is the work around for now short of supplying unique names.\r\n\r\nI am using dropwizard-client 0.8.2\r\n\r\njava.lang.IllegalArgumentException: A metric named org.apache.http.conn.HttpClientConnectionManager.cs.available-connections already exists\r\nat com.codahale.metrics.MetricRegistry.register(MetricRegistry.java:91)\r\nat com.codahale.metrics.httpclient.InstrumentedHttpClientConnectionManager.(InstrumentedHttpClientConnectionManager.java:63)\r\nat io.dropwizard.client.HttpClientBuilder.createConnectionManager(HttpClientBuilder.java:287)\r\nat io.dropwizard.client.HttpClientBuilder.buildWithDefaultRequestConfiguration(HttpClientBuilder.java:182)\r\nat io.dropwizard.client.JerseyClientBuilder.buildConfig(JerseyClientBuilder.java:347)\r\nat io.dropwizard.client.JerseyClientBuilder.build(JerseyClientBuilder.java:315)\r\nat io.dropwizard.client.JerseyClientBuilder.build(JerseyClientBuilder.java:309)"},"comment":{"url":"https://api.github.com/repos/dropwizard/dropwizard/issues/comments/159696425","html_url":"https://github.com/dropwizard/dropwizard/issues/1258#issuecomment-159696425","issue_url":"https://api.github.com/repos/dropwizard/dropwizard/issues/1258","id":159696425,"user":{"login":"arteam","id":1717632,"avatar_url":"https://avatars.githubusercontent.com/u/1717632?v=3","gravatar_id":"","url":"https://api.github.com/users/arteam","html_url":"https://github.com/arteam","followers_url":"https://api.github.com/users/arteam/followers","following_url":"https://api.github.com/users/arteam/following{/other_user}","gists_url":"https://api.github.com/users/arteam/gists{/gist_id}","starred_url":"https://api.github.com/users/arteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arteam/subscriptions","organizations_url":"https://api.github.com/users/arteam/orgs","repos_url":"https://api.github.com/users/arteam/repos","events_url":"https://api.github.com/users/arteam/events{/privacy}","received_events_url":"https://api.github.com/users/arteam/received_events","type":"User","site_admin":false},"created_at":"2015-11-25T18:36:12Z","updated_at":"2015-11-25T18:36:12Z","body":"This is probably fixed by #1232. Please, check if the issue exists in Dropwizard 0.8.5 or 0.9.1, "}}