Skip to content
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 instrumentation of injected services #18

Open
schlosna opened this issue May 11, 2017 · 0 comments
Open

Allow instrumentation of injected services #18

schlosna opened this issue May 11, 2017 · 0 comments

Comments

@schlosna
Copy link
Contributor

Suppose I'm setting up my services to be automatically injected with dependencies by doing something like this:

environment.jersey().register(new AbstractBinder() {
  @Override
  protected void configure() {
    bind(ServiceImplementation.class).to(ServiceInterface.class);
  }
});

If 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.

Can 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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant