1---2name: phoenix-tracing3description: Instrument Python and TypeScript LLM applications with Phoenix AI observability using OpenInference semantic conventions, arize-phoenix-otel, @arizeai/phoenix-otel, spans, sessions, metadata, annotations, and production masking. Use when setting up Phoenix tracing, creating custom spans, adding OpenInference attributes, or deploying tracing to production.4license: Apache-2.05---67<!-- Generated from harness/github-copilot/skills/phoenix-tracing/SKILL.md by harness/claude-code/scripts/convert_from_copilot.py. Edit the source, not this file. -->89# Phoenix tracing1011Instrument LLM applications for Phoenix with OpenInference traces, spans, attributes, projects, sessions, metadata, annotations, and production-safe export settings.1213## When to invoke1415- "Set up Phoenix tracing for this Python LLM app."16- "Add OpenInference spans to this TypeScript agent."17- "Create custom spans for LLM operations."18- "Add Phoenix session or project tracking."19- "Deploy Phoenix tracing to production with masking."2021## Prerequisites and context2223- A Phoenix server must be available.24- Python projects need `arize-phoenix-otel`.25- TypeScript projects need `@arizeai/phoenix-otel` and may also use `@arizeai/phoenix-client`; Python client work may use `arize-phoenix-client`.26- Follow OpenInference semantic conventions from the bundled span and fundamentals references.2728## Reference map2930| Priority | Category | Description | Prefix |31| --- | --- | --- | --- |32| 1 | Setup | Installation and endpoint configuration | `setup-*` |33| 2 | Instrumentation | Auto and manual tracing | `instrumentation-*` |34| 3 | Span Types | 9 span kinds with attributes | `span-*` |35| 4 | Organization | Projects and sessions | `projects-*`, `sessions-*` |36| 5 | Enrichment | Custom metadata | `metadata-*` |37| 6 | Production | Batch processing and masking | `production-*` |38| 7 | Feedback | Annotations and evaluation | `annotations-*` |3940## Procedure41421. Identify language: Python or TypeScript.432. Read `references/setup-python.md` or `references/setup-typescript.md` first.443. Choose auto instrumentation for supported frameworks, or manual instrumentation for custom LLM, chain, retriever, tool, agent, embedding, reranker, guardrail, or evaluator operations.454. Read the relevant `span-<type>.md` file for required attributes before writing spans.465. Add project and session grouping when traces must be filtered by application or conversation.476. Add metadata and annotations only when the workflow needs enrichment, feedback, or evaluation.487. For production, read `production-python.md` or `production-typescript.md` for batching, masking, and deployment settings before enabling export broadly.4950## Navigation patterns5152```text53references/setup-* # Installation and configuration54references/instrumentation-* # Auto and manual tracing55references/span-* # Span type specifications56references/sessions-* # Session tracking57references/production-* # Production deployment58references/fundamentals-* # Core concepts59references/attributes-* # Attribute specifications60references/*-python.md # Python implementations61references/*-typescript.md # TypeScript implementations62```6364Common workflows:6566| Workflow | Reading order |67| --- | --- |68| Quick Start | START HERE: `setup-{lang}` → `instrumentation-auto-{lang}` → check Phoenix for OpenAI, LangChain, or other supported frameworks. |69| Custom Spans | `setup-{lang}` → `instrumentation-manual-{lang}` → `span-{type}`. |70| Session Tracking | `sessions-{lang}` for conversation grouping patterns. |71| Production | `production-{lang}` for batching, masking, and deployment. |7273## Span categories7475| Span reference | Use for |76| --- | --- |77| `span-llm.md` | LLM API calls, model, tokens, messages, and cost. |78| `span-chain.md` | Multi-step workflows and pipelines. |79| `span-retriever.md` | Document retrieval, documents, and scores. |80| `span-tool.md` | Function/API calls, names, and parameters. |81| `span-agent.md` | Multi-step reasoning agents. |82| `span-embedding.md` | Vector generation. |83| `span-reranker.md` | Document re-ranking. |84| `span-guardrail.md` | Safety checks. |85| `span-evaluator.md` | LLM evaluation. |8687## Progressive disclosure and bundled resources8889- `references/setup-python.md` and `references/setup-typescript.md`: install and configure tracing.90- `references/instrumentation-auto-python.md`, `references/instrumentation-auto-typescript.md`, `references/instrumentation-manual-python.md`, and `references/instrumentation-manual-typescript.md`: tracing implementation patterns.91- `references/span-llm.md`, `references/span-chain.md`, `references/span-retriever.md`, `references/span-tool.md`, `references/span-agent.md`, `references/span-embedding.md`, `references/span-reranker.md`, `references/span-guardrail.md`, and `references/span-evaluator.md`: full attribute schemas.92- `references/projects-python.md`, `references/projects-typescript.md`, `references/sessions-python.md`, and `references/sessions-typescript.md`: grouping traces by application and conversation.93- `references/metadata-python.md`, `references/metadata-typescript.md`, `references/production-python.md`, `references/production-typescript.md`, `references/annotations-overview.md`, `references/annotations-python.md`, and `references/annotations-typescript.md`: enrichment, masking, batching, and feedback.94- `references/fundamentals-overview.md`, `references/fundamentals-required-attributes.md`, `references/fundamentals-universal-attributes.md`, and `references/fundamentals-flattening.md`: traces, spans, attributes, common attributes such as `user.id` and `session.id`, and JSON flattening rules.9596## Output template9798```markdown99## Phoenix tracing plan — <application or workflow>100101**Status:** implemented | plan only | blocked102**Language:** Python | TypeScript103**Instrumentation:** auto | manual | mixed104**Phoenix endpoint:** `<endpoint or unknown>`105106| Trace area | Reference used | Span kind or attribute set | Implementation note |107| --- | --- | --- | --- |108| Setup | `references/setup-<lang>.md` | <endpoint/project> | <change or instruction> |109| Operation | `references/span-<type>.md` | <span kind> | <attributes added> |110| Production | `references/production-<lang>.md` | masking/batching | <setting or blocker> |111112### Validation113- Phoenix trace visible: pass | fail | not checked114- Required OpenInference attributes present: pass | fail | not checked115```116117## Quality gate118119- [ ] CRITICAL production masking and batching guidance was checked before broad deployment.120- [ ] Setup reference for the project language was read before instrumentation.121- [ ] Auto versus manual instrumentation was chosen based on the framework and operation.122- [ ] Each custom span maps to a documented OpenInference span kind.123- [ ] Required attributes from `fundamentals-required-attributes.md` and the relevant `span-*` file are present.124- [ ] `user.id`, `session.id`, project, metadata, and annotations are added only when useful and privacy-safe.125- [ ] Production deployments account for batching and PII masking.126- [ ] The result names the Phoenix server endpoint or states why it is unknown.127128## References129130- [Phoenix Documentation](https://docs.arize.com/phoenix)131- [OpenInference Spec](https://github.com/Arize-ai/openinference/tree/main/spec)132- [Python OTEL Package](https://arize.com/docs/phoenix/tracing/how-to-tracing/setup-tracing)133- [Python Client Package](https://arize.com/docs/phoenix)134- [TypeScript Packages](https://arize-ai.github.io/phoenix/)