Skip to content

Allow instrumentation of injected services #18

@schlosna

Description

@schlosna

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions