Skip to content

Add the Arize integration page for Python - #5306

Draft
DABH wants to merge 11 commits into
mainfrom
dabh/arize-python-integration-docs
Draft

DABH wants to merge 11 commits into
mainfrom
dabh/arize-python-integration-docs

Conversation

@DABH

@DABH DABH commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Adds docs/develop/python/integrations/arize.mdx, a guide to sending Temporal traces to Arize Phoenix or Arize AX with the Python OpenTelemetry plugin and the OpenInference conventions, plus the sidebar entry, the IntegrationsGrid card, the Python index bullet, and a pointer from the observability page. Vale gains Arize, OpenAI, OpenInference, OTLP, and Phoenix as heading exceptions.

The page covers the tracer provider and exporter setup, Client and Worker configuration, LLM calls in Activities (including the OpenAI Agents SDK bridge from the standalone temporalio-openai-agents package), the OpenInference attributes that make traces group by Workflow Id, and how replay, retries, Worker crashes, Workflow Task failures, Continue-As-New, and resets appear in Arize. Every behavior described was verified against a local Phoenix with the sample's runbook; the Arize AX exporter path follows Arize's guide and the page says it was not exercised live.

Draft until temporalio/samples-python#365 merges: the snippets are pre-filled from that PR's @@@SNIPSTART markers and its GitHub links resolve only after merge. #5305 (the observability page) has merged, so the diff is the Arize changes only. Replaces the closed #5210 card. Vale CI config and yarn build are clean; yarn check:orphans reports two pre-existing pages unrelated to this change.

@vercel

vercel Bot commented Sep 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
temporal-documentation Ready Ready Preview Nov 3, 2026 5:47am UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs PR preview links

@arizedatngo

Copy link
Copy Markdown

@DABH following up on the Arize integration handoff: this docs PR and samples-python#365 are still drafts, and the docs body notes the sample must merge first. Is there any specific input needed from the Arize side to finish the sample/docs review? For the eventual evaluation references, the current URLs are https://arize.com/guides/ai-agent-handbook/agent-evaluation/ and https://arize.com/resources/llm-evaluation/. Happy to keep tracking the dependency rather than reopening #5210.

Base automatically changed from dabh/python-otel-plugin-observability to main September 15, 2026 16:10
@DABH

DABH commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

Hey Dat, sorry for the slow reply here! Nothing is blocked on the Arize side - both PRs have been drafts since I found a few tracing bugs in the OpenAI Agents plugin while building the agents scenario, and in the meantime that plugin moved out of the SDK into the standalone temporalio-openai-agents package, so I'm migrating the scenario and this page over to it and then both go up for review. The one tracing fix the agents scenario needs (temporalio/ai-integrations#26) is merged but not in a release yet, so the split-worker runbook stays until it ships. Two asks if you have the time: once the preview refreshes, could someone on your side read the "Read Temporal traces in Arize" section and tell me if anything about how Phoenix renders retries or resets looks off? And once this page is live, could your Temporal guide link to it (it points at our observability page today)? I'll add the two eval links you sent under Resources. Thanks in advance!

…egration-docs

# Conflicts:
#	docs/develop/python/platform/observability.mdx
Install the agents variant from the standalone package, describe the
single-worker span-parenting bug as fixed upstream but unreleased, note
that the Arize AX exporter settings were not exercised live, and add
Arize's evaluation guides to Resources.
1.1.0 ships the span-parenting fix, so the caution about running Workflows
and Activities in separate Worker processes and the note about the
"Failed to detach context" log filter no longer apply. The install step
now asks for 1.1.0 or later, and the agents plugin snippet matches the
sample without its worker-role switch.
@justonwestern

Copy link
Copy Markdown

Ran the sample against an Arize AX space (US region) on 2026-10-23, from commit 22922af, with temporalio 1.34.0, temporalio-openai-agents 1.1.0 and Python 3.12.

Everything except reset matches the "Read Temporal traces in Arize" section:

  • Ticket triage: the tree matches the docs node for node. Temporal spans are CHAIN, LLM spans show model, messages and tokens, and the root has input, output, user, tags and metadata. user.id from baggage reaches the worker-side spans. AX also shows cost per trace and per session.

  • Sessions: reusing a Workflow Id groups both traces in one session, and the Sessions view fills first and last message from the root span.

  • Agents SDK: AGENT, LLM and TOOL spans render as in the README.

  • Replay stress and worker restart: one clean trace each, no duplicates. After the restart, RunWorkflow covers the outage (26.3s).

  • Activity retry: two RunActivity:classify_ticket spans, the first with the exception event and attempt 1, the second with attempt 2.

One problem with reset. After temporal workflow reset --type FirstWorkflowTask, the reset run's reapplied HandleUpdate:approve span has the same span ID as the original run's RunWorkflow span (4d781b8a6128224e in our trace). AX keeps both spans, so the original run's activity subtree shows up twice, once under each span with that ID, and the original RunWorkflow node is labeled HandleUpdate:approve in the tree. The new run's RunWorkflow is correct: a second child of StartWorkflow with its own temporalRunID. Phoenix deduplicates by span ID and keeps the first copy, so it would drop the new HandleUpdate span silently, which may be why this didn't show up in Phoenix testing. It looks like the deterministic ID generator in the reset run is reusing IDs from the original run. Happy to share the trace export.

