Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

trace-debugger

БесплатноЗапускает вложенные скриптыНе проверен

Debug performance issues and understand code flow using AILANG telemetry traces. Use when user asks to debug slow compilation, analyze benchmarks, find…

sunholo-dataот sunholo-data★ 39 звёзд на GitHub

Об этом скилле

Trace Debugger

Debug and analyze AILANG operations using OpenTelemetry distributed tracing. This skill helps identify performance bottlenecks, understand code flow, and debug issues using trace data from GCP Cloud Trace.

Quick Start

Most common usage:

# User says: "Why is compilation slow?"
# This skill will:
# 1. Check telemetry is configured
# 2. Run the slow operation with tracing
# 3. Query recent traces with ailang trace list
# 4. Analyze timing breakdown per phase
# 5. Identify the bottleneck

# Check telemetry status
ailang trace status

# List recent traces
ailang trace list --hours 2 --limit 20

# View specific trace hierarchy
ailang trace view <trace-id>

When to Use This Skill

Invoke this skill when:

  • User asks to debug slow compilation or type checking
  • User wants to analyze benchmark performance
  • User mentions "bottleneck", "slow", "hang", or "performance"
  • User wants to understand execution flow across components
  • User asks "why is X taking so long?"
  • User needs to compare timing between runs

Telemetry Prerequisites

Before debugging with traces:

# Option 1: Google Cloud Trace (recommended)
export GOOGLE_CLOUD_PROJECT=your-project-id

# Option 2: Local Jaeger
docker run -d -p 16686:16686 -p 4318:4318 jaegertracing/all-in-one
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318

# Option 3: AILANG Observatory (local dashboard API, no UI)
ailang server  # Starts server on localhost:1957
# Read traces with: ailang chains dashboard traces

# Verify configuration
ailang trace status

Observatory Dashboard Setup (v0.6.3+)

The Observatory provides a local dashboard for viewing traces from Claude Code, Gemini CLI, and AILANG.

Start the Server

ailang server
# Or: make services-start

Configure Claude Code

Add to ~/.claude/settings.json:

{
  "env": {
    "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
    "OTEL_LOGS_EXPORTER": "otlp",
    "OTEL_METRICS_EXPORTER": "otlp",
    "OTEL_EXPORTER_OTLP_PROTOCOL": "http/json",
    "OTEL_EXPORTER_OTLP_ENDPOINT": "http://localhost:1957",
    "OTEL_RESOURCE_ATTRIBUTES": "ailang.source=user"
  }
}

What Claude Code sends: Events via OTLP logs (token counts, costs, model, session info)

Configure Gemini CLI

Important: Gemini CLI only supports local (file-based) or gcp (GCP Cloud Trace) telemetry targets. It does NOT support direct OTLP export to custom endpoints.

Add to ~/.gemini/settings.json:

{
  "telemetry": {
    "enabled": true,
    "target": "gcp",
    "logPrompts": true
  }
}

Architecture: Gemini traces go to GCP Cloud Trace, then Observatory pulls them via the GCP Trace API.

Trace Linking: The Observatory links Gemini traces to AILANG traces via:

  • session.id - Links tool invocations in the same session
  • ailang.task_id - Added by Coordinator for delegated tasks
  • ailang.workspace - Groups traces by project

What Gemini CLI sends to GCP: Full traces (complete span hierarchy with parent-child relationships, token counts, model info, prompts)

Environment Variables Reference

Claude Code (direct OTLP export to Observatory):

Variable Purpose Example
CLAUDE_CODE_ENABLE_TELEMETRY Enable Claude Code telemetry 1
OTEL_LOGS_EXPORTER Log export protocol otlp
OTEL_METRICS_EXPORTER Metrics export protocol otlp
OTEL_EXPORTER_OTLP_PROTOCOL Transport protocol http/json
OTEL_EXPORTER_OTLP_ENDPOINT Observatory URL http://localhost:1957
OTEL_RESOURCE_ATTRIBUTES Span metadata ailang.source=user

Gemini CLI (GCP Cloud Trace only - configure via ~/.gemini/settings.json):

Setting Purpose Value
telemetry.enabled Enable telemetry true
telemetry.target Export destination gcp
telemetry.logPrompts Include prompt text true

OTLP Endpoints

The Observatory receives data on:

  • /v1/traces - Trace spans (Gemini CLI, AILANG)
  • /v1/logs - Log records (Claude Code events)
  • /v1/metrics - Metrics data

Both protobuf and JSON formats are supported.

Verify Telemetry is Working

  1. Ensure ailang server is running
  2. Run a Claude Code or Gemini CLI command
  3. Run ailang chains dashboard traces
  4. New traces should appear

Note: If server is not running, OTLP exports fail silently (no impact on CLI tools).

Available Scripts

scripts/check_traces.sh [hours] [filter]

Quick check for recent traces with optional filtering.

Usage:

# Check last hour of traces
.claude/skills/trace-debugger/scripts/check_traces.sh

# Check last 4 hours, filter by eval
.claude/skills/trace-debugger/scripts/check_traces.sh 4 "eval.suite"

# Check compilation traces
.claude/skills/trace-debugger/scripts/check_traces.sh 1 "compile"

scripts/analyze_compilation.sh <file.ail>

Run a file with tracing and analyze compilation phases.

*Usage:

Полный SKILL.md на GitHub

Установить trace-debugger в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

resources/trace_patterns.mdscripts/analyze_compilation.shscripts/check_traces.sh

FAQ

Что делает скилл trace-debugger?

Debug performance issues and understand code flow using AILANG telemetry traces. Use when user asks to debug slow compilation, analyze benchmarks, find bottlenecks, investigate hangs, or understand system behavior.

Как установить скилл trace-debugger?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл trace-debugger запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить trace-debugger с