Come join our live training webinar every other Wednesday at 11am PST and hear LogicMonitor experts explain best practices and answer common questions. We understand these are uncertain times, and we are here to help!
There are two ways to approach OpenTelemetry-facilitated instrumentation for a Java application:
With auto-instrumentation, you’ll attach a JAR to your application that injects code to capture trace data from supported libraries and frameworks. This is by far the easiest and fastest way to get started, but gives you less control over how trace data is emitted (for example, the operation names are automatically set). For applications that use libraries and frameworks outside of what is supported by the auto-instrumentation, you will need to manually instrument. With manual instrumentation, you’ll write code in your application that uses the OpenTelemetry SDK to capture and emit the trace data. In the end, you may need a combination of both manual and auto-instrumentation.
You may need to manually instrument some or all of your Java applications if (1) you are using libraries that are not supported for the OpenTelemetry auto-instrumentation; or (2) you want to customize how operations are generated by auto-instrumentation (such as how operations are named).
The best source of instruction for manually instrumenting your Java application is the official OpenTelemetry documentation. This documentation will guide you through instantiating the OpenTelemetry SDK and a tracer, creating traces, and enriching them.
In This Article