Implementing a CDI interceptor is not that complicated. Thus, you may want to have your own if you do not find a library matching your expectations. It can have two kinds of direct impact on the way you use monitoring:
- Be able to control the counters you use depending on the case you are in. This includes success/failure handling, but it can also be tenant-related (if your application is handling multiple tenants). This can be very important if you do not use the exact same system as the tenant (one can have a slower database than the other, for instance).
- Be able to configure the monitored beans. Yes, with CDI you can also avoid having to decorate the beans you want to monitor and ...