From 1a0eb0b68eb0065685fff607b5a02774feb0c3ad Mon Sep 17 00:00:00 2001 From: Hype Eater <10122729+hype-eater@users.noreply.github.com> Date: Mon, 8 Sep 2025 17:54:15 -0700 Subject: [PATCH] observability adds basic openinference otel tracing --- README.md | 8 +++++++- main.py | 5 +++++ requirements.txt | 8 +++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 84c670e..0befa73 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,13 @@ A powerful yet simple multi-agent system using LangChain and LangGraph. Define e # Edit .env with your API keys ``` -3. **Run the system**: +3. **Run Phoenix (observability)** + ```bash + phoenix serve & + ``` + View will be able to view traces at http://localhost:6006/ + +4. **Run the system**: ```bash # Interactive mode python main.py diff --git a/main.py b/main.py index 8ee7034..492ea6a 100755 --- a/main.py +++ b/main.py @@ -11,6 +11,11 @@ from datetime import datetime from typing import Dict, Any, List, Optional, Union from pathlib import Path +from openinference.instrumentation.langchain import LangChainInstrumentor +from phoenix.otel import register + +tracer_provider = register() +LangChainInstrumentor().instrument(tracer_provider=tracer_provider) # Load environment variables from dotenv import load_dotenv diff --git a/requirements.txt b/requirements.txt index 05b571d..e17300a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,4 +8,10 @@ pyyaml>=6.0 python-dotenv>=1.0.0 # For Arcade tools (optional) -arcadepy>=1.0.0 \ No newline at end of file +arcadepy>=1.0.0 + +# Phoenix/OpenInference Observability +arize-phoenix>=11.31.0 +openinference-instrumentation-langchain>=0.1.51 +opentelemetry-sdk>=1.28.2 +opentelemetry-exporter-otlp>=1.36.0