Skip to content
Open
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
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",
"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",
Copy link

Choose a reason for hiding this comment

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

Leftover type declaration for removed dependency

Low Severity

The @apm-js-collab/tracing-hooks and @apm-js-collab/code-transformer dependencies were removed, but their type declaration file at packages/node-core/src/sdk/apm-js-collab-tracing-hooks.d.ts was not deleted. This is now dead code that references non-existent packages.

Fix in Cursor Fix in Web

"@sentry/core": "10.38.0",
"@sentry/opentelemetry": "10.38.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 {
Comment on lines 127 to 132
Copy link

Choose a reason for hiding this comment

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

Bug: The Pino integration requires v9.10+ but documentation wasn't updated and no version check was added, causing silent failure on older versions.
Severity: HIGH

Suggested Fix

Update the JSDoc to state that Pino >=v9.10.0 is required. Consider adding a runtime version check that logs a warning or error if an unsupported Pino version is detected to prevent silent failures.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: packages/node-core/src/integrations/pino.ts#L127-L132

Potential issue: The Pino integration was updated to exclusively use the `pino_asJson`
tracing channel, which is only available in Pino v9.10 and later. However, the JSDoc for
the integration was not updated and still incorrectly states that `Pino >=v8.0.0` is
required. Furthermore, no runtime version check was added. Consequently, users with an
unsupported Pino version (>=8.0.0 and <9.10.0) will experience a silent failure where
the integration stops capturing logs without any warning or error. The
`diagnosticsChannel.tracingChannel('pino_asJson')` call will not fail, but the channel
will never receive events from older Pino versions.

Did we get this right? 👍 / 👎 to inform future reviews.

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/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 @@ -26457,10 +26443,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