dawiddutoit/custom-claude/observability-analyze-logs

Claude Code and agent skill by dawiddutoit/custom-claude

Trust tier 2
  • community
  • ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Source check pending

Checking that the SKILL.md file is still in the repository.

Parses OpenTelemetry-formatted logs to reconstruct execution traces, extract errors with call chains, and provide AI-powered root cause analysis. Use when investigating errors, checking logs, debugging issues, viewing traces, or analyzing execution flow. Triggers on "check the logs", "analyze errors", "what's failing", "debug this issue", "show me the traces", or "investigate the error".

Install

npx vskill@latest install dawiddutoit/custom-claude/observability-analyze-logs

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

Analyze Logs

Table of Contents

Core Sections
Advanced Topics
Supporting Resources

Purpose

Intelligent log analysis for any project using OpenTelemetry trace reconstruction and AI-powered error diagnosis. Parses OTEL-formatted logs, reconstructs execution traces, extracts errors with call chain context, and provides root cause analysis.

What This Skill Does

Intelligent log analysis for any project using OpenTelemetry trace reconstruction and AI-powered error diagnosis. Works with projects that generate OpenTelemetry-formatted logs in a configurable log directory.

Core capabilities:

  • Parse OpenTelemetry-formatted logs with trace/span IDs
  • Reconstruct complete execution traces
  • Extract errors with full call chain context
  • AI-powered root cause analysis
  • Multiple output formats (summary, markdown, JSON)
  • Advanced filtering (by error ID, trace ID, file)

When to Use This Skill

Invoke this skill when users mention:

  • "check the logs"
  • "look at the logs"
  • "analyze errors"
  • "what's failing?"
  • "debug this issue"
  • "show me the traces"
  • "investigate the error"
  • "view log file"
  • Any mention of project log files ({{LOG_DIR}}/{{LOG_FILE}}.log)

Quick Start

Most common usage (quick health check):

bash
python3 .claude/tools/utils/log_analyzer.py {{LOG_DIR}}/{{LOG_FILE}}.log

This gives you a summary table with error IDs and trace IDs, perfect for quick health checks. Replace {{LOG_DIR}} with your project's log directory (e.g., logs) and {{LOG_FILE}} with the log filename (e.g., app.log).

Instructions

Step 1: Determine User's Need

Quick Health Check:

  • User asks: "Are there any errors?" or "What's happening in the logs?"
  • Action: Run summary mode (default)

Specific Error Investigation:

  • User mentions specific error or asks for details
  • Action: Get error ID from summary, then use --error-id

Trace-Based Debugging:

  • User asks "what led to this error?" or wants execution flow
  • Action: Use --trace with trace ID

File-Specific Analysis:

  • User mentions specific file or module
  • Action: Use --file filter

Real-Time Monitoring:

  • User wants to watch logs as they happen
  • Action: Use tail -f
Step 2: Choose Analysis Mode

Mode 1: Summary (Default) - Start here 90% of the time

bash
python3 .claude/tools/utils/log_analyzer.py {{LOG_DIR}}/{{LOG_FILE}}.log

Output: Compact table with error IDs, trace IDs, file:line, function, and message preview.

Use when:

  • Initial investigation
  • Quick health check
  • Getting error IDs for deeper analysis
  • User asks "what errors do we have?"

Mode 2: Error Detail - Deep dive into specific error

bash
python3 .claude/tools/utils/log_analyzer.py --error-id 1 --format markdown

Output: Full error details including complete message, call chain, stack trace, related errors.

Use when:

  • User asks about specific error from summary
  • Need full error message (summary truncates)
  • Want to see complete stack trace
  • Investigating single failure

Mode 3: Trace Analysis - Understand execution flow

bash
python3 .claude/tools/utils/log_analyzer.py --trace TRACE_ID --format markdown

Output: All errors in that trace with full execution context.

Use when:

  • Multiple related errors in same trace
  • Need to understand execution sequence
  • Debugging distributed operations
  • User asks "what happened in this execution?"

Mode 4: File Filter - Find all errors in specific file

bash
python3 .claude/tools/utils/log_analyzer.py --file database.py --format markdown

Output: All errors from that file with trace context.

Use when:

  • User mentions specific file
  • Investigating module-specific issues
  • Finding patterns in one component

Mode 5: Fast Parsing (No AI) - Quick and free

bash
python3 .claude/tools/utils/log_analyzer.py --no-ai

Output: Same as summary but skips AI analysis (faster, no cost).

Use when:

  • Quick checks during development
  • Want to avoid LLM costs
  • Just need parsed errors without analysis
  • Automated scripts or frequent polling

Mode 6: Real-Time Monitoring

bash
tail -f {{LOG_DIR}}/{{LOG_FILE}}.log

Output: Live log stream (Ctrl+C to exit).

Use when:

  • Watching logs during testing
  • Monitoring server startup
  • Debugging in real-time
  • User runs operations and wants to see results
Step 3: Execute Analysis

Execute the appropriate command using the Bash tool:

bash
# Example for summary
python3 .claude/tools/utils/log_analyzer.py {{LOG_DIR}}/{{LOG_FILE}}.log
Step 4: Interpret Results

