I attended for the first time at JavaZone this year. This was an amazing experience to meet some new folks and I learned a lot through the various conferences and workshops I could attend during those three days.
Discovering meta-agent
Among the things I discovered, there was meta-agent presented by Marco Sussitz during his talk: Demystifying OpenTelemetry: Java Agents Unveiled. This is a tool created by Johannes Bechberger and Mikaël Francoeur which was originally designed to investigate the generated bytecode from Spring proxies and Mockito mocks. Basically, you will have a hard time trying to debug (byte)code that is generated at runtime, whose source does not exist. Such proxies and mocks implementations only live in JVM memory so this tool provides a way to look at class file content that is loaded by the JVM. Internally, it works as a JVM agent that hooks into the Instrumentation API to decorate the other instrumenters and record their changes introduced through the ClassFileModifiers.
When it looks too beautiful…
While my job at Datadog involved a good amount of bytecode injection work, I was a bit disappointed to discover that meta-agent did not work with The Datadog Java Client Library (aka dd-trace-java) nor the OpenTelemetry Java agent. During Marco’s presentation, he showed that only a limited amount of class transformation was captured by the meta-agent. But unlike him, I did not want all the troubles of forking and patching the JVM to dump transformed classes to troubleshoot the bytecode our agent changes.





