{"action":"created","issue":{"url":"https://api.github.com/repos/Netflix/ribbon/issues/191","labels_url":"https://api.github.com/repos/Netflix/ribbon/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/Netflix/ribbon/issues/191/comments","events_url":"https://api.github.com/repos/Netflix/ribbon/issues/191/events","html_url":"https://github.com/Netflix/ribbon/issues/191","id":54467028,"number":191,"title":"Ribbon-Servo : Registering a ServerStats instance failed","user":{"login":"RaphC","id":1260364,"avatar_url":"https://avatars.githubusercontent.com/u/1260364?v=3","gravatar_id":"","url":"https://api.github.com/users/RaphC","html_url":"https://github.com/RaphC","followers_url":"https://api.github.com/users/RaphC/followers","following_url":"https://api.github.com/users/RaphC/following{/other_user}","gists_url":"https://api.github.com/users/RaphC/gists{/gist_id}","starred_url":"https://api.github.com/users/RaphC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaphC/subscriptions","organizations_url":"https://api.github.com/users/RaphC/orgs","repos_url":"https://api.github.com/users/RaphC/repos","events_url":"https://api.github.com/users/RaphC/events{/privacy}","received_events_url":"https://api.github.com/users/RaphC/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-15T16:07:02Z","updated_at":"2015-01-15T16:54:11Z","closed_at":null,"body":"Hi,\r\n\r\nI'm trying to publish ServerStats metrix to JMX by using Servo library. Unfortunately when I registrer my instance like this. It fails :\r\n\r\nNB : I don't use http-client ribbon component but a RestClient provided Spring and I manually managed the stats recording.\r\n \r\n<pre><code>\r\n\r\n.....\r\n\t  LoadBalancerContext lbc = ...;\r\n          // chosenServer is a com.netflix.loadbalancer.Server\r\n\t  final ServerStats stats = lbc.getServerStats(reic.getChosenServer());\r\n\t  Monitors.registerObject(\"LB_Server_\"+reic.getChosenServer().getHostPort(), stats);\r\n\t  \r\n\t  URI targetUri = ....;\r\n\t  \r\n\t  // start stopWatch\r\n\t  final Stopwatch tracer = lbc.getExecuteTracer().start();\r\n\t  \r\n\t  T response = null;\r\n\t  Exception e = null;\r\n\t  try {\r\n\t\t  response = super.doExecute(targetUri, method, requestCallback, responseExtractor);\r\n\t  } catch(RestClientException rce){\r\n\t\tthrow rce;\r\n\t  } finally {\r\n\t\t  // arret de la mesure\r\n\t\t  tracer.stop();\r\n\t      lbc.noteRequestCompletion(stats, response, e, tracer.getDuration(TimeUnit.MILLISECONDS), lbc.getRetryHandler()); \r\n\t  }\r\n</code></pre>\r\n\r\nHere is the stack trace \r\n\r\n<pre><code>\r\njava.lang.IllegalArgumentException: annotation of type GAUGE can only be used with numeric values, CircuitBreakerTripped in class com.netflix.loadbalancer.ServerStats is applied to a field or method of type boolean\r\n\tat com.netflix.servo.monitor.Monitors.checkType(Monitors.java:348)\r\n\tat com.netflix.servo.monitor.Monitors.addAnnotatedFields(Monitors.java:303)\r\n\tat com.netflix.servo.monitor.Monitors.addMonitors(Monitors.java:231)\r\n\tat com.netflix.servo.monitor.Monitors.newObjectMonitor(Monitors.java:146)\r\n\tat com.netflix.servo.monitor.Monitors.registerObject(Monitors.java:207)\r\n\tat com.bouygtel.inthd.common.http.RestTemplateLoadBalancerAwareClient.monitorOnExecute(RestTemplateLoadBalancerAwareClient.java:80)\r\n\tat com.bouygtel.inthd.common.http.RestTemplateLoadBalancerAwareClient.doExecute(RestTemplateLoadBalancerAwareClient.java:64)\r\n\tat org.springframework.web.client.RestTemplate.execute(RestTemplate.java:529)\r\n\tat org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:329)\r\n\tat com.bouygtel.inthd.common.http.loadbalancer.RestTemplateLoadBalancerAwareClientTestCase.doExecuteWithLoadBalancer(RestTemplateLoadBalancerAwareClientTestCase.java:95)\r\n</code></pre>\r\n\r\nIt seems that the annotated method isCircuitBreakerTripped() doesn't follow Servo requirement.\r\n<pre><code>\r\n    @Monitor(name=\"CircuitBreakerTripped\", type = DataSourceType.GAUGE)    \r\n    public boolean isCircuitBreakerTripped() {\r\n        return isCircuitBreakerTripped(System.currentTimeMillis());\r\n    }\r\n</code></pre>\r\n\r\nIs this a bug ?\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/Netflix/ribbon/issues/comments/70118188","html_url":"https://github.com/Netflix/ribbon/issues/191#issuecomment-70118188","issue_url":"https://api.github.com/repos/Netflix/ribbon/issues/191","id":70118188,"user":{"login":"brharrington","id":1289028,"avatar_url":"https://avatars.githubusercontent.com/u/1289028?v=3","gravatar_id":"","url":"https://api.github.com/users/brharrington","html_url":"https://github.com/brharrington","followers_url":"https://api.github.com/users/brharrington/followers","following_url":"https://api.github.com/users/brharrington/following{/other_user}","gists_url":"https://api.github.com/users/brharrington/gists{/gist_id}","starred_url":"https://api.github.com/users/brharrington/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brharrington/subscriptions","organizations_url":"https://api.github.com/users/brharrington/orgs","repos_url":"https://api.github.com/users/brharrington/repos","events_url":"https://api.github.com/users/brharrington/events{/privacy}","received_events_url":"https://api.github.com/users/brharrington/received_events","type":"User","site_admin":false},"created_at":"2015-01-15T16:54:11Z","updated_at":"2015-01-15T16:54:11Z","body":"It is a bug in the usage of servo. Non-numeric values can be exposed with the INFORMATIONAL type.  "}}