Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott

### Important Changes

- fix(node-core): Reduce bundle size by removing apm-js-collab and requiring pino >= 9.10 ([#18631](https://github.com/getsentry/sentry-javascript/pull/18631))

In order to keep receiving pino logs, you need to update your pino version to >= 9.10, the reason for the support bump is to reduce the bundle size of the node-core SDK in frameworks that cannot tree-shake the apm-js-collab dependency.

## 10.39.0

### Important Changes
Expand Down
2 changes: 1 addition & 1 deletion dev-packages/node-integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"node-schedule": "^2.1.1",
"openai": "5.18.1",
"pg": "8.16.0",
"pino": "9.9.4",
"pino": "9.10.0",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix PR lacks regression test per review rules

Low Severity

Per the review rules, a fix PR needs at least one unit, integration, or E2E test that validates the regression being fixed. This PR only bumps the pino version in tests from 9.9.4 to 9.10.0 but doesn't add a new test verifying that the bundle size reduction works or that pino integration still functions correctly with only the integratedChannel. Existing tests may pass coincidentally without actually verifying the specific change.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

"pino-next": "npm:pino@^9.12.0",
"postgres": "^3.4.7",
"prisma": "6.15.0",
Expand Down
2 changes: 0 additions & 2 deletions packages/core/src/utils/worldwide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ export type InternalGlobal = {
*/
_sentryModuleMetadata?: Record<string, any>;
_sentryEsmLoaderHookRegistered?: boolean;
_sentryInjectLoaderHookRegister?: () => void;
_sentryInjectLoaderHookRegistered?: boolean;
} & Carrier;

/** Get's the global object for the current JavaScript runtime */
Expand Down
2 changes: 0 additions & 2 deletions packages/node-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,11 @@
}
},
"dependencies": {
"@apm-js-collab/tracing-hooks": "^0.3.1",
"@sentry/core": "10.39.0",
"@sentry/opentelemetry": "10.39.0",
"import-in-the-middle": "^2.0.6"
},
"devDependencies": {
"@apm-js-collab/code-transformer": "^0.8.2",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/context-async-hooks": "^2.5.0",
"@opentelemetry/core": "^2.5.0",
Expand Down
18 changes: 0 additions & 18 deletions packages/node-core/src/integrations/pino.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
severityLevelFromString,
withScope,
} from '@sentry/core';
import { addInstrumentationConfig } from '../sdk/injectLoader';

const SENTRY_TRACK_SYMBOL = Symbol('sentry-track-pino-logger');

