.agent/skills/monitoring-expert/SKILL.md
Monitoring and observability expert. Logging, metrics, error tracking, health checks. Use for production monitoring setup.
npx skillsauth add ripgraphics/authorsinfo monitoring-expertInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
// Using Pino (fast)
import pino from 'pino';
const logger = pino({
level: process.env.LOG_LEVEL || 'info',
transport: process.env.NODE_ENV !== 'production'
? { target: 'pino-pretty' }
: undefined
});
// Usage
logger.info({ userId: 123 }, 'User logged in');
logger.error({ err, requestId }, 'Failed to process');
// Express middleware
import pinoHttp from 'pino-http';
app.use(pinoHttp({ logger }));
import * as Sentry from '@sentry/node';
Sentry.init({
dsn: process.env.SENTRY_DSN,
environment: process.env.NODE_ENV,
tracesSampleRate: 0.1,
});
// Capture errors
try {
riskyOperation();
} catch (error) {
Sentry.captureException(error);
throw error;
}
// Express error handler
app.use(Sentry.Handlers.errorHandler());
// /health endpoint
app.get('/health', async (req, res) => {
const health = {
status: 'ok',
timestamp: new Date().toISOString(),
uptime: process.uptime(),
checks: {
database: await checkDatabase(),
redis: await checkRedis(),
}
};
const isHealthy = Object.values(health.checks).every(v => v === 'ok');
res.status(isHealthy ? 200 : 503).json(health);
});
async function checkDatabase() {
try {
await prisma.$queryRaw`SELECT 1`;
return 'ok';
} catch { return 'error'; }
}
import promClient from 'prom-client';
// Default metrics
promClient.collectDefaultMetrics();
// Custom metrics
const httpRequestDuration = new promClient.Histogram({
name: 'http_request_duration_seconds',
help: 'HTTP request duration',
labelNames: ['method', 'route', 'status'],
});
// Middleware
app.use((req, res, next) => {
const end = httpRequestDuration.startTimer();
res.on('finish', () => {
end({ method: req.method, route: req.path, status: res.statusCode });
});
next();
});
// Endpoint
app.get('/metrics', async (req, res) => {
res.set('Content-Type', promClient.register.contentType);
res.end(await promClient.register.metrics());
});
# Check logs
journalctl -u myapp -f --since "1 hour ago"
docker logs -f --tail 100 container_name
# Check resources
htop
df -h
free -m
# Network
netstat -tlnp
ss -tlnp
curl -I http://localhost:3000/health
tools
Webpack build optimization expert with deep knowledge of configuration patterns, bundle analysis, code splitting, module federation, performance optimization, and plugin/loader ecosystem. Use PROACTIVELY for any Webpack bundling issues including complex optimizations, build performance, custom plugins/loaders, and modern architecture patterns. If a specialized expert is a better fit, I will recommend switching and stop.
development
Web application security expert. OWASP Top 10, XSS, SQLi, CSRF, SSRF, authentication bypass, IDOR. Use for web app security testing.
testing
Vitest testing framework expert for Vite integration, Jest migration, browser mode testing, and performance optimization
tools
Vite build optimization expert with deep knowledge of ESM-first development, HMR optimization, plugin ecosystem, production builds, library mode, and SSR configuration. Use PROACTIVELY for any Vite bundling issues including dev server performance, build optimization, plugin development, and modern ESM patterns. If a specialized expert is a better fit, I will recommend switching and stop.