phoenix-tracing
使用 OpenTelemetry 为 LLM 应用添加可观测性,自动追踪 traces、spans 和指标
npx skills add https://github.com/github/awesome-copilot --skill phoenix-tracingBefore / After 效果对比
1 组在没有 `phoenix-tracing` 的情况下,为 LLM 应用添加可观测性通常需要大量手动工作。开发者需要自行编写代码来记录每次 LLM API 调用(如 OpenAI 或 LangChain)的详细信息,包括请求、响应、使用的模型、输入/输出令牌数量以及预估成本。对于多步骤的 LLM 工作流(如 RAG 链),需要手动关联不同阶段的日志,才能理解整个流程的执行路径和性能瓶颈。这导致调试复杂、问题定位耗时,且难以获得统一、标准化的追踪视图,尤其是在生产环境中。
通过集成 `phoenix-tracing`,LLM 应用的可观测性得到了显著提升。它能自动对 OpenAI、LangChain 等主流框架进行追踪,无需手动修改代码即可捕获 LLM API 调用和多步骤工作流(如 `span-llm` 和 `span-chain`)。系统会自动记录关键属性,如模型名称、令牌使用量、消息内容和成本。这使得开发者能够轻松地查看完整的端到端追踪,快速识别性能瓶颈、调试错误,并分析 LLM 交互的效率和成本,从而大幅简化了 LLM 应用的开发、部署和维护。
phoenix-tracing
Phoenix Tracing
Comprehensive guide for instrumenting LLM applications with OpenInference tracing in Phoenix. Contains reference files covering setup, instrumentation, span types, and production deployment.
When to Apply
Reference these guidelines when:
-
Setting up Phoenix tracing (Python or TypeScript)
-
Creating custom spans for LLM operations
-
Adding attributes following OpenInference conventions
-
Deploying tracing to production
-
Querying and analyzing trace data
Reference Categories
Priority Category Description Prefix
1
Setup
Installation and configuration
setup-*
2
Instrumentation
Auto and manual tracing
instrumentation-*
3
Span Types
9 span kinds with attributes
span-*
4
Organization
Projects and sessions
projects-*, sessions-*
5
Enrichment
Custom metadata
metadata-*
6
Production
Batch processing, masking
production-*
7
Feedback
Annotations and evaluation
annotations-*
Quick Reference
1. Setup (START HERE)
-
setup-python - Install arize-phoenix-otel, configure endpoint
-
setup-typescript - Install @arizeai/phoenix-otel, configure endpoint
2. Instrumentation
-
instrumentation-auto-python - Auto-instrument OpenAI, LangChain, etc.
-
instrumentation-auto-typescript - Auto-instrument supported frameworks
-
instrumentation-manual-python - Custom spans with decorators
-
instrumentation-manual-typescript - Custom spans with wrappers
3. Span Types (with full attribute schemas)
-
span-llm - LLM API calls (model, tokens, messages, cost)
-
span-chain - Multi-step workflows and pipelines
-
span-retriever - Document retrieval (documents, scores)
-
span-tool - Function/API calls (name, parameters)
-
span-agent - Multi-step reasoning agents
-
span-embedding - Vector generation
-
span-reranker - Document re-ranking
-
span-guardrail - Safety checks
-
span-evaluator - LLM evaluation
4. Organization
-
projects-python / projects-typescript - Group traces by application
-
sessions-python / sessions-typescript - Track conversations
5. Enrichment
- metadata-python / metadata-typescript - Custom attributes
6. Production (CRITICAL)
- production-python / production-typescript - Batch processing, PII masking
7. Feedback
-
annotations-overview - Feedback concepts
-
annotations-python / annotations-typescript - Add feedback to spans
Reference Files
-
fundamentals-overview - Traces, spans, attributes basics
-
fundamentals-required-attributes - Required fields per span type
-
fundamentals-universal-attributes - Common attributes (user.id, session.id)
-
fundamentals-flattening - JSON flattening rules
-
attributes-messages - Chat message format
-
attributes-metadata - Custom metadata schema
-
attributes-graph - Agent workflow attributes
-
attributes-exceptions - Error tracking
Common Workflows
-
Quick Start: setup-{lang} → instrumentation-auto-{lang} → Check Phoenix
-
Custom Spans: setup-{lang} → instrumentation-manual-{lang} → span-{type}
-
Session Tracking: sessions-{lang} for conversation grouping patterns
-
Production: production-{lang} for batching, masking, and deployment
How to Use This Skill
Navigation Patterns:
# By category prefix
references/setup-* # Installation and configuration
references/instrumentation-* # Auto and manual tracing
references/span-* # Span type specifications
references/sessions-* # Session tracking
references/production-* # Production deployment
references/fundamentals-* # Core concepts
references/attributes-* # Attribute specifications
# By language
references/*-python.md # Python implementations
references/*-typescript.md # TypeScript implementations
Reading Order:
-
Start with setup-{lang} for your language
-
Choose instrumentation-auto-{lang} OR instrumentation-manual-{lang}
-
Reference span-{type} files as needed for specific operations
-
See fundamentals-* files for attribute specifications
References
Phoenix Documentation:
Python API Documentation:
-
Python OTEL Package -
arize-phoenix-otelAPI reference -
Python Client Package -
arize-phoenix-clientAPI reference
TypeScript API Documentation:
- TypeScript Packages -
@arizeai/phoenix-otel,@arizeai/phoenix-client, and other TypeScript packages
Weekly Installs522Repositorygithub/awesome-copilotGitHub Stars29.6KFirst Seen12 days agoSecurity AuditsGen Agent Trust HubPassSocketPassSnykPassInstalled onopencode479codex477gemini-cli476github-copilot476kimi-cli473deepagents473
用户评价 (0)
发表评价
暂无评价
统计数据
用户评分
为此 Skill 评分