---
title: "temporal-opentelemetry: Native OpenTelemetry Usage"
description: "Add native OpenTelemetry integration for Temporal Java SDK"
canonical: "https://temporal.io/code-exchange/native-opentelemetry-usage.md"
source: "https://temporal.io/code-exchange/native-opentelemetry-usage"
published: "2025-11-18"
authors:
  - "Andres Felipe Benavides Montoya"
languages:
  - "Java"
tags:
  - "OpenTelemetry"
reviewed_by_temporal: false
community_contribution: true
---

# temporal-opentelemetry: Native OpenTelemetry Usage

Add native OpenTelemetry integration for Temporal Java SDK

- [View repo](https://github.com/AndresBena19/sdk-java/tree/amontoya-otel-native-support/temporal-opentelemetry)

### Overview

Currently, Temporal Java SDK users who need OpenTelemetry integration must rely on the temporal-opentracing module with an OpenTelemetry compatibility layer (https://github.com/open-telemetry/opentelemetry-java/tree/main/opentracing-shim).

  There are documented considerations in the https://opentelemetry.io/docs/specs/otel/compatibility/opentracing/#when-to-use, particularly with baggage propagation, as it specifically warns:  _"The related Baggage may not be properly propagated if the OpenTelemetry API is consumed along the OpenTracing Shim."_

  The documentation explicitly recommends against using the shim when:  _"consuming both OpenTracing Shim and OpenTelemetry API in the same codebase,"_ which is precisely the scenario I am facing while trying to use [OpenTelemetry Baggage Span Processor.](https://github.com/open-telemetry/opentelemetry-java-contrib/tree/main/baggage-processor)

  As OpenTracing is in maintenance mode and OpenTelemetry is the industry standard (https://www.cncf.io/projects/opentelemetry/), a native implementation would provide the recommended path forward for reliable, feature-complete tracing in Temporal workflows.

###  Solution

 I would like to contribute with a new temporal-opentelemetry module that provides native OpenTelemetry integration for the Temporal Java SDK. This module:

  1. Offers direct OpenTelemetry integration without requiring compatibility shims
  2. Provides full W3C TraceContext compatibility
  4. Integrates seamlessly with the broader OpenTelemetry ecosystem

  The module will be similar to opentracing but using native opentelemetry API components

###  Alternatives
  1. Continuing to use temporal-opentracing with the OpenTelemetry compatibility layer, but add new SpanProcessor to capture the baggage data but not using the recommend approach
 2. Create custom temporal interceptors in order to create out own traces and span using open-telemetry directly  

###   Additional context
This implementation parallels the structure of the `temporal-opentracing` module, making it easy for users to migrate to use native opentelemetry instrumentation without configure a shim/bridge. It provides a cleaner, more efficient way to integrate Temporal with OpenTelemetry observability stacks.
