This project demonstrates how to enable observability and tracing for AI agents and conversational workflows using Azure AI Foundry, OpenTelemetry, and Azure Monitor. It includes example scripts for integrating telemetry into AI agent services and LangGraph-based conversational agents.
- OpenTelemetry Tracing: Collects and exports traces for AI agent interactions.
- Azure Monitor Integration: Sends telemetry data to Azure Application Insights for monitoring and analysis.
- LangGraph Example: Shows how to build a conversational agent with LangGraph, Azure OpenAI, and integrated observability.
- AI Agent Service Example: Demonstrates tracing and observability for a financial education agent.
-
tracing-example-ai-agent-service.py
:
Demonstrates tracing for an AI agent that provides financial education, including agent creation, conversation management, and telemetry export. -
tracing-example-langgraph.py
:
Shows how to build a conversational agent using LangGraph and Azure OpenAI, with all interactions traced and exported to Azure Monitor.
- Python 3.8+
- Azure SDK for Python:
azure-ai-projects
azure-identity
azure-monitor-opentelemetry
opentelemetry
langgraph
langchain_openai
langchain_community
python-dotenv
Install dependencies with:
pip install -r requirements.txt
For AI Agent tracing with Azure AI Agent service in tracing-example-ai-agent-service.py, you need to -
pip install azure-ai-projects==1.0.0b11
-
Environment Variables:
Copy.env-sample
to.env
and fill in the required Azure credentials and endpoints. -
Azure Resources:
- Ensure you have an Azure AI Foundry project with Application Insights enabled.
- Set up Azure OpenAI and other required services.
-
Run Examples:
Execute the example scripts to see observability in action:python tracing-example-ai-agent-service.py python tracing-example-langgraph.py
This project is for demonstration and educational purposes. The included agents provide general information and always include disclaimers where appropriate.