Skip to content

Commit 7248255

Browse files
committed
feat(pino): Add initial package for @sentry/pino-transport
1 parent 664461a commit 7248255

File tree

14 files changed

+186
-0
lines changed

14 files changed

+186
-0
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ body:
5050
- '@sentry/nestjs'
5151
- '@sentry/nextjs'
5252
- '@sentry/nuxt'
53+
- '@sentry/pino-transport'
5354
- '@sentry/react'
5455
- '@sentry/react-router'
5556
- '@sentry/remix'

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ below:
112112
Provides the integration for Session Replay.
113113
- [`@sentry/core`](https://github.com/getsentry/sentry-javascript/tree/master/packages/core): The base for all
114114
JavaScript SDKs with interfaces, type definitions and base classes.
115+
- [`@sentry/pino-transport`](https://github.com/getsentry/sentry-javascript/tree/master/packages/pino-transport): Pino
116+
transport for automatically sending log messages to Sentry.
115117

116118
## Bug Bounty Program
117119

dev-packages/e2e-tests/verdaccio-config/config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ packages:
110110
unpublish: $all
111111
# proxy: npmjs # Don't proxy for E2E tests!
112112

113+
'@sentry/pino-transport':
114+
access: $all
115+
publish: $all
116+
unpublish: $all
117+
# proxy: npmjs # Don't proxy for E2E tests!
118+
113119
'@sentry/profiling-node':
114120
access: $all
115121
publish: $all

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"packages/node",
7171
"packages/nuxt",
7272
"packages/opentelemetry",
73+
"packages/pino-transport",
7374
"packages/profiling-node",
7475
"packages/react",
7576
"packages/react-router",

packages/pino-transport/.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
env: {
3+
node: true,
4+
},
5+
extends: ['../../.eslintrc.js'],
6+
overrides: [
7+
{
8+
files: ['src/**/*.ts'],
9+
rules: {},
10+
},
11+
],
12+
};

packages/pino-transport/LICENSE

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Functional Software, Inc. dba Sentry
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
6+
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
7+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
8+
persons to whom the Software is furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
11+
Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
14+
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
15+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
16+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

packages/pino-transport/README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# @sentry/pino-transport
2+
3+
[![npm version](https://img.shields.io/npm/v/@sentry/pino-transport.svg)](https://www.npmjs.com/package/@sentry/pino-transport)
4+
[![npm dm](https://img.shields.io/npm/dm/@sentry/pino-transport.svg)](https://www.npmjs.com/package/@sentry/pino-transport)
5+
[![npm dt](https://img.shields.io/npm/dt/@sentry/pino-transport.svg)](https://www.npmjs.com/package/@sentry/pino-transport)
6+
7+
**This package is currently in alpha. Breaking changes may still occur.**
8+
9+
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.
10+
11+
## Installation
12+
13+
```bash
14+
npm install @sentry/node @sentry/pino-transport
15+
# or
16+
yarn add @sentry/node @sentry/pino-transport
17+
```
18+
19+
## Usage
20+
21+
TODO: Add usage instructions
22+
23+
## Requirements
24+
25+
- Node.js 18 or higher
26+
- Pino 8.0.0 or higher
27+
- @sentry/node must be configured in your application
28+
29+
## License
30+
31+
MIT

packages/pino-transport/package.json

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{
2+
"name": "@sentry/pino-transport",
3+
"version": "9.30.0",
4+
"description": "Pino transport for Sentry SDK",
5+
"repository": "git://github.com/getsentry/sentry-javascript.git",
6+
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/pino-transport",
7+
"author": "Sentry",
8+
"license": "MIT",
9+
"engines": {
10+
"node": ">=18"
11+
},
12+
"files": [
13+
"/build"
14+
],
15+
"main": "build/cjs/index.js",
16+
"module": "build/esm/index.js",
17+
"types": "build/types/index.d.ts",
18+
"exports": {
19+
"./package.json": "./package.json",
20+
".": {
21+
"import": {
22+
"types": "./build/types/index.d.ts",
23+
"default": "./build/esm/index.js"
24+
},
25+
"require": {
26+
"types": "./build/types/index.d.ts",
27+
"default": "./build/cjs/index.js"
28+
}
29+
}
30+
},
31+
"typesVersions": {
32+
"<5.0": {
33+
"build/types/index.d.ts": [
34+
"build/types-ts3.8/index.d.ts"
35+
]
36+
}
37+
},
38+
"publishConfig": {
39+
"access": "public"
40+
},
41+
"dependencies": {
42+
"@sentry/core": "9.30.0",
43+
"@sentry/node": "9.30.0"
44+
},
45+
"peerDependencies": {
46+
"pino": "^8.0.0 || ^9.0.0"
47+
},
48+
"devDependencies": {
49+
"@types/node": "^18.19.1",
50+
"pino": "^9.0.0"
51+
},
52+
"scripts": {
53+
"build": "run-p build:transpile build:types",
54+
"build:dev": "yarn build",
55+
"build:transpile": "rollup -c rollup.npm.config.mjs",
56+
"build:types": "run-s build:types:core build:types:downlevel",
57+
"build:types:core": "tsc -p tsconfig.types.json",
58+
"build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
59+
"build:watch": "run-p build:transpile:watch build:types:watch",
60+
"build:dev:watch": "yarn build:watch",
61+
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
62+
"build:types:watch": "tsc -p tsconfig.types.json --watch",
63+
"build:tarball": "npm pack",
64+
"circularDepCheck": "madge --circular src/index.ts",
65+
"clean": "rimraf build coverage sentry-pino-transport-*.tgz",
66+
"fix": "eslint . --format stylish --fix",
67+
"lint": "eslint . --format stylish",
68+
"lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module",
69+
"test": "yarn test:unit",
70+
"test:unit": "vitest run",
71+
"test:watch": "vitest --watch",
72+
"yalc:publish": "yalc publish --push --sig"
73+
},
74+
"volta": {
75+
"extends": "../../package.json"
76+
},
77+
"sideEffects": false
78+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils';
2+
3+
export default makeNPMConfigVariants(makeBaseNPMConfig());

packages/pino-transport/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// TODO: Implement this
2+
export {};

packages/pino-transport/tsconfig.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
4+
"include": ["src/**/*"],
5+
6+
"compilerOptions": {
7+
"lib": ["es2018", "es2020.string"],
8+
"module": "Node16"
9+
}
10+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"include": ["test/**/*", "src/**/*", "vite.config.ts"],
4+
"compilerOptions": {
5+
"types": ["vitest/globals", "node"]
6+
}
7+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "build/types",
5+
"declaration": true,
6+
"declarationMap": true,
7+
"emitDeclarationOnly": true,
8+
"stripInternal": true
9+
}
10+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from 'vitest/config';
2+
3+
export default defineConfig({
4+
test: {
5+
environment: 'node',
6+
},
7+
});

0 commit comments

Comments
 (0)