How do we instrument application which uses LMAX Disruptor.
I have jms components which are now instrumented with jms plugin but the consumer uses LMAX Disruptor for further processing and then forward down to next component using JMX.
We can think of having instrumentation plugin for LMAX Disruptor but as the agent uses Disruptor internally we might end up instrumenting agent itself.
This sounds like an interesting idea!
Since we shade the library classes we use as dependencies, all Disruptor classes will be shaded as well and loaded in runtime under the package co.elastic.apm.agent.shaded.lmax, so as long as you match for the fully qualified class names, there shouldn't be a clash.
Would you like to contribute this as an agent plugin?
For anything you want to use as String (eg identifying whether a class has a specific name), you can just split the String setting into two concatenated Strings. Since the shading happens on source code, it won't be able to recognize that. You can see an example with our slf4j MDC plugin.
For anything you want to use as a real type, I would investigate what can be achieved with the Maven shade plugin filtering configurations, then change the current pom to shade only the specific classes agent directly depends on or specifically avoid shading the classes you instrument (the latter is preferable).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.