From d4d5a564481b95571301690d55b1289465ed9014 Mon Sep 17 00:00:00 2001 From: Jim Bennett Date: Thu, 1 Oct 2026 14:00:04 -0700 Subject: [PATCH 1/4] Python: Add Arize AX and Phoenix to the observability samples README Show how to send Agent Framework traces to Arize AX or Phoenix with the OpenInference span processor, alongside the existing Langfuse, Comet Opik, and MLflow examples. Co-Authored-By: Claude Opus 5.5 --- .../samples/02-agents/observability/README.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/python/samples/02-agents/observability/README.md b/python/samples/02-agents/observability/README.md index f456f93dd7d..39f3643b6ab 100644 --- a/python/samples/02-agents/observability/README.md +++ b/python/samples/02-agents/observability/README.md @@ -208,6 +208,34 @@ configure_otel_providers(exporters=[exporter]) enable_sensitive_telemetry() ``` +Or with [Arize AX](https://arize.com/docs/ax/integrations/python-agent-frameworks/microsoft/microsoft-agent-framework) or [Phoenix](https://arize.com/docs/phoenix), which use the [OpenInference](https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-agent-framework) format. Install `openinference-instrumentation-agent-framework>=0.1.12` and `opentelemetry-exporter-otlp-proto-http`. The OpenInference span processor converts Agent Framework's GenAI spans and must run before the exporter, so set up the tracer provider yourself rather than calling `configure_otel_providers()`: + +```python +from opentelemetry import trace +from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter +from opentelemetry.sdk.resources import Resource +from opentelemetry.sdk.trace import TracerProvider +from opentelemetry.sdk.trace.export import BatchSpanProcessor +from openinference.instrumentation.agent_framework import AgentFrameworkToOpenInferenceProcessor +from agent_framework.observability import enable_sensitive_telemetry + +# Arize AX: send to https://otlp.arize.com/v1/traces with your space ID and API key +exporter = OTLPSpanExporter( + endpoint="https://otlp.arize.com/v1/traces", + headers={"arize-space-id": "", "arize-api-key": ""}, +) +# Phoenix: send to your Phoenix instance instead, e.g. a local `phoenix serve` +# exporter = OTLPSpanExporter(endpoint="http://localhost:6006/v1/traces") + +tracer_provider = TracerProvider(resource=Resource.create({"openinference.project.name": ""})) +tracer_provider.add_span_processor(AgentFrameworkToOpenInferenceProcessor()) +tracer_provider.add_span_processor(BatchSpanProcessor(exporter)) +trace.set_tracer_provider(tracer_provider) + +# Optional: opt in to capturing sensitive data +enable_sensitive_telemetry() +``` + **4. Manual setup** For full control, set up providers and exporters yourself. See [advanced_manual_setup_console_output.py](./advanced_manual_setup_console_output.py) for a complete example that sends traces, logs, and metrics to the console. The `create_resource()` helper in `agent_framework.observability` can build a resource with the appropriate service name and version from environment variables (or sensible defaults), although the sample does not use it. @@ -240,6 +268,7 @@ Exporters are **not** installed by default — install only what you need: - **Application Insights**: `azure-monitor-opentelemetry` - **Aspire Dashboard or other OTLP/gRPC backends**: `opentelemetry-exporter-otlp-proto-grpc` - **OTLP over HTTP**: `opentelemetry-exporter-otlp-proto-http` +- **Arize AX or Phoenix**: `openinference-instrumentation-agent-framework` and `opentelemetry-exporter-otlp-proto-http` For other backends, refer to the documentation of the specific exporter. From f60b71d965fd2058b7ffc86d7c6acd59b287680f Mon Sep 17 00:00:00 2001 From: Jim Bennett Date: Thu, 1 Oct 2026 14:13:31 -0700 Subject: [PATCH 2/4] Python: Clarify the Phoenix exporter in the observability README Co-Authored-By: Claude Opus 5.5 --- python/samples/02-agents/observability/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/samples/02-agents/observability/README.md b/python/samples/02-agents/observability/README.md index 39f3643b6ab..c9fccfadc46 100644 --- a/python/samples/02-agents/observability/README.md +++ b/python/samples/02-agents/observability/README.md @@ -208,7 +208,7 @@ configure_otel_providers(exporters=[exporter]) enable_sensitive_telemetry() ``` -Or with [Arize AX](https://arize.com/docs/ax/integrations/python-agent-frameworks/microsoft/microsoft-agent-framework) or [Phoenix](https://arize.com/docs/phoenix), which use the [OpenInference](https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-agent-framework) format. Install `openinference-instrumentation-agent-framework>=0.1.12` and `opentelemetry-exporter-otlp-proto-http`. The OpenInference span processor converts Agent Framework's GenAI spans and must run before the exporter, so set up the tracer provider yourself rather than calling `configure_otel_providers()`: +Or with [Arize AX](https://arize.com/docs/ax/integrations/python-agent-frameworks/microsoft/microsoft-agent-framework) or [Phoenix](https://arize.com/docs/phoenix), which use the [OpenInference](https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-agent-framework) format. Install `openinference-instrumentation-agent-framework>=0.1.12` and `opentelemetry-exporter-otlp-proto-http`. The OpenInference span processor converts Agent Framework's GenAI spans and must run before the exporter, so set up the tracer provider yourself rather than calling `configure_otel_providers()`. The example sends to Arize AX; for Phoenix, use the commented-out exporter instead and point it at your Phoenix endpoint: ```python from opentelemetry import trace @@ -219,12 +219,14 @@ from opentelemetry.sdk.trace.export import BatchSpanProcessor from openinference.instrumentation.agent_framework import AgentFrameworkToOpenInferenceProcessor from agent_framework.observability import enable_sensitive_telemetry -# Arize AX: send to https://otlp.arize.com/v1/traces with your space ID and API key +# Arize AX: authenticate with your space ID and API key exporter = OTLPSpanExporter( endpoint="https://otlp.arize.com/v1/traces", headers={"arize-space-id": "", "arize-api-key": ""}, ) -# Phoenix: send to your Phoenix instance instead, e.g. a local `phoenix serve` + +# Phoenix: use this exporter instead. localhost:6006 is a local `phoenix serve`; +# replace it with your Phoenix endpoint if Phoenix runs elsewhere # exporter = OTLPSpanExporter(endpoint="http://localhost:6006/v1/traces") tracer_provider = TracerProvider(resource=Resource.create({"openinference.project.name": ""})) From 2462a509325ace8901802cb92ba66bb537d647db Mon Sep 17 00:00:00 2001 From: Jim Bennett Date: Wed, 7 Oct 2026 15:24:55 -0700 Subject: [PATCH 3/4] Python: Require the released OpenInference processor fix in the observability README Co-Authored-By: Claude Opus 5.5 --- python/samples/02-agents/observability/README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/python/samples/02-agents/observability/README.md b/python/samples/02-agents/observability/README.md index c9fccfadc46..c305c71584c 100644 --- a/python/samples/02-agents/observability/README.md +++ b/python/samples/02-agents/observability/README.md @@ -208,7 +208,9 @@ configure_otel_providers(exporters=[exporter]) enable_sensitive_telemetry() ``` -Or with [Arize AX](https://arize.com/docs/ax/integrations/python-agent-frameworks/microsoft/microsoft-agent-framework) or [Phoenix](https://arize.com/docs/phoenix), which use the [OpenInference](https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-agent-framework) format. Install `openinference-instrumentation-agent-framework>=0.1.12` and `opentelemetry-exporter-otlp-proto-http`. The OpenInference span processor converts Agent Framework's GenAI spans and must run before the exporter, so set up the tracer provider yourself rather than calling `configure_otel_providers()`. The example sends to Arize AX; for Phoenix, use the commented-out exporter instead and point it at your Phoenix endpoint: +Or with [Arize AX](https://arize.com/docs/ax/integrations/python-agent-frameworks/microsoft/microsoft-agent-framework) or [Phoenix](https://arize.com/docs/phoenix), using the [`openinference-instrumentation-agent-framework`](https://github.com/Arize-ai/openinference/tree/main/python/instrumentation/openinference-instrumentation-agent-framework) span processor to convert Agent Framework's GenAI spans to OpenInference. Install `openinference-instrumentation-agent-framework>=0.1.13` and `opentelemetry-exporter-otlp-proto-http`. + +The processor must run before the exporter, so set up the tracer provider yourself rather than calling `configure_otel_providers()`. The example sends to Arize AX; for Phoenix, use the commented-out exporter: ```python from opentelemetry import trace @@ -234,7 +236,8 @@ tracer_provider.add_span_processor(AgentFrameworkToOpenInferenceProcessor()) tracer_provider.add_span_processor(BatchSpanProcessor(exporter)) trace.set_tracer_provider(tracer_provider) -# Optional: opt in to capturing sensitive data +# Capture prompts, responses, and tool arguments; without this, spans have no +# messages or inputs and outputs. Only send sensitive data to a backend you trust. enable_sensitive_telemetry() ``` @@ -270,7 +273,7 @@ Exporters are **not** installed by default — install only what you need: - **Application Insights**: `azure-monitor-opentelemetry` - **Aspire Dashboard or other OTLP/gRPC backends**: `opentelemetry-exporter-otlp-proto-grpc` - **OTLP over HTTP**: `opentelemetry-exporter-otlp-proto-http` -- **Arize AX or Phoenix**: `openinference-instrumentation-agent-framework` and `opentelemetry-exporter-otlp-proto-http` +- **Arize AX or Phoenix**: `openinference-instrumentation-agent-framework>=0.1.13` and `opentelemetry-exporter-otlp-proto-http` For other backends, refer to the documentation of the specific exporter. From 0ced04960e5bd29a0a4f5a4f817ba0b6c1acf745 Mon Sep 17 00:00:00 2001 From: Jim Bennett Date: Wed, 7 Oct 2026 15:32:55 -0700 Subject: [PATCH 4/4] Python: Restrict sensitive telemetry to dev and test in the Arize AX/Phoenix example Co-Authored-By: Claude Opus 5.5 --- python/samples/02-agents/observability/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/samples/02-agents/observability/README.md b/python/samples/02-agents/observability/README.md index c305c71584c..566f4ca9ed5 100644 --- a/python/samples/02-agents/observability/README.md +++ b/python/samples/02-agents/observability/README.md @@ -237,7 +237,8 @@ tracer_provider.add_span_processor(BatchSpanProcessor(exporter)) trace.set_tracer_provider(tracer_provider) # Capture prompts, responses, and tool arguments; without this, spans have no -# messages or inputs and outputs. Only send sensitive data to a backend you trust. +# messages or inputs and outputs. Only enable in development or test environments, +# as it may expose user or system secrets in production. enable_sensitive_telemetry() ```