{"action":"opened","issue":{"url":"https://api.github.com/repos/palantir/tritium/issues/18","repository_url":"https://api.github.com/repos/palantir/tritium","labels_url":"https://api.github.com/repos/palantir/tritium/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/palantir/tritium/issues/18/comments","events_url":"https://api.github.com/repos/palantir/tritium/issues/18/events","html_url":"https://github.com/palantir/tritium/issues/18","id":228122548,"number":18,"title":"Allow instrumentation of injected services","user":{"login":"schlosna","id":54594,"avatar_url":"https://avatars3.githubusercontent.com/u/54594?v=3","gravatar_id":"","url":"https://api.github.com/users/schlosna","html_url":"https://github.com/schlosna","followers_url":"https://api.github.com/users/schlosna/followers","following_url":"https://api.github.com/users/schlosna/following{/other_user}","gists_url":"https://api.github.com/users/schlosna/gists{/gist_id}","starred_url":"https://api.github.com/users/schlosna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schlosna/subscriptions","organizations_url":"https://api.github.com/users/schlosna/orgs","repos_url":"https://api.github.com/users/schlosna/repos","events_url":"https://api.github.com/users/schlosna/events{/privacy}","received_events_url":"https://api.github.com/users/schlosna/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-05-11T21:11:38Z","updated_at":"2017-05-11T21:11:38Z","closed_at":null,"body":"Suppose I'm setting up my services to be automatically injected with dependencies by doing something like this:\r\n\r\n``` java\r\nenvironment.jersey().register(new AbstractBinder() {\r\n  @Override\r\n  protected void configure() {\r\n    bind(ServiceImplementation.class).to(ServiceInterface.class);\r\n  }\r\n});\r\n```\r\n\r\nIf I want to instrument my `ServiceImplementation` class, I need to create an actual instance and wrap it into the Tritium proxy. Instead, I want HK2 (or Guice, or whatever) to do all instantiation for me, so that I can take advantage of automatic DI. \r\n\r\nCan Tritium support a mode where I simply annotate either my entire class or a specific method as `@Tritium` or `@Instrumented` or something, and Tritium provides a `MethodInterceptor` that does metrics + invocation logging? (This has a decent example of what this could look like: https://hk2.java.net/2.3.0/aop-example.html)\r\n"}}
{"actor":{"display_login":"schlosna"}}