you can use spring profiling to enable/disable xray for different environments:
- extend BaseAbstractXRayInterceptor and override xrayEnabledClasses.
- now inject your extended BaseAbstractXRayInterceptor class and annotate your injection with the intended profile.