Skip to content

feat(pino): Add initial package for @sentry/pino-transport #16652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ body:
- '@sentry/nestjs'
- '@sentry/nextjs'
- '@sentry/nuxt'
- '@sentry/pino-transport'
- '@sentry/react'
- '@sentry/react-router'
- '@sentry/remix'
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -112,6 +112,8 @@ below:
Provides the integration for Session Replay.
- [`@sentry/core`](https://github.com/getsentry/sentry-javascript/tree/master/packages/core): The base for all
JavaScript SDKs with interfaces, type definitions and base classes.
- [`@sentry/pino-transport`](https://github.com/getsentry/sentry-javascript/tree/master/packages/pino-transport): Pino
transport for automatically sending log messages to Sentry.

## Bug Bounty Program

6 changes: 6 additions & 0 deletions dev-packages/e2e-tests/verdaccio-config/config.yaml
Original file line number Diff line number Diff line change
@@ -110,6 +110,12 @@ packages:
unpublish: $all
# proxy: npmjs # Don't proxy for E2E tests!

'@sentry/pino-transport':
access: $all
publish: $all
unpublish: $all
# proxy: npmjs # Don't proxy for E2E tests!

'@sentry/profiling-node':
access: $all
publish: $all
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -70,6 +70,7 @@
"packages/node",
"packages/nuxt",
"packages/opentelemetry",
"packages/pino-transport",
"packages/profiling-node",
"packages/react",
"packages/react-router",
12 changes: 12 additions & 0 deletions packages/pino-transport/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
env: {
node: true,
},
extends: ['../../.eslintrc.js'],
overrides: [
{
files: ['src/**/*.ts'],
rules: {},
},
],
};
16 changes: 16 additions & 0 deletions packages/pino-transport/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
MIT License

Copyright (c) 2025 Functional Software, Inc. dba Sentry

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 changes: 31 additions & 0 deletions packages/pino-transport/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# @sentry/pino-transport

[![npm version](https://img.shields.io/npm/v/@sentry/pino-transport.svg)](https://www.npmjs.com/package/@sentry/pino-transport)
[![npm dm](https://img.shields.io/npm/dm/@sentry/pino-transport.svg)](https://www.npmjs.com/package/@sentry/pino-transport)
[![npm dt](https://img.shields.io/npm/dt/@sentry/pino-transport.svg)](https://www.npmjs.com/package/@sentry/pino-transport)

**This package is currently in alpha. Breaking changes may still occur.**

A Pino transport for integrating [Pino](https://github.com/pinojs/pino) logging with [Sentry](https://sentry.io). This transport automatically captures log messages as Sentry events and breadcrumbs, making it easy to monitor your application's logs in Sentry.

## Installation

```bash
npm install @sentry/node @sentry/pino-transport
# or
yarn add @sentry/node @sentry/pino-transport
```

## Usage

TODO: Add usage instructions

## Requirements

- Node.js 18 or higher
- Pino 8.0.0 or higher
- @sentry/node must be configured in your application

## License

MIT
77 changes: 77 additions & 0 deletions packages/pino-transport/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"name": "@sentry/pino-transport",
"version": "9.30.0",
"description": "Pino transport for Sentry SDK",
"repository": "git://github.com/getsentry/sentry-javascript.git",
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/pino-transport",
"author": "Sentry",
"license": "MIT",
"engines": {
"node": ">=18"
},
"files": [
"/build"
],
"main": "build/cjs/index.js",
"module": "build/esm/index.js",
"types": "build/types/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./build/types/index.d.ts",
"default": "./build/esm/index.js"
},
"require": {
"types": "./build/types/index.d.ts",
"default": "./build/cjs/index.js"
}
}
},
"typesVersions": {
"<5.0": {
"build/types/index.d.ts": [
"build/types-ts3.8/index.d.ts"
]
}
},
"publishConfig": {
"access": "public"
},
"dependencies": {
"@sentry/core": "9.30.0"
},
"peerDependencies": {
"pino": "^8.0.0 || ^9.0.0"
},
"devDependencies": {
"@types/node": "^18.19.1",
"pino": "^9.0.0"
},
"scripts": {
"build": "run-p build:transpile build:types",
"build:dev": "yarn build",
"build:transpile": "rollup -c rollup.npm.config.mjs",
"build:types": "run-s build:types:core build:types:downlevel",
"build:types:core": "tsc -p tsconfig.types.json",
"build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
"build:watch": "run-p build:transpile:watch build:types:watch",
"build:dev:watch": "yarn build:watch",
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
"build:types:watch": "tsc -p tsconfig.types.json --watch",
"build:tarball": "npm pack",
"circularDepCheck": "madge --circular src/index.ts",
"clean": "rimraf build coverage sentry-pino-transport-*.tgz",
"fix": "eslint . --format stylish --fix",
"lint": "eslint . --format stylish",
"lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module",
"test": "yarn test:unit",
"test:unit": "vitest run",
"test:watch": "vitest --watch",
"yalc:publish": "yalc publish --push --sig"
},
"volta": {
"extends": "../../package.json"
},
"sideEffects": false
}
3 changes: 3 additions & 0 deletions packages/pino-transport/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils';

export default makeNPMConfigVariants(makeBaseNPMConfig());
2 changes: 2 additions & 0 deletions packages/pino-transport/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// TODO: Implement this
export {};
8 changes: 8 additions & 0 deletions packages/pino-transport/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { describe, expect, it } from 'vitest';
import * as index from '../src';

describe('pino-transport', () => {
it('should be defined', () => {
expect(index).toBeDefined();
});
});
10 changes: 10 additions & 0 deletions packages/pino-transport/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.json",

"include": ["src/**/*"],

"compilerOptions": {
"lib": ["es2018", "es2020.string"],
"module": "Node16"
}
}
7 changes: 7 additions & 0 deletions packages/pino-transport/tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"include": ["test/**/*", "src/**/*", "vite.config.ts"],
"compilerOptions": {
"types": ["vitest/globals", "node"]
}
}
10 changes: 10 additions & 0 deletions packages/pino-transport/tsconfig.types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "build/types",
"declaration": true,
"declarationMap": true,
"emitDeclarationOnly": true,
"stripInternal": true
}
}
7 changes: 7 additions & 0 deletions packages/pino-transport/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
environment: 'node',
},
});
Loading