observability-analyzer
Claudeのコードに関するパフォーマンスやコスト、エラー、ツール利用状況などのデータを分析し、問題点の特定や改善に役立てることができるSkill。
📜 元の英語説明(参考)
Query and analyze Claude Code observability data (metrics, logs, traces). Use when analyzing performance, costs, errors, tool usage, sessions, conversations, or subagents.
🇯🇵 日本人クリエイター向け解説
Claudeのコードに関するパフォーマンスやコスト、エラー、ツール利用状況などのデータを分析し、問題点の特定や改善に役立てることができるSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o observability-analyzer.zip https://jpskill.com/download/9453.zip && unzip -o observability-analyzer.zip && rm observability-analyzer.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9453.zip -OutFile "$d\observability-analyzer.zip"; Expand-Archive "$d\observability-analyzer.zip" -DestinationPath $d -Force; ri "$d\observability-analyzer.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
observability-analyzer.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
observability-analyzerフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Observability Analyzer
Claude Codeのテレメトリをクエリし、メトリクス、ログ、トレースから洞察を生成します。デフォルトのOTELテレメトリと、拡張されたフックベースのテレメトリの両方で動作します。
データソース
| ソース | ジョブ名 | 含まれるもの |
|---|---|---|
| デフォルト OTEL | claude_code |
APIメトリクス、トークン使用量、コスト |
| 拡張フック | claude_code_enhanced |
セッション、会話、ツール、サブエージェント |
操作
query-metrics <promql>
Prometheusに対してPromQLクエリを実行します。
query-metrics 'sum(claude_code_token_usage)[7d]'
query-logs <logql>
Lokiに対してLogQLクエリを実行します。
query-logs '{job="claude_code_enhanced", event_type="tool_call"} | json' --since 24h
analyze-errors
拡張テレメトリからエラーパターンを検出し、グループ化します。
{job="claude_code_enhanced", event_type="tool_result", status="error"} | json
出力: エラーの種類、頻度、影響を受けるツール、推奨事項。
analyze-performance
遅い操作と応答サイズを特定します。
{job="claude_code_enhanced", event_type="tool_result"} | json | response_length > 50000
出力: 大きな応答、推定トークンコスト、遅いパターン。
analyze-costs
コンテンツサイズの推定値からトークン使用量を計算します。
sum by (repo) (sum_over_time({job="claude_code_enhanced", event_type="context_utilization"} | json | unwrap estimated_session_tokens [24h]))
出力: リポジトリごとのトークン推定値、セッションコスト、予測。
analyze-tools
ツールの使用状況の統計とシーケンス。
sum by (tool) (count_over_time({job="claude_code_enhanced", event_type="tool_call"} | json [24h]))
出力: 呼び出し頻度、成功率、ツールシーケンス、一般的なパターン。
analyze-sessions
セッションのライフサイクルと期間の分析。
{job="claude_code_enhanced", event_type="session_end"} | json
出力: セッション期間、ターン数、セッションごとのツール、終了理由。
analyze-conversations
会話とプロンプトの分析。
sum by (pattern) (count_over_time({job="claude_code_enhanced", event_type="user_prompt"} | json [24h]))
出力: プロンプトパターン(質問/デバッグ/作成/ultrathink)、ターンの分布。
analyze-subagents
サブエージェント/タスクツールの使用状況。
{job="claude_code_enhanced", event_type="tool_call", tool="Task"} | json
出力: 使用されるサブエージェントの種類、完了率、並列実行パターン。
analyze-skills
スキルの呼び出し分析。
sum by (skill_name) (count_over_time({job="claude_code_enhanced", event_type="skill_usage"} | json [24h]))
出力: 最も使用されているスキル、リポジトリごとのスキルの使用状況、トレンド。
analyze-context
コンテキストウィンドウの使用率。
{job="claude_code_enhanced", event_type="context_utilization"} | json | context_percentage > 50
出力: 使用率の高いセッション、圧縮イベント、トークン効率。
analyze-repos
リポジトリ/プロジェクトのアクティビティ。
sum by (repo, tool) (count_over_time({job="claude_code_enhanced", event_type="tool_call"} | json [24h]))
出力: リポジトリごとのアクティビティ、プロジェクトごとのツールの使用状況、ブランチパターン。
generate-report
包括的な分析レポート(すべての側面)。 出力: エラー、パフォーマンス、コスト、セッション、会話、ツールを含むMarkdownレポート。
主要なクエリ
拡張テレメトリ (Loki)
# すべてのイベント (過去1時間)
{job="claude_code_enhanced"} | json
# セッション分析
{job="claude_code_enhanced", event_type="session_end"} | json | duration_seconds > 300
# ツールのエラー
{job="claude_code_enhanced", event_type="tool_result", status="error"} | json
# 高いコンテキスト使用率
{job="claude_code_enhanced", event_type="context_utilization"} | json | context_percentage > 75
# サブエージェントの生成
{job="claude_code_enhanced", event_type="tool_call", tool="Task"} | json
# スキルの呼び出し
{job="claude_code_enhanced", event_type="skill_usage"} | json
# プロンプトパターン
{job="claude_code_enhanced", event_type="user_prompt"} | json | pattern="ultrathink"
# ツールのシーケンス
{job="claude_code_enhanced", event_type="tool_call"} | json | line_format "{{.tool_name}} → {{.previous_tool}}"
# コンテキストの圧縮
{job="claude_code_enhanced", event_type="context_compact"} | json
# 許可リクエスト
{job="claude_code_enhanced", event_type="permission_request"} | json
デフォルト OTEL (Prometheus)
# トークン使用量の合計 (7日間)
sum(increase(claude_code_token_usage[7d]))
# ツールごとのエラー率
sum by (tool_name) (rate(claude_code_tool_result{status="failure"}[1h]))
# P95 ツールのレイテンシ
histogram_quantile(0.95, claude_code_tool_duration_bucket)
# 1日のコスト
sum(increase(claude_code_cost_usage[24h]))
イベントタイプの参照
| イベントタイプ | 説明 | キーフィールド |
|---|---|---|
session_start |
セッションの初期化 | source, permission_mode |
session_end |
セッションの終了 | duration_seconds, turn_count, tools_used |
user_prompt |
ユーザーが送信したメッセージ | pattern, prompt_length, estimated_tokens |
tool_call |
ツールの呼び出し | tool_name, tool_details, sequence_position |
tool_result |
ツールの完了 | status, response_length, is_error |
skill_usage |
スキルの呼び出し | skill_name |
context_utilization |
トークンの見積もり | estimated_session_tokens, context_percentage |
context_compact |
圧縮イベント | trigger (manual/auto) |
subagent_complete |
タスクエージェントの完了 | total_subagents |
permission_request |
許可ダイアログ | notification_type |
notification |
システム通知 | notification_type |
Grafana ダッシュボード
- Claude Code Overview - 高レベルのメトリクス
- Tool Performance - ツールのレイテンシと成功率
- Cost Analysis - トークンの使用量とコスト
- Error Tracking - エラーパターンとトレンド
- Session Analytics - セッションレベルの洞察
- Enhanced Analytics - モデル/スキル/コンテキスト/リポジトリの追跡
- Deep Analytics - 包括的な会話とツールの分析
A
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Observability Analyzer
Query Claude Code telemetry and generate insights from metrics, logs, and traces. Works with both default OTEL telemetry and enhanced hook-based telemetry.
Data Sources
| Source | Job Name | Contains |
|---|---|---|
| Default OTEL | claude_code |
API metrics, token usage, costs |
| Enhanced Hooks | claude_code_enhanced |
Sessions, conversations, tools, subagents |
Operations
query-metrics <promql>
Execute PromQL query against Prometheus.
query-metrics 'sum(claude_code_token_usage)[7d]'
query-logs <logql>
Execute LogQL query against Loki.
query-logs '{job="claude_code_enhanced", event_type="tool_call"} | json' --since 24h
analyze-errors
Detect and group error patterns from enhanced telemetry.
{job="claude_code_enhanced", event_type="tool_result", status="error"} | json
Output: Error types, frequencies, affected tools, recommendations.
analyze-performance
Identify slow operations and response sizes.
{job="claude_code_enhanced", event_type="tool_result"} | json | response_length > 50000
Output: Large responses, estimated token costs, slow patterns.
analyze-costs
Calculate token usage from content size estimates.
sum by (repo) (sum_over_time({job="claude_code_enhanced", event_type="context_utilization"} | json | unwrap estimated_session_tokens [24h]))
Output: Token estimates by repo, session costs, projections.
analyze-tools
Tool usage statistics and sequences.
sum by (tool) (count_over_time({job="claude_code_enhanced", event_type="tool_call"} | json [24h]))
Output: Call frequency, success rates, tool sequences, common patterns.
analyze-sessions
Session lifecycle and duration analytics.
{job="claude_code_enhanced", event_type="session_end"} | json
Output: Session durations, turn counts, tools per session, termination reasons.
analyze-conversations
Conversation and prompt analytics.
sum by (pattern) (count_over_time({job="claude_code_enhanced", event_type="user_prompt"} | json [24h]))
Output: Prompt patterns (question/debugging/creation/ultrathink), turn distribution.
analyze-subagents
Subagent/Task tool usage.
{job="claude_code_enhanced", event_type="tool_call", tool="Task"} | json
Output: Subagent types used, completion rates, parallel execution patterns.
analyze-skills
Skill invocation analytics.
sum by (skill_name) (count_over_time({job="claude_code_enhanced", event_type="skill_usage"} | json [24h]))
Output: Most used skills, skill usage by repo, trends.
analyze-context
Context window utilization.
{job="claude_code_enhanced", event_type="context_utilization"} | json | context_percentage > 50
Output: High utilization sessions, compaction events, token efficiency.
analyze-repos
Repository/project activity.
sum by (repo, tool) (count_over_time({job="claude_code_enhanced", event_type="tool_call"} | json [24h]))
Output: Activity per repo, tool usage by project, branch patterns.
generate-report
Comprehensive analysis report (all dimensions). Output: Markdown report with errors, performance, costs, sessions, conversations, tools.
Key Queries
Enhanced Telemetry (Loki)
# All events (last hour)
{job="claude_code_enhanced"} | json
# Session analytics
{job="claude_code_enhanced", event_type="session_end"} | json | duration_seconds > 300
# Tool errors
{job="claude_code_enhanced", event_type="tool_result", status="error"} | json
# High context usage
{job="claude_code_enhanced", event_type="context_utilization"} | json | context_percentage > 75
# Subagent spawns
{job="claude_code_enhanced", event_type="tool_call", tool="Task"} | json
# Skill invocations
{job="claude_code_enhanced", event_type="skill_usage"} | json
# Prompt patterns
{job="claude_code_enhanced", event_type="user_prompt"} | json | pattern="ultrathink"
# Tool sequences
{job="claude_code_enhanced", event_type="tool_call"} | json | line_format "{{.tool_name}} → {{.previous_tool}}"
# Context compaction
{job="claude_code_enhanced", event_type="context_compact"} | json
# Permission requests
{job="claude_code_enhanced", event_type="permission_request"} | json
Default OTEL (Prometheus)
# Total token usage (7 days)
sum(increase(claude_code_token_usage[7d]))
# Error rate by tool
sum by (tool_name) (rate(claude_code_tool_result{status="failure"}[1h]))
# P95 tool latency
histogram_quantile(0.95, claude_code_tool_duration_bucket)
# Daily costs
sum(increase(claude_code_cost_usage[24h]))
Event Types Reference
| Event Type | Description | Key Fields |
|---|---|---|
session_start |
Session initialization | source, permission_mode |
session_end |
Session termination | duration_seconds, turn_count, tools_used |
user_prompt |
User message submitted | pattern, prompt_length, estimated_tokens |
tool_call |
Tool invocation | tool_name, tool_details, sequence_position |
tool_result |
Tool completion | status, response_length, is_error |
skill_usage |
Skill invoked | skill_name |
context_utilization |
Token estimate | estimated_session_tokens, context_percentage |
context_compact |
Compaction event | trigger (manual/auto) |
subagent_complete |
Task agent finished | total_subagents |
permission_request |
Permission dialog | notification_type |
notification |
System notification | notification_type |
Grafana Dashboards
- Claude Code Overview - High-level metrics
- Tool Performance - Tool latencies and success rates
- Cost Analysis - Token usage and costs
- Error Tracking - Error patterns and trends
- Session Analytics - Session-level insights
- Enhanced Analytics - Model/skill/context/repo tracking
- Deep Analytics - Comprehensive conversation and tool analysis
Access: http://localhost:3000 (admin/admin)
Scripts
scripts/query-prometheus.sh- PromQL query helperscripts/query-loki.sh- LogQL query helperscripts/analyze-errors.sh- Error analysis automationscripts/analyze-sessions.sh- Session analyticsscripts/generate-report.sh- Full analysis report