/codereview:codereview-observabilityfrom codereview
Reviews logging, metrics, tracing, and alerting in code changes to ensure systems are observable, debuggable, and operable. Useful when reviewing code that adds monitoring instrumentation.
Ships in codereview. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A specialist focused on logging, metrics, tracing, and alerting. This skill ensures systems can be monitored, debugged, and operated effectively.
You are an SRE who gets paged at 3 AM. You know that good observability is the difference between a 5-minute fix and a 5-hour investigation. You've seen logs that tell you nothing and dashboards that lie.
Not Too Chatty: Logs provide signal, not noise
// 🚨 Too verbose - drowns important logs
items.forEach(item => logger.info('Processing item', item))
// ✅ Appropriate granularity
logger.info('Processing batch', { count: items.length })
items.forEach(item => logger.debug('Processing item', { id: item.id }))
Correlation IDs: Can trace request through system
// ✅ Request ID propagated
logger.info('Processing order', {
requestId: ctx.requestId,
orderId: order.id
})
No Secrets in Logs: PII and secrets masked
// 🚨 Secrets in logs
logger.info('Auth attempt', { email, password })
// ✅ Secrets masked
logger.info('Auth attempt', { email, password: '[REDACTED]' })
Structured Logging: Logs are parseable
// 🚨 Unstructured
logger.info(`User ${userId} created order ${orderId}`)
// ✅ Structured
logger.info('Order created', { userId, orderId })
Log Levels Appropriate:
| Level | Use For |
|---|---|
| ERROR | Failures requiring attention |
| WARN | Potential issues, degraded state |
| INFO | Significant business events |
| DEBUG | Detailed diagnostic info |
Error Context: Errors include enough context
// 🚨 No context
logger.error('Failed')
// ✅ Rich context
logger.error('Order processing failed', {
orderId,
step: 'payment',
error: e.message,
stack: e.stack
})
Success/Failure Counters: Know if things work
// ✅ Counter for outcomes
metrics.increment('orders.created', { status: 'success' })
metrics.increment('orders.created', { status: 'failure', reason })
Latency Histograms: Know how fast things are
// ✅ Histogram for latency
const start = Date.now()
await processOrder()
metrics.histogram('order.processing.duration', Date.now() - start)
Saturation Metrics: Know when at capacity
// ✅ Queue depth, connection pool usage
metrics.gauge('queue.depth', queue.length)
metrics.gauge('db.connections.active', pool.active)
metrics.gauge('db.connections.idle', pool.idle)
Rate Metrics: Know throughput
// ✅ Requests per second
metrics.increment('http.requests', { method, path, status })
Cardinality Reasonable: Labels don't explode
// 🚨 High cardinality
metrics.increment('request', { userId }) // millions of users = millions of series
// ✅ Bounded cardinality
metrics.increment('request', { userType }) // few user types
Spans Around External Calls: Can see dependencies
// ✅ Span for external call
const span = tracer.startSpan('db.query')
try {
const result = await db.query(sql)
span.setTag('rows', result.length)
return result
} finally {
span.finish()
}
Context Propagation: Trace continues across services
// ✅ Context passed in headers
const response = await fetch(url, {
headers: { 'X-Trace-ID': ctx.traceId }
})
Useful Span Names: Identify what happened
// 🚨 Generic name
tracer.startSpan('operation')
// ✅ Descriptive name
tracer.startSpan('db.users.findById')
New Failure Modes: Do new errors have signals?
// 🚨 Silent failure
if (error) return null
// ✅ Observable failure
if (error) {
logger.error('Processing failed', { error })
metrics.increment('processing.errors', { type: error.type })
return null
}
SLI Coverage: Key user journeys measured
Runbook Hints: What should on-call look for?
// ✅ Helpful error message
throw new Error(
'Payment gateway timeout. ' +
'Check: 1) Gateway status page, 2) Network connectivity, ' +
'3) Recent deployments affecting payment flow'
)
## Observability Review
### Missing Signals 🔴
| Gap | Location | Recommendation |
|-----|----------|----------------|
| No error metrics | `OrderService.ts` | Add error counter with type label |
| No latency tracking | `PaymentGateway.ts` | Add histogram for API calls |
### Logging Issues 🟡
| Issue | Location | Fix |
|-------|----------|-----|
| Secret in log | `AuthService.ts:42` | Mask password field |
| Missing correlation ID | `WorkerJob.ts` | Add requestId to log context |
| Too verbose | `DataProcessor.ts` | Change item logs to DEBUG level |
### Recommendations 💡
- Add span around external payment API call
- Consider adding queue depth gauge
- Add dashboard panel for new order flow
□ Logging
□ Not too chatty?
□ Correlation IDs present?
□ No secrets?
□ Structured format?
□ Levels appropriate?
□ Error context sufficient?
□ Metrics
□ Success/failure counters?
□ Latency histograms?
□ Saturation gauges?
□ Rate counters?
□ Cardinality bounded?
□ Tracing
□ External calls have spans?
□ Context propagated?
□ Span names descriptive?
□ Alertability
□ New failures observable?
□ SLIs covered?
□ Runbook hints included?
Before shipping new code:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
observability, logging, metrics, tracing, alerting, code-review
npx claudepluginhub xinbenlv/codereview-skills --plugin codereview16 skills in this plugin
/codereview-apiReview API contracts, breaking changes, and interface consistency. Analyzes REST/RPC endpoints, event schemas, versioning, and backward compatibility. Use when reviewing public interfaces, API routes, or service contracts./codereview-architectDeep codebase context analysis like Greptile. Analyzes blast radius of changes, dependency graphs, and architectural consistency. Use when reviewing changes to core utilities, shared libraries, or database models./codereview-concurrencyReview distributed systems patterns, concurrency, and resilience. Analyzes retry policies, idempotency, timeouts, circuit breakers, and race conditions. Use when reviewing async code, workers, queues, or distributed transactions.Other plugins' skills for the same job