Hidden Secrets about Instrumenting JVMs for OpenTelemetry

A presentation at JNation 2021 by Ricardo Ferreira

OpenTelemetry is the new-kid-on-the-block in API to instrument distributed applications to send telemetry data (logs, metrics, and traces) to backends for visualization and monitoring. It was created to be a de-facto replacement to standards such as OpenTracing and OpenCensus.

The support for Java in OpenTelemetry is generous. It supports both automatic and manual instrumentation. With automatic instrumentation, developers can have known libraries and frameworks instrumented without writing a single code line. Manual support also allows them to decide which parts of the code need instrumentation, and there is a rich set of APIs available to use.

This talk will open the pandora box for both options. It will reveal which knobs are available to use that make a tremendous difference in how the applications report telemetry data — both in terms of performance and details. Knowing these hidden secrets will grant developers fine control over their applications and how observability stacks show them to the world.



The following code examples from the presentation can be tried out live.

  • OpenTelemetry in Java with Elastic APM

    This project showcase how to instrument a microservice written in Java using OpenTelemetry, to produce telemetry data (traces and metrics) to Elastic APM.


The following resources were mentioned during the presentation or are useful additional information.

Buzz and feedback

Here’s what was said about this presentation on social media.