---
schema_version: "1"
id: 1d8b78f620d3c0d9d10cc497a98ce1c2ceb25d53f4c1c373879e0640bb464281
title: Configuring Distributed Tracing for Managed Flex Gateway
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/gateway/1.12/flex-managed-tracing-config.md
canonical_url: https://docs.mulesoft.com/gateway/1.12/flex-managed-tracing-config
source_site: docs.mulesoft.com
content_type: documentation
content_hash: dae8a0534d935269fa7cf9fa77eb53a4c010c52b760b5de843a79656eed90012
description: MuleSoft Documentation Site
release: "1.12"
latest: false
---
---
product: Omni Gateway
version: 1.12
---

# Configuring Distributed Tracing for Managed Flex Gateway

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

OpenTelemetry provides a unified standard for instrumenting, generating, collecting, and exporting
telemetry data across distributed systems. Flex Gateway supports OpenTelemetry, enabling you to
configure the generation of distributed tracing data for all API traffic managed by the gateway.
This integration delivers deep visibility into API request flows, making it easier to analyze system
behavior, troubleshoot issues, and understand interactions between Flex Gateway APIs and external
services.

Tracing enables you to track Flex Gateway API interactions. When multiple systems and services are
involved, distributed tracing tracks API requests as they flow through distributed environments,
providing a comprehensive view of the API’s execution.

With the Anypoint Monitoring Telemetry Exporter, you can send Flex Gateway trace data to third-party
observability and analytics platforms, including Azure Monitor, Splunk HEC, or any
OpenTelemetry-compliant tool. This capability allows you to leverage end-to-end observability,
correlating API traces with data from other systems to build a comprehensive view of your
environment.

## Before You Begin

To use the OpenTelemetry with Flex Gateway, you must be familiar with:

- Distributed tracing concepts, including traces and spans.

  If you’re new to distributed tracing and OpenTelemetry, we recommend starting with
  [What is OpenTelemetry](https://opentelemetry.io/docs/concepts/what-is-opentelemetry/) and
  [Understanding distributed tracing](https://opentelemetry.io/docs/concepts/observability-primer/#understanding-distributed-tracing).

## Enable and Configure Distributed Tracing for your Managed Flex Gateway

To enable distributed tracing for your Managed Flex Gateway:

1.  From Anypoint Platform, select **Runtime Manager > Flex Gateways**.

2.  Click the Managed Flex Gateway name.

3.  In the navigation menu, click Settings.

4.  Click **Advanced options**.

5.  Click **Tracing**.

6.  Turn on **Distributed tracing**.

7.  Set the **Sampling percentage** to the percentage of transactions that you want to trace.

    - This setting corresponds to the `overall` sampling percentage. The `client` and `random`
      sampling percentages are set to 100% by default, if the sampling percentage is set to a
      non-zero value here.

    - Set the **Sampling percentage** to 0 if you want to specify the sampling percentage only on a
      per-API basis, using the Tracing policy.

8.  Click **Apply Changes**.

## Export traces from the Anypoint Monitoring Telemetry Exporter

To export traces to third party providers using the Anypoint Monitoring Telemetry Exporter, see
[How to export telemetry data to third-party monitoring systems](https://docs.mulesoft.com/monitoring/telemetry-exporter).

## Configure Distributed Tracing For Specific APIs

You can override the globally configured distributed tracing settings by applying the Tracing Policy
to specific APIs. You must first enable and configure distributed tracing for the gateway. You can
then apply this policy to the APIs you want to instrument:

- [Tracing Policy](https://docs.mulesoft.com/gateway/1.12/policies-included-tracing)
