본문으로 건너뛰기
cccskills
무료GitHub에 공개

omcustom:monitoring-setup

Enable/disable OpenTelemetry console monitoring for Claude Code usage tracking

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

실행 점수 미검증

설치 방법 보기

포함된 파일(1)

  • SKILL.md6.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Monitoring Setup Skill

Enable or disable OpenTelemetry console monitoring. When enabled, Claude Code outputs usage metrics (cost, tokens, sessions, LOC, commits, PRs, active time) and events (tool results, API requests) to the terminal.

Natural Language Triggers

This skill activates when the user mentions any of:

  • Korean: "모니터링", "텔레메트리", "사용량 추적", "메트릭", "모니터링 켜줘", "텔레메트리 활성화"
  • English: "monitoring", "telemetry", "usage tracking", "metrics", "enable monitoring"
  • Combined with actions: "켜", "끄", "활성화", "비활성화", "설정", "enable", "disable", "setup"

Commands

enable (default)

  1. Read .claude/settings.local.json (create if not exists)
  2. Add or update env field with:
    {
      "env": {
        "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
        "OTEL_METRICS_EXPORTER": "console",
        "OTEL_LOGS_EXPORTER": "console"
      }
    }
    
  3. Preserve all existing settings
  4. Report to user:
    [Done] OpenTelemetry Console Monitoring enabled
    
    Configured in: .claude/settings.local.json
    Metrics: sessions, cost, tokens, LOC, commits, PRs, active time
    Events: tool results, API requests, tool decisions
    
    Note: Takes effect on next `claude` session restart.
    To disable: /monitoring-setup disable
    

disable

  1. Read .claude/settings.local.json
  2. Remove OTel-related keys from env:
    • CLAUDE_CODE_ENABLE_TELEMETRY
    • OTEL_METRICS_EXPORTER
    • OTEL_LOGS_EXPORTER
  3. If env object becomes empty, remove env field entirely
  4. Report:
    [Done] OpenTelemetry Monitoring disabled
    
    Removed from: .claude/settings.local.json
    Takes effect on next session restart.
    

status

  1. Read .claude/settings.local.json
  2. Check for OTel env vars
  3. Report current state:
    [Monitoring Status]
    ├── Enabled: Yes/No
    ├── Metrics exporter: console / otlp / none
    ├── Logs exporter: console / otlp / none
    └── Config: .claude/settings.local.json
    

Implementation Notes

  • settings.local.json is NOT git-tracked (local to user)
  • Each user enables monitoring independently
  • No infrastructure required for console mode
  • Metrics appear in stderr during Claude Code execution
  • Default export interval: 60s for metrics, 5s for events

Available Metrics

MetricDescriptionUnit
claude_code.session.countCLI sessions startedcount
claude_code.cost.usageSession costUSD
claude_code.token.usageTokens used (input/output/cache)tokens
claude_code.lines_of_code.countCode lines modified (added/removed)count
claude_code.commit.countGit commits createdcount
claude_code.pull_request.countPull requests createdcount
claude_code.active_time.totalActive usage timeseconds

Available Events

EventDescription
claude_code.tool_resultTool execution results with duration
claude_code.api_requestAPI request details with cost/tokens
claude_code.api_errorAPI error details
claude_code.tool_decisionTool accept/reject decisions
claude_code.user_promptUser prompt metadata (content redacted by default)

Upgrade Path

For production monitoring, upgrade from console to OTLP:

# In settings.local.json env:
OTEL_METRICS_EXPORTER=otlp
OTEL_LOGS_EXPORTER=otlp
OTEL_EXPORTER_OTLP_PROTOCOL=grpc
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317

Advanced OTel Configuration

Additional Metrics

MetricDescriptionUnit
code_edit_tool.decisionEdit tool accept/reject decisionscount

Exporter Configuration

{
  "env": {
    "OTEL_METRICS_EXPORTER": "otlp",
    "OTEL_LOGS_EXPORTER": "otlp",
    "OTEL_EXPORTER_OTLP_PROTOCOL": "grpc",
    "OTEL_EXPORTER_OTLP_ENDPOINT": "http://localhost:4317",
    "OTEL_RESOURCE_ATTRIBUTES": "service.name=claude-code,service.version=2.1.85"
  }
}

Cardinality Controls

VariableDescriptionDefault
OTEL_LOG_TOOL_DETAILSInclude tool input/output in logsfalse
OTEL_METRICS_INCLUDE_TOOL_NAMEInclude tool name dimensiontrue
OTEL_METRICS_INCLUDE_MODELInclude model dimensiontrue

Multi-Exporter Syntax

# Send metrics to both console and OTLP
OTEL_METRICS_EXPORTER=console,otlp
OTEL_LOGS_EXPORTER=console,otlp

Prometheus Exporter

OTEL_METRICS_EXPORTER=prometheus
OTEL_EXPORTER_PROMETHEUS_PORT=9464

Data Privacy

Environment variables to control data collection and telemetry:

VariableDescription
DISABLE_TELEMETRYDisable all telemetry collection
DISABLE_ERROR_REPORTINGDisable error reporting to Anthropic
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICDisable non-essential network traffic
CLAUDE_CODE_DISABLE_FEEDBACK_SURVEYDisable feedback survey prompts
DO_NOT_TRACKStandard DNT signal

Enterprise Configuration

{
  "env": {
    "DISABLE_TELEMETRY": "1",
    "DISABLE_ERROR_REPORTING": "1",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}

HTTP-Level Inspection (Optional)

For deeper payload-level debugging beyond aggregated metrics, Claude Inspector provides MITM proxy inspection of Claude Code HTTP traffic.

AspectOTel Monitoring (this skill)Claude Inspector
LayerApplication (hooks, stdout)HTTP (MITM proxy)
MetricsAggregated (cost, tokens, duration)Per-request payload breakdown
Cache visibilityNot availablePrompt Cache hit/miss rates
Sub-agent viewSummary via hooksFull parent vs sub-agent context comparison
SetupBuilt-in (hooks + statusline)External tool (Homebrew on macOS)

When to Use

  • OTel monitoring: Daily operations, cost tracking, performance trends
  • Claude Inspector: Debugging specific payload issues, measuring CLAUDE.md token impact, verifying ecomode (R013) effectiveness, profiling sub-agent context inheritance

Setup

# macOS
brew install kangraemin/tap/claude-inspector

# Run proxy
claude-inspector

Claude Inspector is external to oh-my-customcode and does not require any project configuration changes.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Pre-action boundary checking — validates agent tool calls against declared capabilities and task contracts

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

baekenough/second-brain152026년 10월 8일 업데이트

Auto-detect project context and optimize harness — deactivate unused agents/skills, suggest missing experts, generate project profile

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

baekenough/second-brain152026년 10월 8일 업데이트

Adversarial code review using attacker mindset — trust boundary, attack surface, business logic, and defense evaluation

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

baekenough/second-brain152026년 10월 8일 업데이트

Apache Airflow best practices for DAG authoring, testing, and production deployment

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

baekenough/second-brain152026년 10월 8일 업데이트

Alembic migration patterns for naming conventions, safety checks, expand-contract, env.py configuration, and CI integration

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

baekenough/second-brain152026년 10월 8일 업데이트

Pre-routing ambiguity analysis — scores request clarity and asks clarifying questions when needed (inspired by ouroboros)

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

baekenough/second-brain152026년 10월 8일 업데이트

baekenough의 스킬 모두 보기

이 스킬의 문제 신고