Instrument Code using OpenTelemetry

Instrument your code using OpenTelementry to emit useful telemetry.

Overview

Instrumentation with OpenTelemetry (OTEL) involves adding code to an application that measures certain aspects of its operation like traces, metrics, and logs. Instrumenting your code with OTEL before ingesting it with an Edge Delta agent is beneficial because it maintains its OTEL structure. In contrast, if you use an Edge Delta agent with a different type of data source, telemetry is captured flat in the body along with resource metadata as detected by the agent.

Instrumentation Options

You can instrument your code with API and SDKs, using a zero-code solution, or with both solutions.

Code-based solutions involve directly utilizing the OpenTelemetry API within your application to produce custom telemetry data. This method is well-suited for gaining detailed insights directly from inside the application. By facilitating precise tracking, these solutions enable monitoring of custom application events and performance metrics. However, they require modifications to the application’s source code, which might not always be feasible or desirable. Additionally, this approach involves a more complex setup and maintenance compared to zero-code solutions, potentially increasing the development time and effort.

On the other hand, zero-code solutions collect telemetry without requiring any changes to the application code. They leverage functionality built into existing libraries or extract information from the broader application environment. This approach is ideal for rapid implementation and situations where altering application code is not an option. Zero-code solutions provide valuable insights regarding application-level interactions, assisting in understanding external dependencies and behaviors. Nevertheless, they may not offer as deep insights as code-based solutions because they lack access to the internal logic and state of the application. They are typically limited to observations of libraries and the application environment, possibly missing some application-specific telemetry.

The following pages provide detail for particular instrumentations:


Code-based Instrumentation of Java using OpenTelemetry

Instrument Java using Code-based OpenTelemetry to emit useful telemetry.

Zero-Code Instrumentation of Java using OpenTelemetry

Instrument Java using Zero-Code OpenTelemetry to emit useful telemetry.

Code-based Instrumentation of Python using OpenTelemetry

Instrument Python using Code-based OpenTelemetry to emit useful telemetry.

Zero-Code Instrumentation of Python using OpenTelemetry

Instrument Python using Zero-Code OpenTelemetry to emit useful telemetry.