---
title: "OpenTelemetry Support"
description: "Using OpenTelemetry with Sentry."
url: https://docs.sentry.io/platforms/java/guides/log4j2/opentelemetry/
---

# OpenTelemetry Support | Sentry for Log4j 2.x

[OpenTelemetry](https://opentelemetry.io/) enhances Sentry by providing support for more frameworks and libraries that:

* Let you create more spans, for example around requests.
* Provide `Context` propagation that also takes care of propagating Sentry `Scopes`, ensuring things like tags and other information end up on the correct event.
* Extract tracing information from incoming requests and consumed messages.
* Inject tracing information into outgoing requests and produced messages.

Please take a look at the [OpenTelemetry GitHub repository](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation) for a full list of available instrumentations.

In some cases there is instrumentation available by both OpenTelemetry and Sentry. In this case we automatically configure the Sentry instrumentation to not create spans and instead let OpenTelemetry take over.

You may use OpenTelemetry API or Sentry API to manually instrument your application. Both will end up in Sentry. If you are already using Sentry API, you can keep using it when switching over to our OpenTelemetry integration. If you already have OpenTelemetry instrumentation in place you can have the resulting spans sent to Sentry.

* #### [OpenTelemetry Setup](https://docs.sentry.io/platforms/java/guides/log4j2/opentelemetry/setup.md)

  Setting up Sentry with OpenTelemetry.

* #### [OpenTelemetry Usage](https://docs.sentry.io/platforms/java/guides/log4j2/opentelemetry/usage.md)

  Using OpenTelemetry with Sentry.

## Pages in this section

- [OpenTelemetry Setup](https://docs.sentry.io/platforms/java/guides/log4j2/opentelemetry/setup.md)
- [OpenTelemetry Usage](https://docs.sentry.io/platforms/java/guides/log4j2/opentelemetry/usage.md)
