One of the most interesting properties of the JVM is the agent mechanism.
I’ve most recently been using the agent mechanism to auto-instrument JVM applications via the OpenTelemetry agent, but there are other agents that see use, including Elastic’s APM agent and Prometheus’ JMX Exporter.
It feels like magic - just add this JAR as a command-line argument to your JVM, and the JVM seems to do things on the agent author’s behalf. I love magic, when it works - it makes my life and my job easier.