For Summary Output:

  1. Check "Total errors" count
  2. Scan error table for patterns (same file, same trace)
  3. Note error IDs for deeper investigation
  4. Use provided Quick Commands to drill down

For Detailed Output:

  1. Read Full Message (not truncated)
  2. Review Call Chain (execution flow leading to error)
  3. Check Related Errors (other failures in same trace)
  4. Examine Stack Trace (if available)
  5. Look for Recovery Attempts (logs after error)

For AI Analysis (markdown with --no-ai not set):

  1. Read Root Causes section
  2. Check Patterns (recurring issues)
  3. Review Priority (what to fix first)
  4. Follow Fixes (specific file:line changes)
  5. Consider Systemic Issues (larger architectural problems)
Step 5: Report Findings

Always provide:

  1. Summary of error count and severity
  2. Most critical issues (from AI analysis or your judgment)
  3. Specific file:line references for user to investigate
  4. Suggested next steps or commands to run

Example response format:

Found 5 errors in the logs:
Critical Issues:
1. Neo4j connection failure in database.py:123 (trace: abc123)
- Appears 3 times across different operations
- Root cause: Connection timeout after 5s
2. Invalid config in settings.py:45 (trace: def456)
- Missing required parameter 'api_key'
To investigate further:
- View error 1 details: python3 .claude/tools/utils/log_analyzer.py --error-id 1 --format markdown
- See all Neo4j errors: python3 .claude/tools/utils/log_analyzer.py --file database.py --format markdown

Command Reference

Basic Commands
bash
# Quick summary (default)
python3 .claude/tools/utils/log_analyzer.py {{LOG_DIR}}/{{LOG_FILE}}.log
# Detailed markdown with AI analysis
python3 .claude/tools/utils/log_analyzer.py --format markdown
# JSON output for programmatic use
python3 .claude/tools/utils/log_analyzer.py --format json
Filtering Commands
bash
# View specific error details (get ID from summary)
python3 .claude/tools/utils/log_analyzer.py --error-id 1 --format markdown
# View all errors in a trace
python3 .claude/tools/utils/log_analyzer.py --trace abc123def456 --format markdown
# Filter by file name
python3 .claude/tools/utils/log_analyzer.py --file database.py
# Combine filters
python3 .claude/tools/utils/log_analyzer.py --file database.py --trace abc123 --format markdown
Performance Commands
bash
# Skip AI analysis (faster, free)
python3 .claude/tools/utils/log_analyzer.py --no-ai
# Save to file instead of stdout
python3 .claude/tools/utils/log_analyzer.py --format markdown --output report.md
# Real-time log monitoring
tail -f {{LOG_DIR}}/{{LOG_FILE}}.log
# Last 50 lines
tail -n 50 {{LOG_DIR}}/{{LOG_FILE}}.log
# Follow and filter for errors
tail -f {{LOG_DIR}}/{{LOG_FILE}}.log | grep ERROR

Understanding the Output

Log Format

OpenTelemetry format with trace/span IDs:

2025-10-16 14:32:15 - [trace:abc123 | span:def456] - module.name - ERROR - [file.py:123] - function() - Error message

Key fields:

  • timestamp: When the log occurred
  • trace: Unique ID for entire execution (groups related logs)
  • span: Unique ID for operation within trace
  • module: Python module path
  • level: ERROR, WARNING, INFO, DEBUG
  • file:line: Source location
  • function: Function name
  • message: Log message
Summary Table
ID | Trace | File:Line | Function | Message
-----|------------|------------------------|-------------|------------------
1 | abc123 | database.py:45 | connect | Connection failed
2 | abc123 | database.py:67 | query | No active connection

Columns explained:

  • ID: Error number (use with --error-id)
  • Trace: First 8 chars of trace ID (same trace = related errors)
  • File:Line: Where error occurred
  • Function: Function that logged error
  • Message: Preview (truncated, use --error-id for full message)
Trace Execution

A trace represents one complete execution flow:

  • Starts at entry point (e.g., MCP tool call)
  • Includes all operations in that execution
  • Ends when execution completes
  • Multiple errors in same trace are related

Example trace flow:

Trace abc123:
1. automatic_indexing() [deprecated] called
2. connect_to_neo4j() called
3. ERROR: Connection timeout
4. retry_connection() called
5. ERROR: Retry failed

All errors share trace ID abc123, so they're related failures.

Best Practices

1. Always Start with Summary

Don't jump straight to markdown or detail view. Get the overview first:

bash
python3 .claude/tools/utils/log_analyzer.py {{LOG_DIR}}/{{LOG_FILE}}.log
2. Use Error IDs for Deep Dives

Summary gives you error IDs. Use them:

bash
# From summary, identify interesting error (e.g., ID 3)
python3 .claude/tools/utils/log_analyzer.py --error-id 3 --format markdown
3. Group Related Errors by Trace

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Refreshed 17 Mar 2026, 8 months ago.

Extension points

  • hookPre/post lifecycle hooks

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dawiddutoit/custom-claude/observability-analyze-logs/badge)](https://verified-skill.com/skills/dawiddutoit/custom-claude/observability-analyze-logs)

Something wrong with this skill or its page? Tell us.