Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Avoid the biggest mistake of our entire lives
  • Loading branch information
Luca Forstner committed Oct 21, 2024
commit c12461e98edc0aca1cf40ae2d1d1b7392e27e364
17 changes: 10 additions & 7 deletions packages/profiling-node/src/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import type { NodeClient } from '@sentry/node';
import type { Event, IntegrationFn, Profile, ProfileChunk, ProfilingIntegration, Span } from '@sentry/types';

import { LRUMap, logger, uuid4 } from '@sentry/utils';
import { LRUMap, consoleSandbox, logger, uuid4 } from '@sentry/utils';

import { CpuProfilerBindings } from './cpu_profiler';
import { DEBUG_BUILD } from './debug-build';
Expand Down Expand Up @@ -427,12 +427,15 @@ class ContinuousProfiler {
/** Exported only for tests. */
export const _nodeProfilingIntegration = ((): ProfilingIntegration<NodeClient> => {
if (![16, 18, 20, 22].includes(NODE_MAJOR)) {
logger.warn(
`[Profiling] You are using a Node.js version that does not have prebuilt binaries (${NODE_VERSION}).`,
'The @sentry/profiling-node package only has prebuilt support for the following LTS versions of Node.js: 16, 18, 20, 22.',
'To use the @sentry/profiling-node package with this version of Node.js, you will need to compile the native addon from source.',
'See: https://github.com/getsentry/sentry-javascript/tree/develop/packages/profiling-node#building-the-package-from-source',
);
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn(
`[Sentry Profiling] You are using a Node.js version that does not have prebuilt binaries (${NODE_VERSION}).`,
'The @sentry/profiling-node package only has prebuilt support for the following LTS versions of Node.js: 16, 18, 20, 22.',
'To use the @sentry/profiling-node package with this version of Node.js, you will need to compile the native addon from source.',
'See: https://github.com/getsentry/sentry-javascript/tree/develop/packages/profiling-node#building-the-package-from-source',
);
});
}

return {
Expand Down