All skills
github avatar

/phoenix-tracing

@4214189 official
by githubgithub/awesome-copilot40k stars
5,040

OpenInference semantic conventions and instrumentation for Phoenix AI observability. Use when implementing LLM tracing, creating custom spans, or deploying to production.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/phoenix-tracing

This session only. Nothing lands on disk.

referencessetup-typescript.md

≈982 tokens on demand. Your agent reads this file only when SKILL.md points to it.

TypeScript Setup

Setup Phoenix tracing in TypeScript/JavaScript with @arizeai/phoenix-otel.

Metadata

Attribute Value
Priority Critical - required for all tracing
Setup Time <5 min

Quick Start

npm install @arizeai/phoenix-otel
import { register } from "@arizeai/phoenix-otel";
register({ projectName: "my-app" });

Connects to http://localhost:6006 by default.

Configuration

import { register } from "@arizeai/phoenix-otel";

register({
  projectName: "my-app",
  url: "http://localhost:6006",
  apiKey: process.env.PHOENIX_API_KEY,
  batch: true
});

Environment variables:

export PHOENIX_API_KEY="your-api-key"
export PHOENIX_COLLECTOR_ENDPOINT="http://localhost:6006"
export PHOENIX_PROJECT_NAME="my-app"

ESM vs CommonJS

CommonJS (automatic):

const { register } = require("@arizeai/phoenix-otel");
register({ projectName: "my-app" });

const OpenAI = require("openai");

ESM (manual instrumentation required):

import { register, registerInstrumentations } from "@arizeai/phoenix-otel";
import { OpenAIInstrumentation } from "@arizeai/openinference-instrumentation-openai";
import OpenAI from "openai";

register({ projectName: "my-app" });

const instrumentation = new OpenAIInstrumentation();
instrumentation.manuallyInstrument(OpenAI);
registerInstrumentations({ instrumentations: [instrumentation] });

Why: ESM imports are hoisted, so manuallyInstrument() is needed.

Framework Integration

Next.js (App Router):

// instrumentation.ts
export async function register() {
  if (process.env.NEXT_RUNTIME === "nodejs") {
    const { register } = await import("@arizeai/phoenix-otel");
    register({ projectName: "my-nextjs-app" });
  }
}

Express.js:

import { register } from "@arizeai/phoenix-otel";

register({ projectName: "my-express-app" });

const app = express();

Flushing Spans Before Exit

CRITICAL: Spans may not be exported if still queued in the processor when your process exits. Call provider.shutdown() to explicitly flush before exit.

Standard pattern:

const provider = register({
  projectName: "my-app",
  batch: true,
});

async function main() {
  await doWork();
  await provider.shutdown();  // Flush spans before exit
}

main().catch(async (error) => {
  console.error(error);
  await provider.shutdown();  // Flush on error too
  process.exit(1);
});

Alternative:

// Use batch: false for immediate export (no shutdown needed)
register({
  projectName: "my-app",
  batch: false,
});

For production patterns including graceful termination, see production-typescript.md.

Verification

  1. Open Phoenix UI: http://localhost:6006
  2. Run your application
  3. Check for traces in your project

Enable diagnostic logging:

import { DiagLogLevel, register } from "@arizeai/phoenix-otel";

register({
  projectName: "my-app",
  diagLogLevel: DiagLogLevel.DEBUG,
});

Troubleshooting

No traces:

  • Verify PHOENIX_COLLECTOR_ENDPOINT is correct
  • Set PHOENIX_API_KEY for Phoenix Cloud
  • For ESM: Ensure manuallyInstrument() is called
  • With batch: true: Call provider.shutdown() before exit to flush queued spans (see Flushing Spans section)

Traces missing:

  • With batch: true: Call await provider.shutdown() before process exit to flush queued spans
  • Alternative: Set batch: false for immediate export (no shutdown needed)

Missing attributes:

  • Check instrumentation is registered (ESM requires manual setup)
  • See instrumentation-auto-typescript.md

See Also

Source: SKILL.md on GitHub

No alerts9d4 checks · Risk SAFE
  • Gen Agent Trust Hub9d

    The phoenix-tracing skill provides comprehensive documentation and implementation guides for instrumenting LLM applications with Phoenix and OpenInference semantic conventions. It covers setup, manual and auto-instrumentation, and production best practices for both Python and TypeScript, with a strong focus on secure data handling and PII masking.

  • Socket9d

    No alerts

  • Snyk9d

    Risk: LOW · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 4214189. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 months ago
Other metadata
compatibility
Requires Phoenix server. Python skills need arize-phoenix-otel; TypeScript skills need @arizeai/phoenix-otel.
metadata
{
  "author": "oss@arize.com",
  "version": "1.0.0",
  "languages": "Python, TypeScript"
}
  • Python
  • TypeScript
  • phoenix
  • tracing
  • openinference
  • llm-observability
  • instrumentation
  • otel
  • arize

README badge

README badge for github/awesome-copilot/phoenix-tracing

Instruments LLM applications with OpenInference tracing in Phoenix, supporting auto-instrumentation of frameworks like OpenAI and LangChain or custom manual spans. Covers setup, span types (LLM calls, retrievers, agents, evaluators), production deployment with PII masking, and feedback annotation in Python and TypeScript.

Generated from the current SKILL.md.

Does this skill work with both Python and TypeScript?
Yes. The skill provides separate setup, instrumentation, and production guides for both Python (arize-phoenix-otel) and TypeScript (@arizeai/phoenix-otel).
What do I need to install to use this skill?
For Python: arize-phoenix-otel package. For TypeScript: @arizeai/phoenix-otel package. Both require a running Phoenix server endpoint.
Can I auto-instrument frameworks like OpenAI or LangChain?
Yes. The skill includes instrumentation-auto-{lang} references that cover auto-instrumentation for supported frameworks in both languages.
How do I track custom spans for my own operations?
Use the instrumentation-manual-{lang} references to create custom spans with decorators (Python) or wrappers (TypeScript), then refer to span-{type} files for the appropriate attribute schema.
Does this skill cover production deployment concerns?
Yes. The production-{lang} references address batch processing, PII masking, and deployment patterns for production environments.

Generated from the current SKILL.md. These answers refresh after source changes.