Expand Down Expand Up @@ -128,18 +127,6 @@ const _pinoIntegration = defineIntegration((userOptions: DeepPartial<PinoOptions
setup: client => {
const enableLogs = !!client.getOptions().enableLogs;

addInstrumentationConfig({
channelName: 'pino-log',
// From Pino v9.10.0 a tracing channel is available directly from Pino:
// https://github.com/pinojs/pino/pull/2281
module: { name: 'pino', versionRange: '>=8.0.0 < 9.10.0', filePath: 'lib/tools.js' },
functionQuery: {
functionName: 'asJson',
kind: 'Sync',
},
});

const injectedChannel = diagnosticsChannel.tracingChannel('orchestrion:pino:pino-log');
const integratedChannel = diagnosticsChannel.tracingChannel('pino_asJson');

function onPinoStart(self: Pino, args: PinoHookArgs, result: PinoResult): void {
Expand Down Expand Up @@ -192,11 +179,6 @@ const _pinoIntegration = defineIntegration((userOptions: DeepPartial<PinoOptions
}
}

injectedChannel.end.subscribe(data => {
const { self, arguments: args, result } = data as { self: Pino; arguments: PinoHookArgs; result: string };
onPinoStart(self, args, JSON.parse(result));
});

integratedChannel.end.subscribe(data => {
const {
instance,
Expand Down
3 changes: 0 additions & 3 deletions packages/node-core/src/light/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
functionToStringIntegration,
getCurrentScope,
getIntegrationsToSetup,
GLOBAL_OBJ,
linkedErrorsIntegration,
propagationContextFromHeaders,
requestDataIntegration,
Expand Down Expand Up @@ -121,8 +120,6 @@ function _init(

client.init();

GLOBAL_OBJ._sentryInjectLoaderHookRegister?.();

debug.log(`SDK initialized from ${isCjs() ? 'CommonJS' : 'ESM'} (light mode)`);

client.startClientReportTracking();
Expand Down
3 changes: 0 additions & 3 deletions packages/node-core/src/sdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
functionToStringIntegration,
getCurrentScope,
getIntegrationsToSetup,
GLOBAL_OBJ,
hasSpansEnabled,
inboundFiltersIntegration,
linkedErrorsIntegration,
Expand Down Expand Up @@ -135,8 +134,6 @@ function _init(

client.init();

GLOBAL_OBJ._sentryInjectLoaderHookRegister?.();

debug.log(`SDK initialized from ${isCjs() ? 'CommonJS' : 'ESM'}`);

client.startClientReportTracking();
Expand Down
46 changes: 0 additions & 46 deletions packages/node-core/src/sdk/injectLoader.ts

This file was deleted.

22 changes: 4 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -378,20 +378,6 @@
dependencies:
json-schema-to-ts "^3.1.1"

"@apm-js-collab/code-transformer@^0.8.0", "@apm-js-collab/code-transformer@^0.8.2":
version "0.8.2"
resolved "https://registry.yarnpkg.com/@apm-js-collab/code-transformer/-/code-transformer-0.8.2.tgz#a3160f16d1c4df9cb81303527287ad18d00994d1"
integrity sha512-YRjJjNq5KFSjDUoqu5pFUWrrsvGOxl6c3bu+uMFc9HNNptZ2rNU/TI2nLw4jnhQNtka972Ee2m3uqbvDQtPeCA==

"@apm-js-collab/tracing-hooks@^0.3.1":
version "0.3.1"
resolved "https://registry.yarnpkg.com/@apm-js-collab/tracing-hooks/-/tracing-hooks-0.3.1.tgz#414d3a93c3a15d8be543a3fac561f7c602b6a588"
integrity sha512-Vu1CbmPURlN5fTboVuKMoJjbO5qcq9fA5YXpskx3dXe/zTBvjODFoerw+69rVBlRLrJpwPqSDqEuJDEKIrTldw==
dependencies:
"@apm-js-collab/code-transformer" "^0.8.0"
debug "^4.4.1"
module-details-from-path "^1.0.4"

"@apollo/cache-control-types@^1.0.3":
version "1.0.3"
resolved "https://registry.yarnpkg.com/@apollo/cache-control-types/-/cache-control-types-1.0.3.tgz#5da62cf64c3b4419dabfef4536b57a40c8ff0b47"
Expand Down Expand Up @@ -26007,10 +25993,10 @@ pino-std-serializers@^7.0.0:
resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz#7c625038b13718dbbd84ab446bd673dc52259e3b"
integrity sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==

pino@9.9.4:
version "9.9.4"
resolved "https://registry.yarnpkg.com/pino/-/pino-9.9.4.tgz#21ed2c27cc177f797e3249c99d340f0bcd6b248e"
integrity sha512-d1XorUQ7sSKqVcYdXuEYs2h1LKxejSorMEJ76XoZ0pPDf8VzJMe7GlPXpMBZeQ9gE4ZPIp5uGD+5Nw7scxiigg==
pino@9.10.0:
version "9.10.0"
resolved "https://registry.yarnpkg.com/pino/-/pino-9.10.0.tgz#b78555637605ef6f4287e51a89b2087d66da4859"
integrity sha512-VOFxoNnxICtxaN8S3E73pR66c5MTFC+rwRcNRyHV/bV/c90dXvJqMfjkeRFsGBDXmlUN3LccJQPqGIufnaJePA==
dependencies:
atomic-sleep "^1.0.0"
fast-redact "^3.1.1"
Expand Down
Loading