Debug
Use OpenTelemetry instrumentation for debugging
This guide demonstrates how to use the OpenTelemetry instrumentation for debugging. You’ll learn how to enable instrumentation for ACP communication and the custom agent and how to debug data in the OTLP exporters UI.
Motivation
Debugging modern agentic systems and distributed applications can be tricky, especially when you’re dealing with asynchronous workflows, multiple services, and custom logic layers. OpenTelemetry offers a powerful way to trace and understand these systems in real time. By instrumenting both the ACP communication and agent logic, you gain visibility into how data flows, how decisions are made, and where bottlenecks or errors might occur.
This guide is here to help you set up this instrumentation in practice, showing you how to capture and visualize traces using both general-purpose (Jaeger) and AI-focused (Phoenix) OTLP exporters—so you can debug effectively and with confidence.
What is OTLP exporter
In the context of the OpenTelemetry framework, an OTLP exporter acts as both a backend for data collection and a UI for data visualisation. In this tutorial I will describe 2 OTLP exporters Jaeger and Arize Phoenix.
Jaeger
Use for general purpose
Jaeger is Open source, distributed tracing platform OpenTelemetry data visualization. This tool has base UI and it’s not so fancy as Phoenix, but you can see data from all spans and it’s not limited to agent observability.
Run Jaeger
open instance on
http://localhost:16686/search
in the browser.
Phoenix
AI-focused debugging
Phoenix is an open-source AI observability platform designed for experimentation, evaluation, and troubleshooting by Arize AI company that has its own semantic conventions that all supported frameworks must follow. The advantage is defining more custom attributes for trace’s well-visualization and evaluation.
Use Phoenix when your primary focus is agent observability.
The main disadvantage is that the platform truncates the custom data attributes that are not correctly parsed. You cannot debug the ACP, fastify server, etc…
By default, Phoenix runs on port 6006. You can either map this to the standard OTLP port 4318 or update the
OTEL_EXPORTER_OTLP_ENDPOINT
to point to the correct port.
Run Phoenix
open instance on
http://localhost:4318/projects
in the browser.
Base ACP communication example
In this example, we will focus only on the communication between the server and client.
Let’s use the Jaeger
for this example.
Be sure you have a running Jaeger instance before you start! See the Run Jaeger section for more details.
Init the repository
This guide uses uv
. See the uv
primer for more details.
Define Agent / Client
Define agent.py
, telemetry.py
and client.py
files:
You can see we turned on the instrumentation via configure_telemetry=True
in the server.run
function in the agent.py file.
Run the server
Run the client
Debug it
Open http://localhost:16686/search
in your browser, select acp-client in the Service
input on the left menu and click on the Find Traces
button.
You should see your first trace. When you click on the trace, you should see the following details:
Framework Integrations
In this section, I will show you how to set up observability for the agentic systems and how to use the OpenInference instrumentation to cover a lot of existing frameworks on the market.
Let’s use the Phoenix
for these examples.
LangGraph Agent
Be sure you have a running Phoenix instance before you start! See the Run Phoenix section for more details.
Init repository
Define Agent / Client
Define agent.py
, telemetry.py
and client.py
files:
Don’t miss the LangChainInstrumentor().instrument()
line when we turn on the LangChain instrumentation (LangGraph included) in the agent.py file.
Run the server
Run the client
Debug it
Open http://localhost:4318/projects
in your browser and choose the default project.
You should see your first trace called session
. When you click on the trace, you should see these details: