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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"clean": "npx rimraf node_modules pnpm-lock.yaml",
"typecheck": "tsc",
"test:build": "pnpm install && pnpm run typecheck",
"test:build-3_20": "pnpm install && pnpm add fastify@~3.20.0 && pnpm run typecheck",
"test:assert": "pnpm test && pnpm test:override"
},
"dependencies": {
Expand All @@ -26,13 +25,5 @@
},
"volta": {
"extends": "../../package.json"
},
"sentryTest": {
"variants": [
{
"build-command": "pnpm test:build-3_20",
"label": "fastify v3.20.0"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ test.skip('Sends an API route transaction', async ({ baseURL }) => {
data: expect.objectContaining({
'sentry.origin': 'auto.http.otel.fastify',
'sentry.op': 'request_handler.fastify',
// format is slightly different in v3.20.0 and v3.21.0
'fastify.type': expect.stringMatching(/request[-_]handler/),
'http.route': '/test-transaction',
}),
Expand Down
23 changes: 3 additions & 20 deletions packages/node/src/integrations/tracing/fastify/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import type { Integration, IntegrationFn } from '@sentry/core';
import { defineIntegration, extendIntegration, getClient } from '@sentry/core';
import { generateInstrumentOnce } from '../../../otel/instrument';
import type { Integration } from '@sentry/core';
import { defineIntegration, getClient } from '@sentry/core';
import type { FastifyInstance, FastifyMinimal, FastifyReply, FastifyRequest } from './types';
import { FastifyInstrumentationV3 } from './v3/instrumentation';
import {
fastifyIntegration as serverUtilsFastifyIntegration,
instrumentFastify,
Expand Down Expand Up @@ -94,11 +92,6 @@ interface FastifyHandlerOptions {

const INTEGRATION_NAME = 'Fastify' as const;

export const instrumentFastifyV3 = generateInstrumentOnce(
`${INTEGRATION_NAME}.v3`,
() => new FastifyInstrumentationV3(),
);

function getFastifyIntegration(): FastifyIntegration | undefined {
const client = getClient();
if (!client) {
Expand All @@ -108,16 +101,6 @@ function getFastifyIntegration(): FastifyIntegration | undefined {
}
}

const _fastifyIntegration = ((options: Partial<FastifyIntegrationOptions>) => {
const parentIntegration = serverUtilsFastifyIntegration(options) as FastifyIntegration;

return extendIntegration(parentIntegration, {
setupOnce() {
instrumentFastifyV3();
},
});
}) satisfies IntegrationFn;

/**
* Adds Sentry tracing instrumentation for [Fastify](https://fastify.dev/).
*
Expand All @@ -135,7 +118,7 @@ const _fastifyIntegration = ((options: Partial<FastifyIntegrationOptions>) => {
* ```
*/
export const fastifyIntegration = defineIntegration((options: Partial<FastifyIntegrationOptions> = {}) =>
_fastifyIntegration(options),
serverUtilsFastifyIntegration(options),
Comment thread
cursor[bot] marked this conversation as resolved.
);

/**
Expand Down
34 changes: 0 additions & 34 deletions packages/node/src/integrations/tracing/fastify/v3/constants.ts

This file was deleted.

This file was deleted.

Loading
Loading