you likely want a standalone AOP solution like Asp...
# kapt
j
you likely want a standalone AOP solution like AspectJ
j
Ok, am I right in thinking annotation processors can create new classes, but not modify existing ones? so another option could be to generated Timed$class and use that everywhere? but probably an AOP solution is what I'll end up doing
b
annotation processors can create new classes, but not modify existing ones
correct
s
Maybe you could use ByteBuddy, and have a custom Guice binder that wraps all your dependencies with a dynamic proxy version https://bytebuddy.net/#/ Hibernate uses ByteBuddy to generate DB entity proxy subclasses that can lazy load joins with SQL Your dependency classes could get bound to a provider that generates the proxy subclass with hooks that record metrics. You might need open classes + protected methods for this to work tho. You could use the all open plugin and sed s/private fun/protected fun/g.