{"id":20263,"library":"pino-sentry","title":"pino-sentry","description":"A transport (stream) for the pino logger that sends logs to Sentry via @sentry/node. Current stable version 0.15.0 supports pino v7+ and Sentry SDK v7. It works as a CLI tool or programmatic stream, exposing both createWriteStream and the Sentry instance directly. Release cadence is sporadic. Key differentiators: lightweight, simple integration, and exposes the underlying Sentry instance for advanced usage. Requires Node >=10 and @sentry/node as a peer dependency. Self-hosted Sentry users must be on 20.6.0+ with Sentry SDK v7.","status":"active","version":"0.15.0","language":"javascript","source_language":"en","source_url":"https://github.com/aandrewww/pino-sentry","tags":["javascript","logger","loggly","logging","node","tools","sentry","transport","pino","typescript"],"install":[{"cmd":"npm install pino-sentry","lang":"bash","label":"npm"},{"cmd":"yarn add pino-sentry","lang":"bash","label":"yarn"},{"cmd":"pnpm add pino-sentry","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for Sentry integration; must be installed separately.","package":"@sentry/node","optional":false}],"imports":[{"note":"ESM default export is not available; use named import. In CJS, destructure from require().","wrong":"const createWriteStream = require('pino-sentry').createWriteStream","symbol":"createWriteStream","correct":"import { createWriteStream } from 'pino-sentry'"},{"note":"Sentry is a named export, not default. In CJS, use destructuring.","wrong":"const Sentry = require('pino-sentry').default","symbol":"Sentry","correct":"import { Sentry } from 'pino-sentry'"},{"note":"Severity is a named export. In CJS, destructure it.","wrong":"const Severity = require('pino-sentry')","symbol":"Severity","correct":"import { Severity } from 'pino-sentry'"},{"note":"There is no default export in CommonJS; must destructure from the module.","wrong":"const createWriteStream = require('pino-sentry').default","symbol":"createWriteStream via CJS require","correct":"const { createWriteStream } = require('pino-sentry')"}],"quickstart":{"code":"import { createWriteStream } from 'pino-sentry';\nimport pino from 'pino';\n\nconst stream = createWriteStream({\n  dsn: process.env.SENTRY_DSN ?? '',\n  environment: process.env.NODE_ENV ?? 'production',\n  level: 'info',\n  maxBreadcrumbs: 50,\n});\n\nconst logger = pino({ level: 'info' }, stream);\n\nlogger.info({ msg: 'Hello from pino-sentry' });\nlogger.error({ err: new Error('Test error') }, 'Error occurred');","lang":"typescript","description":"Configures pino-sentry with a DSN and pino instance, logs a message and an error sent to Sentry."},"warnings":[{"fix":"Upgrade sentry self-hosted to 20.6.0+ or use pino-sentry versions prior to 0.15.0 with Sentry SDK v6.","message":"The Sentry SDK v7 requires self-hosted Sentry 20.6.0+. Older on-premise versions will fail.","severity":"gotcha","affected_versions":">=0.15.0"},{"fix":"Provide DSN via --dsn flag or SENTRY_DSN env var.","message":"CLI usage (pipe to pino-sentry) must call with --dsn or set SENTRY_DSN environment variable, otherwise it throws error.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Replace sampleRate with 'tracesSampleRate' in Sentry.init (outside pino-sentry options).","message":"The 'sampleRate' option as a percentage (0.0-1.0) is deprecated; use the 'tracesSampleRate' option directly on Sentry.init if needed.","severity":"deprecated","affected_versions":">=0.15.0"},{"fix":"Update @sentry/node to v7.x and ensure self-hosted Sentry >=20.6.0.","message":"Breaking change in v0.15.0: Removed support for @sentry/node v6. Only v7 is supported.","severity":"breaking","affected_versions":">=0.15.0"}],"env_vars":null,"search_vec":"'0.15.0':21 '10':66 '20.6.0':81 'advanc':62 'cadenc':47 'cli':33 'createwritestream':40 'current':18 'depend':72 'differenti':51 'direct':45 'expos':38,56 'host':75 'instanc':44,60 'integr':54 'javascript':86 'key':50 'lightweight':52 'log':13,89 'logg':88 'logger':10,87 'must':78 'node':65,90 'peer':71 'pino':2,9,23,94 'pino-sentri':1 'programmat':36 'releas':46 'requir':64 'sdk':27,84 'self':74 'self-host':73 'send':12 'sentri':3,15,26,43,59,76,83,92 'sentry/node':17,68 'simpl':53 'sporad':49 'stabl':19 'stream':6,37 'support':22 'tool':34,91 'transport':5,93 'typescript':95 'under':58 'usag':63 'user':77 'v7':24,28,85 'version':20 'via':16 'work':30","created_at":"2026-04-25T11:22:11.868150+00:00","updated_at":"2026-04-25T11:22:11.868150+00:00","problems":[{"fix":"Install it: npm install @sentry/node","cause":"Missing peer dependency @sentry/node.","error":"Cannot find module '@sentry/node'"},{"fix":"Upgrade @sentry/node to version ^7.0.0","cause":"Installed @sentry/node is v6, pino-sentry v0.15 requires v7.","error":"Sentry SDK version mismatch: expected v7 but got v6"},{"fix":"Use import { createWriteStream } from 'pino-sentry'","cause":"Incorrect import: using default import instead of named import.","error":"TypeError: createWriteStream is not a function"},{"fix":"Set SENTRY_DSN env var or pass dsn option to createWriteStream.","cause":"DSN is missing when using the CLI or creating the stream without setting 'dsn' option.","error":"Error: No DSN provided. Set SENTRY_DSN environment variable or pass --dsn"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/aandrewww/pino-sentry","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/pino-sentry","openapi_spec":null,"status_page":null,"smithery":null,"categories":["observability","communication"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}