home / skills / andrelandgraf / fullstackrecipes / observability-monitoring

observability-monitoring skill

/skills/observability-monitoring

This skill helps you implement a complete observability stack with structured logging, error tracking, and web analytics for robust production apps.

npx playbooks add skill andrelandgraf/fullstackrecipes --skill observability-monitoring

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.8 KB
---
name: observability-monitoring
description: Complete observability stack with structured logging, error tracking, and web analytics.
---

# Observability & Monitoring

Complete observability stack with structured logging, error tracking, and web analytics.

## Cookbook - Complete These Recipes in Order

### Pino Logging Setup

Configure structured logging with Pino. Outputs human-readable colorized logs in development and structured JSON in production for log aggregation services.

```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/pino-logging-setup
```

### Sentry Setup

Configure Sentry for error tracking, performance monitoring, and log aggregation. Integrates with Pino to forward logs to Sentry automatically.

```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/sentry-setup
```

### Vercel Web Analytics

Add privacy-focused web analytics with Vercel Web Analytics. Track page views, visitors, and custom events with zero configuration.

```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/vercel-analytics-setup
```

### Working with Logging

Use structured logging with Pino throughout your application. Covers log levels, context, and workflow-safe logging patterns.

```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/using-logging
```

### Working with Sentry

Capture exceptions, add context, create performance spans, and use structured logging with Sentry.

```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/using-sentry
```

### Working with Analytics

Track custom events and conversions with Vercel Web Analytics. Covers common events, form tracking, and development testing.

```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/using-analytics
```

Overview

This skill provides a complete observability stack for full-stack TypeScript web apps, combining structured logging, error tracking, and privacy-focused web analytics. It bundles production-ready patterns and step-by-step recipes to get Pino, Sentry, and Vercel Web Analytics integrated quickly and consistently. The goal is reliable runtime visibility, faster incident response, and safe analytics without compromising user privacy.

How this skill works

The skill configures Pino for structured, environment-aware logging (human-friendly in development, JSON in production) and links those logs into Sentry for centralized error and performance tracking. It includes instrumentation recipes for capturing exceptions, performance spans, and contextual metadata. Vercel Web Analytics is added for lightweight, zero-config page views and custom event tracking to measure user behavior and conversions while respecting privacy.

When to use it

  • You need consistent, structured logs across services and environments.
  • You want automated error aggregation, performance tracing, and alert-ready context.
  • You need privacy-first web analytics with minimal setup and no third-party cookie concerns.
  • You want end-to-end observability for production AI-enabled web apps.
  • You need reproducible, opinionated recipes for onboarding observability in a team.

Best practices

  • Use Pino for all server-side logs and attach contextual fields (request id, user id, env) to each entry.
  • Forward critical logs to Sentry and enrich Sentry events with structured metadata and performance spans.
  • Keep development logging readable (colorized) and ensure production logs remain strict JSON for aggregation.
  • Instrument important user flows with custom analytics events and verify them in a staging environment.
  • Limit sensitive data in logs and analytics; redact PII and follow privacy regulations.

Example use cases

  • Set up Pino to emit JSON logs in production and colorized logs locally for a Node API server.
  • Integrate Sentry to capture uncaught exceptions and attach request/user context for faster debugging.
  • Forward Pino output to Sentry so errors include original structured log data and stack traces.
  • Add Vercel Web Analytics to track page views, sign-up conversions, and custom feature events without third-party trackers.
  • Use the recipes sequentially to onboard a new project: Pino → Sentry → Analytics, then instrument key routes and background jobs.

FAQ

Do I need Vercel to use the analytics recipe?

Vercel Web Analytics is optimized for Vercel deployments but the recipes show how to instrument client-side events; if you use another host, choose a compatible privacy-first analytics provider.

How do logs get from Pino into Sentry?

The setup uses a Pino transport or integration to forward selected log levels and structured payloads to Sentry, preserving context and enabling rich error events.