What problem does it solve?
Managing OpenTelemetry global providers in pnpm workspaces is error-prone because different packages may resolve different module instances of @opentelemetry/api, causing inconsistent global state. This Skill provides the conventions and invariants for safely registering, attaching, detaching, and testing tracer providers through the phoenix-otel package.
Core Features & Use Cases
- Global Provider Lifecycle: Stack-based mount system for attaching and detaching global tracer providers with base snapshot capture and restore.
- register() API Guidance: Rules for the
global parameter, span processor setup via @arizeai/openinference-vercel, and environment variable fallbacks (PHOENIX_COLLECTOR_ENDPOINT, PHOENIX_API_KEY).
- Testing Conventions: Patterns for testing with real OTel components and spy span processors, including mandatory cleanup via detach in afterEach.
- Use Case: When adding a new feature to phoenix-client experiments that needs tracing without global attachment, follow the register() rules to call it with
global: false and manage attachment explicitly.
Quick Start
Ask the AI to read the relevant rule file and help you register a tracer provider with phoenix-otel using the correct global attachment pattern.