Skip to main content
observability-monitoring Production visibility through logs, metrics, traces, and alerting โ the three pillars of observability
Ir a la instalaciรณn Skills Marketplace Descubre y explora habilidades de IA creadas por la comunidad.
Instalar con Codex o Claude Copia este prompt, pรฉgalo en Codex, Claude u otro asistente, y deja que revise la pรกgina de la skill y la instale por ti.
Copiar promptMostrar detalles del prompt Un comando directo omite el prompt de revisiรณn. Revisa el origen antes de ejecutarlo.
npx skills add https://github.com/fabioc-aloha/Alex_Plug_In --skill observability-monitoringEl comando permanece en una sola lรญnea. Desplรกzate horizontalmente para revisarlo antes de copiarlo.
ยฟPrefieres una copia local? Descarga los archivos que SkillsMP tiene disponibles ahora.
Descargar Zip Descargando... SOC
Basado en la clasificaciรณn ocupacional SOC
name observability-monitoring description Production visibility through logs, metrics, traces, and alerting โ the three pillars of observability tier standard applyTo **/*observ*,**/*monitor*,**/*telemetry*,**/*logging*,**/*metrics*,**/*traces*
Observability & Monitoring Skill
See what's happening in production. Debug without reproducing. Understand system behavior at scale.
The Three Pillars
Pillar What When Tools Logs Discrete events Debugging, auditing Winston, Pino, Serilog Metrics Aggregated measurements Alerting, dashboards Prometheus, CloudWatch Traces Request flow across services Distributed debugging Jaeger, Zipkin
Modern approach: OpenTelemetry unifies all three.
Logging Best Practices
Structured Logging
console .log ( );
logger. ( , {
userId,
buttonId,
: . (),
: ctx.
});
`User ${userId} clicked button ${buttonId} `
info
'Button clicked'
timestamp
Date
now
sessionId
sessionId
Log Levels Level Usage Example ERROR Something failed, needs attention Payment failed WARN Unexpected but handled Retry succeeded INFO Business events User logged in DEBUG Developer details Cache hit/miss TRACE Verbose internals Function entry/exit
Correlation IDs Track requests across services:
app.use ((req, res, next ) => {
req.traceId = req.headers ['x-trace-id' ] || uuid ();
res.setHeader ('x-trace-id' , req.traceId );
next ();
});
logger.info ('Processing request' , { traceId : req.traceId , ...data });
Metrics Patterns
The RED Method (Request-focused)
R ate: Requests per second
E rrors: Failed requests per second
D uration: Request latency distribution
The USE Method (Resource-focused)
U tilization: % time resource busy
S aturation: Queue depth
E rrors: Error count
Key Metric Types Type Use Case Example Counter Cumulative totals requests_total Gauge Current value temperature, queue_size Histogram Value distribution request_duration_seconds Summary Quantiles response_time_p99
Golden Signals (SRE)
Latency โ Time to serve request
Traffic โ Demand on system
Errors โ Failed requests rate
Saturation โ How full is the system
Distributed Tracing
Span Structure Trace: user-checkout-abc123
โโโ Span: api-gateway (50ms)
โ โโโ Span: auth-service (10ms)
โ โโโ Span: order-service (35ms)
โ โโโ Span: inventory-check (8ms)
โ โโโ Span: payment-service (20ms)
โ โโโ Span: database-write (5ms)
Context Propagation
import { trace, context, propagation } from '@opentelemetry/api' ;
const ctx = propagation.extract (context.active (), req.headers );
const span = tracer.startSpan ('process-order' , undefined , ctx);
propagation.inject (context.active (), headers);
OpenTelemetry Setup
Node.js Quick Start
import { NodeSDK } from '@opentelemetry/sdk-node' ;
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node' ;
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http' ;
const sdk = new NodeSDK ({
traceExporter : new OTLPTraceExporter ({
url : 'http://localhost:4318/v1/traces' ,
}),
instrumentations : [getNodeAutoInstrumentations ()],
});
sdk.start ();
.NET Quick Start
builder.Services.AddOpenTelemetry()
.WithTracing(tracing => tracing
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddOtlpExporter());
Alerting Strategy
Alert Hierarchy Severity Response Example P1/Critical Wake someone up Service down P2/High Fix within hours Error rate > 5% P3/Medium Fix within days Disk 80% P4/Low Fix when convenient Deprecation warning
Alert Anti-Patterns โ Alert fatigue โ Too many non-actionable alerts
โ Missing runbook โ Alert with no remediation steps
โ Threshold-only โ Alert on static value, not trend
โ No owner โ Alert goes to void
Good Alert Template alert: HighErrorRate
expr: sum(rate(http_errors_total[5m])) / sum(rate(http_requests_total[5m])) > 0.05
for: 5m
labels:
severity: high
team: backend
annotations:
summary: "Error rate above 5%"
runbook: "https://runbooks.example.com/high-error-rate"
dashboard: "https://grafana.example.com/d/errors"
Dashboard Design
Layout Principles โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ SERVICE HEALTH โ
โ [Status] [Error Rate] [Latency P50] [Latency P99] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ TRAFFIC โ
โ [Requests/sec graph over time] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ERRORS โ LATENCY โ
โ [Error breakdown by type] โ [Latency histogram] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ RESOURCES โ
โ [CPU] [Memory] [Disk] [Network] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Dashboard Hierarchy
Overview โ Executive view, all services
Service โ Single service deep dive
Debug โ Detailed metrics for investigation
Cloud Provider Tools Cloud Metrics Logs Traces Azure Azure Monitor Log Analytics App Insights AWS CloudWatch CloudWatch Logs X-Ray GCP Cloud Monitoring Cloud Logging Cloud Trace
Azure Application Insights
import { useAzureMonitor } from '@azure/monitor-opentelemetry' ;
useAzureMonitor ({
azureMonitorExporterOptions : {
connectionString : process.env .APPLICATIONINSIGHTS_CONNECTION_STRING
}
});
VS Code Extension Observability For VS Code extensions like Alex:
What to Monitor Metric Why Command execution time User experience Activation time Startup performance Error rates by command Reliability Memory usage Resource efficiency API call latency External dependencies
Telemetry Implementation import * as vscode from 'vscode' ;
const telemetry = vscode.env .createTelemetryLogger ({
sendEventData (eventName, data ) {
},
sendErrorData (error, data ) {
}
});
telemetry.logUsage ('command.executed' , {
commandId : 'alex.meditate' ,
durationMs : 1500
});
Debugging Patterns
Log-Driven Debugging
Find error in logs
Get correlation ID
Search all logs with that ID
Reconstruct timeline
Trace-Driven Debugging
Find slow/failed trace
Examine span waterfall
Identify bottleneck span
Drill into that service
Metric-Driven Debugging
Notice anomaly in dashboard
Correlate with other metrics
Narrow time window
Switch to logs/traces for details
Implementation Checklist
New Service
Production Readiness
Related Skills
performance-profiling โ Deep dive into specific bottlenecks
incident-response โ Using observability during outages
infrastructure-as-code โ Deploying monitoring stack
security-review โ Audit logging requirements
"If you can't measure it, you can't improve it." โ Peter Drucker
Good observability means finding the problem before your users do.