Command Palette

Search for a command to run...

YepAPI
Free · All Tools

Logging & Monitoring Agent Skill

Structured logging, Sentry error tracking, Axiom/Datadog integration, log levels, alerting.

loggingsentrymonitoringobservability

The Skill

Full content, every format. Copy it, download it, or install with one command.

SKILL.md
---
description: Structured logging, Sentry error tracking, Axiom/Datadog integration, log levels, alerting.
homepage: https://yepapi.com/skills/logging-monitoring
metadata:
  tags: [logging, sentry, monitoring, observability]
---

# Logging & Monitoring

## Rules

- Structured logging: JSON format with `timestamp`, `level`, `message`, `requestId`, `userId` fields
- Log levels: `error` (broken), `warn` (degraded), `info` (business events), `debug` (development only)
- Use Pino for Node.js logging — fast, structured, JSON by default
- Sentry for error tracking: initialize early, capture unhandled exceptions, add user context and breadcrumbs
- Correlate logs with request IDs — generate a UUID per request, pass through all service calls
- Never log secrets, passwords, tokens, or full credit card numbers — redact sensitive fields
- Alert on error rate spikes, not individual errors — use thresholds (e.g., >5% error rate in 5 min)
- Axiom/Datadog: ship logs via OTLP or native SDK, add custom metrics for business KPIs
- Health check endpoint: `GET /health` returning `{ status: "ok" }` with DB connectivity check
- Monitor response times at p50, p95, p99 — alert on p95 degradation

## Patterns

```ts
// Pino structured logging
import pino from "pino";
const logger = pino({ level: process.env.LOG_LEVEL || "info" });

logger.info({ userId, action: "checkout", orderId }, "Order placed");
logger.error({ err, requestId }, "Payment processing failed");
```

```ts
// Sentry init (Next.js)
import * as Sentry from "@sentry/nextjs";
Sentry.init({ dsn: process.env.SENTRY_DSN, tracesSampleRate: 0.1 });
```

## Avoid

- `console.log` in production — use a structured logger
- Logging every request body — log summaries, not payloads
- Ignoring unhandled promise rejections — always capture them
- Alert fatigue from noisy alerts — tune thresholds, group similar errors

Install

Why Use the Logging & Monitoring Skill?

Without this skill, your AI guesses at logging & monitoring patterns. It might hallucinate deprecated APIs, use outdated conventions, or miss best practices entirely. With it, your AI follows a proven ruleset — every suggestion aligns with current standards.

Drop this skill into your project and your AI instantly knows the rules. Better code suggestions, fewer errors, faster shipping.

Try These Prompts

These prompts work better with the Logging & Monitoring skill installed. Your AI knows the context and writes code that fits.

"Set up structured logging with Sentry error tracking and Axiom log aggregation"

"Create a monitoring dashboard with log levels, error rates, and alerting rules"

"Build an observability stack with request tracing, performance metrics, and anomaly detection"

Logging & Monitoring skill — FAQ

It provides structured logging, Sentry error tracking, and Axiom/Datadog integration patterns. Your AI sets up observability with proper log levels, alerting, and error grouping.

Run `npx skills add YepAPI/skills --skill logging-monitoring` in your project root. This copies the skill file into your repo where your AI coding tool can read it automatically.

Use Sentry for error tracking and Axiom or Datadog for log aggregation and metrics. The skill covers Sentry for exception monitoring and structured logging that works with any log aggregator.

Want more skills?

Browse all 110 free skills for builders.

See All Skills