After reset: the original run’s activities appear under two different spans.

Screenshot A

Clicking the HandleUpdate:approve node opens the original RunWorkflow span (26.3s, original run ID). AX highlights both HandleUpdate:approve nodes because they share a span ID.

Screenshot B

Two smaller notes:

  1. A retried-then-successful activity marks the whole trace as ERROR in AX, even though the workflow completed. A sentence in the retries section would keep people who filter on errors from being surprised.

  2. Stopping the worker while a workflow waits logs ERROR:opentelemetry.context:Failed to detach context with a stack trace, then Shutdown called, ignoring Span. The trace comes out fine, but a README note that this is expected would save people some worry when they run the restart case.

With the reset fix, the line saying the AX path wasn't exercised can come out.

DABH added 2 commits November 2, 2026 23:22
…egration-docs

# Conflicts:
#	docs/develop/python/index.mdx
#	sidebars.js
#	vale/styles/Temporal/Headings.yml
Arize validated the sample against an AX space, so the note that the AX
path was not exercised is gone. Add what they observed: AX lists a trace
with a failed attempt as an error, a stopping Worker logs a harmless
"Failed to detach context" traceback, and after a reset the reapplied
update's HandleUpdate span reuses the original RunWorkflow span id, which
Phoenix drops and AX shows as a duplicated subtree.
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Snipsync coverage

SDK code lines in docs/ that come from Snipsync: 38.1% → 38.7% (+0.6 pts), 15,263 of 39,460 lines.

Section Snipsync lines Inline lines Snipsync % Change
develop/python 4,821 → 5,177 535 90.0% → 90.6% +0.6 pts
All sections

All languages: 33.6% (15,939 of 47,461 lines).

Section Snipsync lines Inline lines Snipsync %
design-patterns 26 7,808 0.3%
develop/python 5,177 535 90.6%
guides 34 4,494 0.8%
develop/go 4,285 80 98.2%
develop/java 1,092 3,107 26.0%
develop/typescript 1,716 2,012 46.0%
develop/dotnet 2,285 0 100.0%
develop/rust 0 1,257 0.0%
develop/php 30 1,144 2.6%
develop/ruby 21 1,145 1.8%
develop 484 604 44.5%
production-deployment 54 805 6.3%
encyclopedia 0 837 0.0%
develop/worker-performance 48 177 21.3%
cloud 0 127 0.0%
references 0 48 0.0%
best-practices 11 17 39.3%
Language Snipsync lines Inline lines Snipsync %
Python 5,320 6,615 44.6%
Go 4,425 3,181 58.2%
Java 1,177 5,651 17.2%
TypeScript 1,883 4,470 29.6%
C# 2,360 462 83.6%
Ruby 68 1,326 4.9%
Rust 0 1,324 0.0%
PHP 30 1,168 2.5%
Snipsync origin Lines
temporalio/documentation-sdk-code-examples 9,268
temporalio/samples-python 2,297
temporalio/samples-typescript 1,567
temporalio/samples-java 973
temporalio/features 579
temporalio/samples-go 384
temporalio/sdk-typescript 119
unattributed 35
temporalio/samples-php 30
temporalio/reference-app-orders-go 11

Compared with e3b8ad2. Counts non-blank lines in fenced code blocks tagged with an SDK language. Hand-written code isn't compiled anywhere; code Snipsync pulls from a sample repository is built in that repository's CI. See UTILITIES.md.

@DABH

DABH commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for running this against AX, Juston - that's exactly the coverage we were missing, and the reset finding is a real bug. I reproduced it locally with an in-memory exporter: the reapplied HandleUpdate:approve gets the first span ID the original run drew (its RunWorkflow), because the reset run starts on the original run's random seed and the reapplied update handler runs before the SDK applies the reseed for the new run. Everything after that gets fresh IDs, which is why only that one span collides and why Phoenix hid it (it drops the duplicate). Filed as temporalio/sdk-python#2070; until it lands, the README and this page describe the behavior and verify_trace.py warns that the reapplied update span is missing in Phoenix rather than passing quietly. Also took your two notes: the retries section now says AX lists a trace with a failed attempt as an error even though the workflow completed, and the README's restart step explains the "Failed to detach context" traceback and "Shutdown called, ignoring Span" lines at worker shutdown. The "not exercised against AX" line is gone. If you can share the trace export I'd love to attach it to the SDK issue

Arize's guide to the same integration.
- [OpenInference semantic conventions](https://github.com/Arize-ai/openinference/blob/main/spec/semantic_conventions.md):
the attributes Arize reads.
- [Agent evaluation](https://arize.com/guides/ai-agent-handbook/agent-evaluation/): Arize's guide to evaluating agents

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The agent-evaluation guide now lives at this canonical URL. The old address still redirects; this suggestion points directly to the current page.

Suggested change
- [Agent evaluation](https://arize.com/guides/ai-agent-handbook/agent-evaluation/): Arize's guide to evaluating agents
- [Agent evaluation](https://arize.com/ai-agents/agent-evaluation/): Arize's guide to evaluating agents

This branch was successfully deployed

1 active deployment
Preview — 65680583 Deployed Nov 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants