Skip to content
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
11 changes: 11 additions & 0 deletions packages/node/src/integrations/tracing/fastify.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { isWrapped } from '@opentelemetry/core';
import { FastifyInstrumentation } from '@opentelemetry/instrumentation-fastify';
import { captureException, defineIntegration, getIsolationScope } from '@sentry/core';
import { addOpenTelemetryInstrumentation } from '@sentry/opentelemetry';
import type { IntegrationFn } from '@sentry/types';
import { consoleSandbox } from '@sentry/utils';

import { addOriginToSpan } from '../../utils/addOriginToSpan';

Expand Down Expand Up @@ -81,4 +83,13 @@ export function setupFastifyErrorHandler(fastify: Fastify): void {
);

fastify.register(plugin);

if (!isWrapped(fastify.addHook)) {
consoleSandbox(() => {
// eslint-disable-next-line no-console
console.warn(
'[Sentry] Fastify is not instrumented. This is likely because you required/imported fastify before calling `Sentry.init()`.',
);
});
}
}