From claude-knowledge-sdk
Set up and manage OpenTelemetry monitoring for Claude Code sessions. USE THIS SKILL whenever the user asks about monitoring, telemetry, cost tracking, token usage, OTel configuration, Prometheus setup, or session analytics. Also trigger for "how much did that cost", "track my usage", "set up monitoring", "configure telemetry", or any reference to OTEL, Prometheus, Grafana, or the monitoring guide.
npx claudepluginhub jadecli/claude-knowledge-sdk-typescriptThis skill uses the workspace's default tool permissions.
Generate the OTel environment variables:
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Automates semantic versioning and release workflow for Claude Code plugins: bumps versions in package.json, marketplace.json, plugin.json; verifies builds; creates git tags, GitHub releases, changelogs.
Generate the OTel environment variables:
npx tsx src/cli.ts otel-setup --backend prometheus --endpoint http://localhost:4317
This generates a shell script you can source:
source ./claude-otel-env.sh
Rich telemetry (tokens, costs, tool usage) flows through the logs/events protocol.
Setting only OTEL_METRICS_EXPORTER misses most data.
export OTEL_METRICS_EXPORTER=otlp # counters, histograms
export OTEL_LOGS_EXPORTER=otlp # events with token/cost details
| Variable | Controls | Purpose |
|---|---|---|
CLAUDE_CODE_ENABLE_TELEMETRY=1 | User-managed OTel | YOUR monitoring |
DISABLE_TELEMETRY=1 | Anthropic's Statsig | Internal metrics |
WARNING: Setting DISABLE_TELEMETRY=1 can disable paid features like
Opus 1M context and Channels. Only disable it if you understand the consequences.
claude_code_cost_usage_USD_total — cumulative costclaude_code_token_usage_tokens_total — token counters by typeclaude_code_api_request_duration_ms — API latencyclaude_code_session_count_total — session counterOTEL_LOG_USER_PROMPTS=1 — include prompt content (off by default)OTEL_LOG_TOOL_DETAILS=1 — include MCP/tool server namesOTEL_METRICS_INCLUDE_SESSION_ID=1 — per-session cardinalityUse npx tsx src/cli.ts otel-compose --backend prometheus to generate
a Docker Compose file matching the official monitoring guide.
In GitHub Actions with claude-code-action:
- uses: anthropics/claude-code-action@v1
with:
claude_args: "--output-format json --max-turns 10"
Parse total_cost_usd and session_id from the JSON output.