pino-otel-sentry

Implements Pino logging, OpenTelemetry tracing, and Sentry error tracking for Node.js services.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/gengirish/dropflow --skill pino-otel-sentry-gengirish
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: pino-otel-sentry
Source: https://github.com/gengirish/dropflow/tree/main/.cursor/skills/pino-otel-sentry
Command: npx skills add https://github.com/gengirish/dropflow --skill pino-otel-sentry-gengirish

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pino, pino-pretty, @opentelemetry/sdk-node, @opentelemetry/auto-instrumentations-node, @opentelemetry/exporter-trace-otlp-http, @sentry/nextjs, @sentry/node.

What problem does it solve? Node.js services often lack consistent observability, making it hard to correlate logs, traces, and errors across API routes and worker jobs. This Skill provides a unified setup for structured logging, distributed tracing, and error reporting with PII protection built in. ## Core Features & Use Cases - Structured Pino Logging: Configures Pino with pino-pretty for development, PII redaction for emails and phone numbers, and child loggers that propagate tenantId and traceId through every request. - OpenTelemetry Distributed Tracing: Sets up the NodeSDK with auto-instrumentation for HTTP, Express, PostgreSQL, and ioredis, exporting traces via OTLP. - Sentry Error Tracking: Integrates @sentry/nextjs and @sentry/node with PII scrubbing in beforeSend and sampled tracing to control costs. - Use Case: When adding a new API route to a Next.js app, wrap the handler in try/catch, create a request-scoped child logger with tenantId and traceId, and capture exceptions in Sentry with contextual metadata. ## Quick Start Ask the AI to add Pino structured logging with tenantId and traceId context plus Sentry error capture to a specific API route or worker job.

Frequently Asked Questions about pino-otel-sentry

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add structured logging to a Node.js API route with Pino?▼

Create a Pino logger with a redact config for PII fields, then use child loggers via logger.child({ tenantId, traceId }) per request. Log entries follow a consistent shape with action, tenantId, traceId, and durationMs fields.

How to set up OpenTelemetry tracing in a Node.js worker?▼

Initialize the NodeSDK from @opentelemetry/sdk-node with an OTLPTraceExporter and auto-instrumentations for HTTP, Express, pg, and ioredis. Load it before application code using the node --require flag pointing to the compiled instrumentation file.

Does Sentry Next.js integration support PII scrubbing?▼

Yes, use the beforeSend hook in Sentry.init to delete sensitive fields like user email and ip_address before events are sent. Combine this with a low tracesSampleRate such as 0.1 in production to control costs.

How do I correlate logs and traces across requests?▼

Include tenantId and traceId in every log entry by creating a child logger per request with createRequestLogger. OpenTelemetry auto-instrumentation propagates trace context across HTTP, database, and Redis calls automatically.

Why should console.log be avoided in production Node.js services?▼

console.log produces unstructured output that cannot be redacted, correlated, or queried by log aggregation systems. Pino provides structured JSON logs with field redaction and consistent metadata like service name and log level.