@sentry/node 9.16.1 → 9.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/build/cjs/index.js +18 -18
  2. package/build/cjs/integrations/anr/index.js +1 -1
  3. package/build/cjs/integrations/http/SentryHttpInstrumentation.js +61 -0
  4. package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +1 -1
  5. package/build/cjs/integrations/http/index.js +3 -0
  6. package/build/cjs/integrations/http/index.js.map +1 -1
  7. package/build/cjs/integrations/local-variables/local-variables-async.js +1 -1
  8. package/build/cjs/integrations/tracing/fastify/index.js +187 -0
  9. package/build/cjs/integrations/tracing/fastify/index.js.map +1 -0
  10. package/build/cjs/integrations/tracing/fastify/v3/constants.js +23 -0
  11. package/build/cjs/integrations/tracing/fastify/v3/constants.js.map +1 -0
  12. package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js +37 -0
  13. package/build/cjs/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +1 -0
  14. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +303 -0
  15. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -0
  16. package/build/cjs/integrations/tracing/fastify/v3/utils.js +135 -0
  17. package/build/cjs/integrations/tracing/fastify/v3/utils.js.map +1 -0
  18. package/build/cjs/integrations/tracing/index.js +11 -10
  19. package/build/cjs/integrations/tracing/index.js.map +1 -1
  20. package/build/cjs/sdk/initOtel.js +1 -1
  21. package/build/cjs/sdk/initOtel.js.map +1 -1
  22. package/build/esm/index.js +1 -1
  23. package/build/esm/integrations/anr/index.js +1 -1
  24. package/build/esm/integrations/anr/worker-script.js +2 -2
  25. package/build/esm/integrations/http/SentryHttpInstrumentation.js +62 -1
  26. package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +1 -1
  27. package/build/esm/integrations/http/index.js +3 -0
  28. package/build/esm/integrations/http/index.js.map +1 -1
  29. package/build/esm/integrations/local-variables/local-variables-async.js +1 -1
  30. package/build/esm/integrations/local-variables/worker-script.js +2 -2
  31. package/build/esm/integrations/tracing/fastify/index.js +182 -0
  32. package/build/esm/integrations/tracing/fastify/index.js.map +1 -0
  33. package/build/esm/integrations/tracing/fastify/v3/constants.js +21 -0
  34. package/build/esm/integrations/tracing/fastify/v3/constants.js.map +1 -0
  35. package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js +37 -0
  36. package/build/esm/integrations/tracing/fastify/v3/enums/AttributeNames.js.map +1 -0
  37. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +301 -0
  38. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -0
  39. package/build/esm/integrations/tracing/fastify/v3/utils.js +131 -0
  40. package/build/esm/integrations/tracing/fastify/v3/utils.js.map +1 -0
  41. package/build/esm/integrations/tracing/index.js +2 -1
  42. package/build/esm/integrations/tracing/index.js.map +1 -1
  43. package/build/esm/package.json +1 -1
  44. package/build/esm/sdk/initOtel.js +1 -1
  45. package/build/esm/sdk/initOtel.js.map +1 -1
  46. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts +14 -0
  47. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +1 -1
  48. package/build/types/integrations/http/index.d.ts.map +1 -1
  49. package/build/{types-ts3.8/integrations/tracing/fastify.d.ts → types/integrations/tracing/fastify/index.d.ts} +83 -103
  50. package/build/types/integrations/tracing/fastify/index.d.ts.map +1 -0
  51. package/build/types/integrations/tracing/fastify/types.d.ts +25 -0
  52. package/build/types/integrations/tracing/fastify/types.d.ts.map +1 -0
  53. package/build/types/integrations/tracing/fastify/v3/constants.d.ts +3 -0
  54. package/build/types/integrations/tracing/fastify/v3/constants.d.ts.map +1 -0
  55. package/build/types/integrations/tracing/fastify/v3/enums/AttributeNames.d.ts +15 -0
  56. package/build/types/integrations/tracing/fastify/v3/enums/AttributeNames.d.ts.map +1 -0
  57. package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts +16 -0
  58. package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts.map +1 -0
  59. package/build/types/integrations/tracing/fastify/v3/internal-types.d.ts +7 -0
  60. package/build/types/integrations/tracing/fastify/v3/internal-types.d.ts.map +1 -0
  61. package/build/types/integrations/tracing/fastify/v3/types.d.ts +21 -0
  62. package/build/types/integrations/tracing/fastify/v3/types.d.ts.map +1 -0
  63. package/build/types/integrations/tracing/fastify/v3/utils.d.ts +28 -0
  64. package/build/types/integrations/tracing/fastify/v3/utils.d.ts.map +1 -0
  65. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  66. package/build/types-ts3.8/integrations/http/SentryHttpInstrumentation.d.ts +14 -0
  67. package/build/{types/integrations/tracing/fastify.d.ts → types-ts3.8/integrations/tracing/fastify/index.d.ts} +83 -103
  68. package/build/types-ts3.8/integrations/tracing/fastify/types.d.ts +25 -0
  69. package/build/types-ts3.8/integrations/tracing/fastify/v3/constants.d.ts +3 -0
  70. package/build/types-ts3.8/integrations/tracing/fastify/v3/enums/AttributeNames.d.ts +15 -0
  71. package/build/types-ts3.8/integrations/tracing/fastify/v3/instrumentation.d.ts +16 -0
  72. package/build/types-ts3.8/integrations/tracing/fastify/v3/internal-types.d.ts +7 -0
  73. package/build/types-ts3.8/integrations/tracing/fastify/v3/types.d.ts +21 -0
  74. package/build/types-ts3.8/integrations/tracing/fastify/v3/utils.d.ts +28 -0
  75. package/package.json +5 -5
  76. package/build/cjs/integrations/tracing/fastify.js +0 -160
  77. package/build/cjs/integrations/tracing/fastify.js.map +0 -1
  78. package/build/esm/integrations/tracing/fastify.js +0 -156
  79. package/build/esm/integrations/tracing/fastify.js.map +0 -1
  80. package/build/types/integrations/tracing/fastify.d.ts.map +0 -1
@@ -0,0 +1,16 @@
1
+ import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
2
+ import { FastifyInstrumentationConfig } from './types';
3
+ /**
4
+ * Fastify instrumentation for OpenTelemetry
5
+ */
6
+ export declare class FastifyInstrumentationV3 extends InstrumentationBase<FastifyInstrumentationConfig> {
7
+ constructor(config?: FastifyInstrumentationConfig);
8
+ init(): InstrumentationNodeModuleDefinition[];
9
+ private _hookOnRequest;
10
+ private _wrapHandler;
11
+ private _wrapAddHook;
12
+ private _patchConstructor;
13
+ private _patchSend;
14
+ private _hookPreHandler;
15
+ }
16
+ //# sourceMappingURL=instrumentation.d.ts.map
@@ -0,0 +1,7 @@
1
+ import { Span } from '@opentelemetry/api';
2
+ import { FastifyReply } from '../types';
3
+ import { spanRequestSymbol } from './constants';
4
+ export type PluginFastifyReply = FastifyReply & {
5
+ [spanRequestSymbol]?: Span[];
6
+ };
7
+ //# sourceMappingURL=internal-types.d.ts.map
@@ -0,0 +1,21 @@
1
+ import { Span } from '@opentelemetry/api';
2
+ import { InstrumentationConfig } from '@opentelemetry/instrumentation';
3
+ export interface FastifyRequestInfo {
4
+ request: any;
5
+ }
6
+ /**
7
+ * Function that can be used to add custom attributes to the current span
8
+ * @param span - The Fastify handler span.
9
+ * @param info - The Fastify request info object.
10
+ */
11
+ export interface FastifyCustomAttributeFunction {
12
+ (span: Span, info: FastifyRequestInfo): void;
13
+ }
14
+ /**
15
+ * Options available for the Fastify Instrumentation
16
+ */
17
+ export interface FastifyInstrumentationConfig extends InstrumentationConfig {
18
+ /** Function for adding custom attributes to each handler span */
19
+ requestHook?: FastifyCustomAttributeFunction;
20
+ }
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,28 @@
1
+ import { Attributes, Span, Tracer } from '@opentelemetry/api';
2
+ import { PluginFastifyReply } from './internal-types';
3
+ /**
4
+ * Starts Span
5
+ * @param reply - reply function
6
+ * @param tracer - tracer
7
+ * @param spanName - span name
8
+ * @param spanAttributes - span attributes
9
+ */
10
+ export declare function startSpan(reply: PluginFastifyReply, tracer: Tracer, spanName: string, spanAttributes?: Attributes): Span;
11
+ /**
12
+ * Ends span
13
+ * @param reply - reply function
14
+ * @param err - error
15
+ */
16
+ export declare function endSpan(reply: PluginFastifyReply, err?: any): void;
17
+ /**
18
+ * This function handles the missing case from instrumentation package when
19
+ * execute can either return a promise or void. And using async is not an
20
+ * option as it is producing unwanted side effects.
21
+ * @param execute - function to be executed
22
+ * @param onFinish - function called when function executed
23
+ * @param preventThrowingError - prevent to throw error when execute
24
+ * function fails
25
+ */
26
+ export declare function safeExecuteInTheMiddleMaybePromise<T>(execute: () => Promise<T>, onFinish: (e: unknown, result?: T) => void, preventThrowingError?: boolean): Promise<T>;
27
+ export declare function safeExecuteInTheMiddleMaybePromise<T>(execute: () => T, onFinish: (e: unknown, result?: T) => void, preventThrowingError?: boolean): T;
28
+ //# sourceMappingURL=utils.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/node",
3
- "version": "9.16.1",
3
+ "version": "9.18.0",
4
4
  "description": "Sentry Node SDK using OpenTelemetry for performance instrumentation",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node",
@@ -65,6 +65,7 @@
65
65
  "access": "public"
66
66
  },
67
67
  "dependencies": {
68
+ "@fastify/otel": "getsentry/fastify-otel#otel-v1",
68
69
  "@opentelemetry/api": "^1.9.0",
69
70
  "@opentelemetry/context-async-hooks": "^1.30.1",
70
71
  "@opentelemetry/core": "^1.30.1",
@@ -73,7 +74,6 @@
73
74
  "@opentelemetry/instrumentation-connect": "0.43.1",
74
75
  "@opentelemetry/instrumentation-dataloader": "0.16.1",
75
76
  "@opentelemetry/instrumentation-express": "0.47.1",
76
- "@opentelemetry/instrumentation-fastify": "0.44.2",
77
77
  "@opentelemetry/instrumentation-fs": "0.19.1",
78
78
  "@opentelemetry/instrumentation-generic-pool": "0.43.1",
79
79
  "@opentelemetry/instrumentation-graphql": "0.47.1",
@@ -96,9 +96,9 @@
96
96
  "@opentelemetry/sdk-trace-base": "^1.30.1",
97
97
  "@opentelemetry/semantic-conventions": "^1.30.0",
98
98
  "@prisma/instrumentation": "6.7.0",
99
- "@sentry/core": "9.16.1",
100
- "@sentry/opentelemetry": "9.16.1",
101
- "import-in-the-middle": "^1.13.0"
99
+ "@sentry/core": "9.18.0",
100
+ "@sentry/opentelemetry": "9.18.0",
101
+ "import-in-the-middle": "^1.13.1"
102
102
  },
103
103
  "devDependencies": {
104
104
  "@types/node": "^18.19.1"
@@ -1,160 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const instrumentationFastify = require('@opentelemetry/instrumentation-fastify');
4
- const core = require('@sentry/core');
5
- const instrument = require('../../otel/instrument.js');
6
- const ensureIsWrapped = require('../../utils/ensureIsWrapped.js');
7
-
8
- /**
9
- * Minimal request type containing properties around route information.
10
- * Works for Fastify 3, 4 and presumably 5.
11
- *
12
- * Based on https://github.com/fastify/fastify/blob/ce3811f5f718be278bbcd4392c615d64230065a6/types/request.d.ts
13
- */
14
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
-
16
- const INTEGRATION_NAME = 'Fastify';
17
-
18
- const instrumentFastify = instrument.generateInstrumentOnce(
19
- INTEGRATION_NAME,
20
- () =>
21
- // eslint-disable-next-line deprecation/deprecation
22
- new instrumentationFastify.FastifyInstrumentation({
23
- requestHook(span) {
24
- addFastifySpanAttributes(span);
25
- },
26
- }),
27
- );
28
-
29
- const _fastifyIntegration = (() => {
30
- return {
31
- name: INTEGRATION_NAME,
32
- setupOnce() {
33
- instrumentFastify();
34
- },
35
- };
36
- }) ;
37
-
38
- /**
39
- * Adds Sentry tracing instrumentation for [Fastify](https://fastify.dev/).
40
- *
41
- * If you also want to capture errors, you need to call `setupFastifyErrorHandler(app)` after you set up your Fastify server.
42
- *
43
- * For more information, see the [fastify documentation](https://docs.sentry.io/platforms/javascript/guides/fastify/).
44
- *
45
- * @example
46
- * ```javascript
47
- * const Sentry = require('@sentry/node');
48
- *
49
- * Sentry.init({
50
- * integrations: [Sentry.fastifyIntegration()],
51
- * })
52
- * ```
53
- */
54
- const fastifyIntegration = core.defineIntegration(_fastifyIntegration);
55
-
56
- /**
57
- * Default function to determine if an error should be sent to Sentry
58
- *
59
- * 3xx and 4xx errors are not sent by default.
60
- */
61
- function defaultShouldHandleError(_error, _request, reply) {
62
- const statusCode = reply.statusCode;
63
- // 3xx and 4xx errors are not sent by default.
64
- return statusCode >= 500 || statusCode <= 299;
65
- }
66
-
67
- /**
68
- * Add an Fastify error handler to capture errors to Sentry.
69
- *
70
- * @param fastify The Fastify instance to which to add the error handler
71
- * @param options Configuration options for the handler
72
- *
73
- * @example
74
- * ```javascript
75
- * const Sentry = require('@sentry/node');
76
- * const Fastify = require("fastify");
77
- *
78
- * const app = Fastify();
79
- *
80
- * Sentry.setupFastifyErrorHandler(app);
81
- *
82
- * // Add your routes, etc.
83
- *
84
- * app.listen({ port: 3000 });
85
- * ```
86
- */
87
- function setupFastifyErrorHandler(fastify, options) {
88
- const shouldHandleError = options?.shouldHandleError || defaultShouldHandleError;
89
-
90
- const plugin = Object.assign(
91
- function (fastify, _options, done) {
92
- fastify.addHook('onError', async (request, reply, error) => {
93
- if (shouldHandleError(error, request, reply)) {
94
- core.captureException(error);
95
- }
96
- });
97
-
98
- // registering `onRequest` hook here instead of using Otel `onRequest` callback b/c `onRequest` hook
99
- // is ironically called in the fastify `preHandler` hook which is called later in the lifecycle:
100
- // https://fastify.dev/docs/latest/Reference/Lifecycle/
101
- fastify.addHook('onRequest', async (request, _reply) => {
102
- // Taken from Otel Fastify instrumentation:
103
- // https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts#L94-L96
104
- const routeName = request.routeOptions?.url || request.routerPath;
105
- const method = request.method || 'GET';
106
-
107
- core.getIsolationScope().setTransactionName(`${method} ${routeName}`);
108
- });
109
-
110
- done();
111
- },
112
- {
113
- [Symbol.for('skip-override')]: true,
114
- [Symbol.for('fastify.display-name')]: 'sentry-fastify-error-handler',
115
- },
116
- );
117
-
118
- fastify.register(plugin);
119
-
120
- // Sadly, middleware spans do not go through `requestHook`, so we handle those here
121
- // We register this hook in this method, because if we register it in the integration `setup`,
122
- // it would always run even for users that are not even using fastify
123
- const client = core.getClient();
124
- if (client) {
125
- client.on('spanStart', span => {
126
- addFastifySpanAttributes(span);
127
- });
128
- }
129
-
130
- ensureIsWrapped.ensureIsWrapped(fastify.addHook, 'fastify');
131
- }
132
-
133
- function addFastifySpanAttributes(span) {
134
- const attributes = core.spanToJSON(span).data;
135
-
136
- // this is one of: middleware, request_handler
137
- const type = attributes['fastify.type'];
138
-
139
- // If this is already set, or we have no fastify span, no need to process again...
140
- if (attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) {
141
- return;
142
- }
143
-
144
- span.setAttributes({
145
- [core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.fastify',
146
- [core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.fastify`,
147
- });
148
-
149
- // Also update the name, we don't need to "middleware - " prefix
150
- const name = attributes['fastify.name'] || attributes['plugin.name'] || attributes['hook.name'];
151
- if (typeof name === 'string') {
152
- // Also remove `fastify -> ` prefix
153
- span.updateName(name.replace(/^fastify -> /, ''));
154
- }
155
- }
156
-
157
- exports.fastifyIntegration = fastifyIntegration;
158
- exports.instrumentFastify = instrumentFastify;
159
- exports.setupFastifyErrorHandler = setupFastifyErrorHandler;
160
- //# sourceMappingURL=fastify.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fastify.js","sources":["../../../../src/integrations/tracing/fastify.ts"],"sourcesContent":["import { FastifyInstrumentation } from '@opentelemetry/instrumentation-fastify';\nimport type { IntegrationFn, Span } from '@sentry/core';\nimport {\n captureException,\n defineIntegration,\n getClient,\n getIsolationScope,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n spanToJSON,\n} from '@sentry/core';\nimport { generateInstrumentOnce } from '../../otel/instrument';\nimport { ensureIsWrapped } from '../../utils/ensureIsWrapped';\n\n/**\n * Minimal request type containing properties around route information.\n * Works for Fastify 3, 4 and presumably 5.\n *\n * Based on https://github.com/fastify/fastify/blob/ce3811f5f718be278bbcd4392c615d64230065a6/types/request.d.ts\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ninterface MinimalFastifyRequest extends Record<string, any> {\n method?: string;\n // since fastify@4.10.0\n routeOptions?: {\n url?: string;\n };\n routerPath?: string;\n}\n\n/**\n * Minimal reply type containing properties needed for error handling.\n *\n * Based on https://github.com/fastify/fastify/blob/ce3811f5f718be278bbcd4392c615d64230065a6/types/reply.d.ts\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ninterface MinimalFastifyReply extends Record<string, any> {\n statusCode: number;\n}\n\n// We inline the types we care about here\ninterface Fastify {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n register: (plugin: any) => void;\n addHook: (hook: string, handler: (...params: unknown[]) => void) => void;\n}\n\ninterface FastifyWithHooks extends Omit<Fastify, 'addHook'> {\n addHook(\n hook: 'onError',\n handler: (request: MinimalFastifyRequest, reply: MinimalFastifyReply, error: Error) => void,\n ): void;\n addHook(hook: 'onRequest', handler: (request: MinimalFastifyRequest, reply: MinimalFastifyReply) => void): void;\n}\n\ninterface FastifyHandlerOptions {\n /**\n * Callback method deciding whether error should be captured and sent to Sentry\n *\n * @param error Captured Fastify error\n * @param request Fastify request (or any object containing at least method, routeOptions.url, and routerPath)\n * @param reply Fastify reply (or any object containing at least statusCode)\n *\n * @example\n *\n * ```javascript\n * setupFastifyErrorHandler(app, {\n * shouldHandleError(_error, _request, reply) {\n * return reply.statusCode >= 400;\n * },\n * });\n * ```\n *\n * If using TypeScript, you can cast the request and reply to get full type safety.\n *\n * ```typescript\n * import type { FastifyRequest, FastifyReply } from 'fastify';\n *\n * setupFastifyErrorHandler(app, {\n * shouldHandleError(error, minimalRequest, minimalReply) {\n * const request = minimalRequest as FastifyRequest;\n * const reply = minimalReply as FastifyReply;\n * return reply.statusCode >= 500;\n * },\n * });\n * ```\n */\n shouldHandleError: (error: Error, request: MinimalFastifyRequest, reply: MinimalFastifyReply) => boolean;\n}\n\nconst INTEGRATION_NAME = 'Fastify';\n\nexport const instrumentFastify = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n // eslint-disable-next-line deprecation/deprecation\n new FastifyInstrumentation({\n requestHook(span) {\n addFastifySpanAttributes(span);\n },\n }),\n);\n\nconst _fastifyIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentFastify();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for [Fastify](https://fastify.dev/).\n *\n * If you also want to capture errors, you need to call `setupFastifyErrorHandler(app)` after you set up your Fastify server.\n *\n * For more information, see the [fastify documentation](https://docs.sentry.io/platforms/javascript/guides/fastify/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.fastifyIntegration()],\n * })\n * ```\n */\nexport const fastifyIntegration = defineIntegration(_fastifyIntegration);\n\n/**\n * Default function to determine if an error should be sent to Sentry\n *\n * 3xx and 4xx errors are not sent by default.\n */\nfunction defaultShouldHandleError(_error: Error, _request: MinimalFastifyRequest, reply: MinimalFastifyReply): boolean {\n const statusCode = reply.statusCode;\n // 3xx and 4xx errors are not sent by default.\n return statusCode >= 500 || statusCode <= 299;\n}\n\n/**\n * Add an Fastify error handler to capture errors to Sentry.\n *\n * @param fastify The Fastify instance to which to add the error handler\n * @param options Configuration options for the handler\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n * const Fastify = require(\"fastify\");\n *\n * const app = Fastify();\n *\n * Sentry.setupFastifyErrorHandler(app);\n *\n * // Add your routes, etc.\n *\n * app.listen({ port: 3000 });\n * ```\n */\nexport function setupFastifyErrorHandler(fastify: Fastify, options?: Partial<FastifyHandlerOptions>): void {\n const shouldHandleError = options?.shouldHandleError || defaultShouldHandleError;\n\n const plugin = Object.assign(\n function (fastify: FastifyWithHooks, _options: unknown, done: () => void): void {\n fastify.addHook('onError', async (request, reply, error) => {\n if (shouldHandleError(error, request, reply)) {\n captureException(error);\n }\n });\n\n // registering `onRequest` hook here instead of using Otel `onRequest` callback b/c `onRequest` hook\n // is ironically called in the fastify `preHandler` hook which is called later in the lifecycle:\n // https://fastify.dev/docs/latest/Reference/Lifecycle/\n fastify.addHook('onRequest', async (request, _reply) => {\n // Taken from Otel Fastify instrumentation:\n // https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts#L94-L96\n const routeName = request.routeOptions?.url || request.routerPath;\n const method = request.method || 'GET';\n\n getIsolationScope().setTransactionName(`${method} ${routeName}`);\n });\n\n done();\n },\n {\n [Symbol.for('skip-override')]: true,\n [Symbol.for('fastify.display-name')]: 'sentry-fastify-error-handler',\n },\n );\n\n fastify.register(plugin);\n\n // Sadly, middleware spans do not go through `requestHook`, so we handle those here\n // We register this hook in this method, because if we register it in the integration `setup`,\n // it would always run even for users that are not even using fastify\n const client = getClient();\n if (client) {\n client.on('spanStart', span => {\n addFastifySpanAttributes(span);\n });\n }\n\n ensureIsWrapped(fastify.addHook, 'fastify');\n}\n\nfunction addFastifySpanAttributes(span: Span): void {\n const attributes = spanToJSON(span).data;\n\n // this is one of: middleware, request_handler\n const type = attributes['fastify.type'];\n\n // If this is already set, or we have no fastify span, no need to process again...\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) {\n return;\n }\n\n span.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.fastify',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.fastify`,\n });\n\n // Also update the name, we don't need to \"middleware - \" prefix\n const name = attributes['fastify.name'] || attributes['plugin.name'] || attributes['hook.name'];\n if (typeof name === 'string') {\n // Also remove `fastify -> ` prefix\n span.updateName(name.replace(/^fastify -> /, ''));\n }\n}\n"],"names":["generateInstrumentOnce","FastifyInstrumentation","defineIntegration","captureException","getIsolationScope","getClient","ensureIsWrapped","spanToJSON","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN"],"mappings":";;;;;;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsEA,MAAM,gBAAA,GAAmB,SAAS;;AAE3B,MAAM,iBAAkB,GAAEA,iCAAsB;AACvD,EAAE,gBAAgB;AAClB,EAAE;AACF;AACA,IAAI,IAAIC,6CAAsB,CAAC;AAC/B,MAAM,WAAW,CAAC,IAAI,EAAE;AACxB,QAAQ,wBAAwB,CAAC,IAAI,CAAC;AACtC,OAAO;AACP,KAAK,CAAC;AACN;;AAEA,MAAM,mBAAoB,IAAG,MAAM;AACnC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,iBAAiB,EAAE;AACzB,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,kBAAmB,GAAEC,sBAAiB,CAAC,mBAAmB;;AAEvE;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB,CAAC,MAAM,EAAS,QAAQ,EAAyB,KAAK,EAAgC;AACvH,EAAE,MAAM,UAAA,GAAa,KAAK,CAAC,UAAU;AACrC;AACA,EAAE,OAAO,UAAW,IAAG,OAAO,UAAA,IAAc,GAAG;AAC/C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,wBAAwB,CAAC,OAAO,EAAW,OAAO,EAAyC;AAC3G,EAAE,MAAM,iBAAkB,GAAE,OAAO,EAAE,iBAAA,IAAqB,wBAAwB;;AAElF,EAAE,MAAM,MAAA,GAAS,MAAM,CAAC,M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AACA,EAAA,MAAA,UAAA,GAAAC,eAAA,CAAA,IAAA,CAAA,CAAA,IAAA;;AAEA;AACA,EAAA,MAAA,IAAA,GAAA,UAAA,CAAA,cAAA,CAAA;;AAEA;AACA,EAAA,IAAA,UAAA,CAAAC,iCAAA,CAAA,IAAA,CAAA,IAAA,EAAA;AACA,IAAA;AACA;;AAEA,EAAA,IAAA,CAAA,aAAA,CAAA;AACA,IAAA,CAAAC,qCAAA,GAAA,wBAAA;AACA,IAAA,CAAAD,iCAAA,GAAA,CAAA,EAAA,IAAA,CAAA,QAAA,CAAA;AACA,GAAA,CAAA;;AAEA;AACA,EAAA,MAAA,IAAA,GAAA,UAAA,CAAA,cAAA,CAAA,IAAA,UAAA,CAAA,aAAA,CAAA,IAAA,UAAA,CAAA,WAAA,CAAA;AACA,EAAA,IAAA,OAAA,IAAA,KAAA,QAAA,EAAA;AACA;AACA,IAAA,IAAA,CAAA,UAAA,CAAA,IAAA,CAAA,OAAA,CAAA,cAAA,EAAA,EAAA,CAAA,CAAA;AACA;AACA;;;;;;"}
@@ -1,156 +0,0 @@
1
- import { FastifyInstrumentation } from '@opentelemetry/instrumentation-fastify';
2
- import { defineIntegration, captureException, getIsolationScope, getClient, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
3
- import { generateInstrumentOnce } from '../../otel/instrument.js';
4
- import { ensureIsWrapped } from '../../utils/ensureIsWrapped.js';
5
-
6
- /**
7
- * Minimal request type containing properties around route information.
8
- * Works for Fastify 3, 4 and presumably 5.
9
- *
10
- * Based on https://github.com/fastify/fastify/blob/ce3811f5f718be278bbcd4392c615d64230065a6/types/request.d.ts
11
- */
12
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
-
14
- const INTEGRATION_NAME = 'Fastify';
15
-
16
- const instrumentFastify = generateInstrumentOnce(
17
- INTEGRATION_NAME,
18
- () =>
19
- // eslint-disable-next-line deprecation/deprecation
20
- new FastifyInstrumentation({
21
- requestHook(span) {
22
- addFastifySpanAttributes(span);
23
- },
24
- }),
25
- );
26
-
27
- const _fastifyIntegration = (() => {
28
- return {
29
- name: INTEGRATION_NAME,
30
- setupOnce() {
31
- instrumentFastify();
32
- },
33
- };
34
- }) ;
35
-
36
- /**
37
- * Adds Sentry tracing instrumentation for [Fastify](https://fastify.dev/).
38
- *
39
- * If you also want to capture errors, you need to call `setupFastifyErrorHandler(app)` after you set up your Fastify server.
40
- *
41
- * For more information, see the [fastify documentation](https://docs.sentry.io/platforms/javascript/guides/fastify/).
42
- *
43
- * @example
44
- * ```javascript
45
- * const Sentry = require('@sentry/node');
46
- *
47
- * Sentry.init({
48
- * integrations: [Sentry.fastifyIntegration()],
49
- * })
50
- * ```
51
- */
52
- const fastifyIntegration = defineIntegration(_fastifyIntegration);
53
-
54
- /**
55
- * Default function to determine if an error should be sent to Sentry
56
- *
57
- * 3xx and 4xx errors are not sent by default.
58
- */
59
- function defaultShouldHandleError(_error, _request, reply) {
60
- const statusCode = reply.statusCode;
61
- // 3xx and 4xx errors are not sent by default.
62
- return statusCode >= 500 || statusCode <= 299;
63
- }
64
-
65
- /**
66
- * Add an Fastify error handler to capture errors to Sentry.
67
- *
68
- * @param fastify The Fastify instance to which to add the error handler
69
- * @param options Configuration options for the handler
70
- *
71
- * @example
72
- * ```javascript
73
- * const Sentry = require('@sentry/node');
74
- * const Fastify = require("fastify");
75
- *
76
- * const app = Fastify();
77
- *
78
- * Sentry.setupFastifyErrorHandler(app);
79
- *
80
- * // Add your routes, etc.
81
- *
82
- * app.listen({ port: 3000 });
83
- * ```
84
- */
85
- function setupFastifyErrorHandler(fastify, options) {
86
- const shouldHandleError = options?.shouldHandleError || defaultShouldHandleError;
87
-
88
- const plugin = Object.assign(
89
- function (fastify, _options, done) {
90
- fastify.addHook('onError', async (request, reply, error) => {
91
- if (shouldHandleError(error, request, reply)) {
92
- captureException(error);
93
- }
94
- });
95
-
96
- // registering `onRequest` hook here instead of using Otel `onRequest` callback b/c `onRequest` hook
97
- // is ironically called in the fastify `preHandler` hook which is called later in the lifecycle:
98
- // https://fastify.dev/docs/latest/Reference/Lifecycle/
99
- fastify.addHook('onRequest', async (request, _reply) => {
100
- // Taken from Otel Fastify instrumentation:
101
- // https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts#L94-L96
102
- const routeName = request.routeOptions?.url || request.routerPath;
103
- const method = request.method || 'GET';
104
-
105
- getIsolationScope().setTransactionName(`${method} ${routeName}`);
106
- });
107
-
108
- done();
109
- },
110
- {
111
- [Symbol.for('skip-override')]: true,
112
- [Symbol.for('fastify.display-name')]: 'sentry-fastify-error-handler',
113
- },
114
- );
115
-
116
- fastify.register(plugin);
117
-
118
- // Sadly, middleware spans do not go through `requestHook`, so we handle those here
119
- // We register this hook in this method, because if we register it in the integration `setup`,
120
- // it would always run even for users that are not even using fastify
121
- const client = getClient();
122
- if (client) {
123
- client.on('spanStart', span => {
124
- addFastifySpanAttributes(span);
125
- });
126
- }
127
-
128
- ensureIsWrapped(fastify.addHook, 'fastify');
129
- }
130
-
131
- function addFastifySpanAttributes(span) {
132
- const attributes = spanToJSON(span).data;
133
-
134
- // this is one of: middleware, request_handler
135
- const type = attributes['fastify.type'];
136
-
137
- // If this is already set, or we have no fastify span, no need to process again...
138
- if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) {
139
- return;
140
- }
141
-
142
- span.setAttributes({
143
- [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.fastify',
144
- [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.fastify`,
145
- });
146
-
147
- // Also update the name, we don't need to "middleware - " prefix
148
- const name = attributes['fastify.name'] || attributes['plugin.name'] || attributes['hook.name'];
149
- if (typeof name === 'string') {
150
- // Also remove `fastify -> ` prefix
151
- span.updateName(name.replace(/^fastify -> /, ''));
152
- }
153
- }
154
-
155
- export { fastifyIntegration, instrumentFastify, setupFastifyErrorHandler };
156
- //# sourceMappingURL=fastify.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fastify.js","sources":["../../../../src/integrations/tracing/fastify.ts"],"sourcesContent":["import { FastifyInstrumentation } from '@opentelemetry/instrumentation-fastify';\nimport type { IntegrationFn, Span } from '@sentry/core';\nimport {\n captureException,\n defineIntegration,\n getClient,\n getIsolationScope,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n spanToJSON,\n} from '@sentry/core';\nimport { generateInstrumentOnce } from '../../otel/instrument';\nimport { ensureIsWrapped } from '../../utils/ensureIsWrapped';\n\n/**\n * Minimal request type containing properties around route information.\n * Works for Fastify 3, 4 and presumably 5.\n *\n * Based on https://github.com/fastify/fastify/blob/ce3811f5f718be278bbcd4392c615d64230065a6/types/request.d.ts\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ninterface MinimalFastifyRequest extends Record<string, any> {\n method?: string;\n // since fastify@4.10.0\n routeOptions?: {\n url?: string;\n };\n routerPath?: string;\n}\n\n/**\n * Minimal reply type containing properties needed for error handling.\n *\n * Based on https://github.com/fastify/fastify/blob/ce3811f5f718be278bbcd4392c615d64230065a6/types/reply.d.ts\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ninterface MinimalFastifyReply extends Record<string, any> {\n statusCode: number;\n}\n\n// We inline the types we care about here\ninterface Fastify {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n register: (plugin: any) => void;\n addHook: (hook: string, handler: (...params: unknown[]) => void) => void;\n}\n\ninterface FastifyWithHooks extends Omit<Fastify, 'addHook'> {\n addHook(\n hook: 'onError',\n handler: (request: MinimalFastifyRequest, reply: MinimalFastifyReply, error: Error) => void,\n ): void;\n addHook(hook: 'onRequest', handler: (request: MinimalFastifyRequest, reply: MinimalFastifyReply) => void): void;\n}\n\ninterface FastifyHandlerOptions {\n /**\n * Callback method deciding whether error should be captured and sent to Sentry\n *\n * @param error Captured Fastify error\n * @param request Fastify request (or any object containing at least method, routeOptions.url, and routerPath)\n * @param reply Fastify reply (or any object containing at least statusCode)\n *\n * @example\n *\n * ```javascript\n * setupFastifyErrorHandler(app, {\n * shouldHandleError(_error, _request, reply) {\n * return reply.statusCode >= 400;\n * },\n * });\n * ```\n *\n * If using TypeScript, you can cast the request and reply to get full type safety.\n *\n * ```typescript\n * import type { FastifyRequest, FastifyReply } from 'fastify';\n *\n * setupFastifyErrorHandler(app, {\n * shouldHandleError(error, minimalRequest, minimalReply) {\n * const request = minimalRequest as FastifyRequest;\n * const reply = minimalReply as FastifyReply;\n * return reply.statusCode >= 500;\n * },\n * });\n * ```\n */\n shouldHandleError: (error: Error, request: MinimalFastifyRequest, reply: MinimalFastifyReply) => boolean;\n}\n\nconst INTEGRATION_NAME = 'Fastify';\n\nexport const instrumentFastify = generateInstrumentOnce(\n INTEGRATION_NAME,\n () =>\n // eslint-disable-next-line deprecation/deprecation\n new FastifyInstrumentation({\n requestHook(span) {\n addFastifySpanAttributes(span);\n },\n }),\n);\n\nconst _fastifyIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n instrumentFastify();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for [Fastify](https://fastify.dev/).\n *\n * If you also want to capture errors, you need to call `setupFastifyErrorHandler(app)` after you set up your Fastify server.\n *\n * For more information, see the [fastify documentation](https://docs.sentry.io/platforms/javascript/guides/fastify/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.fastifyIntegration()],\n * })\n * ```\n */\nexport const fastifyIntegration = defineIntegration(_fastifyIntegration);\n\n/**\n * Default function to determine if an error should be sent to Sentry\n *\n * 3xx and 4xx errors are not sent by default.\n */\nfunction defaultShouldHandleError(_error: Error, _request: MinimalFastifyRequest, reply: MinimalFastifyReply): boolean {\n const statusCode = reply.statusCode;\n // 3xx and 4xx errors are not sent by default.\n return statusCode >= 500 || statusCode <= 299;\n}\n\n/**\n * Add an Fastify error handler to capture errors to Sentry.\n *\n * @param fastify The Fastify instance to which to add the error handler\n * @param options Configuration options for the handler\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n * const Fastify = require(\"fastify\");\n *\n * const app = Fastify();\n *\n * Sentry.setupFastifyErrorHandler(app);\n *\n * // Add your routes, etc.\n *\n * app.listen({ port: 3000 });\n * ```\n */\nexport function setupFastifyErrorHandler(fastify: Fastify, options?: Partial<FastifyHandlerOptions>): void {\n const shouldHandleError = options?.shouldHandleError || defaultShouldHandleError;\n\n const plugin = Object.assign(\n function (fastify: FastifyWithHooks, _options: unknown, done: () => void): void {\n fastify.addHook('onError', async (request, reply, error) => {\n if (shouldHandleError(error, request, reply)) {\n captureException(error);\n }\n });\n\n // registering `onRequest` hook here instead of using Otel `onRequest` callback b/c `onRequest` hook\n // is ironically called in the fastify `preHandler` hook which is called later in the lifecycle:\n // https://fastify.dev/docs/latest/Reference/Lifecycle/\n fastify.addHook('onRequest', async (request, _reply) => {\n // Taken from Otel Fastify instrumentation:\n // https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/plugins/node/opentelemetry-instrumentation-fastify/src/instrumentation.ts#L94-L96\n const routeName = request.routeOptions?.url || request.routerPath;\n const method = request.method || 'GET';\n\n getIsolationScope().setTransactionName(`${method} ${routeName}`);\n });\n\n done();\n },\n {\n [Symbol.for('skip-override')]: true,\n [Symbol.for('fastify.display-name')]: 'sentry-fastify-error-handler',\n },\n );\n\n fastify.register(plugin);\n\n // Sadly, middleware spans do not go through `requestHook`, so we handle those here\n // We register this hook in this method, because if we register it in the integration `setup`,\n // it would always run even for users that are not even using fastify\n const client = getClient();\n if (client) {\n client.on('spanStart', span => {\n addFastifySpanAttributes(span);\n });\n }\n\n ensureIsWrapped(fastify.addHook, 'fastify');\n}\n\nfunction addFastifySpanAttributes(span: Span): void {\n const attributes = spanToJSON(span).data;\n\n // this is one of: middleware, request_handler\n const type = attributes['fastify.type'];\n\n // If this is already set, or we have no fastify span, no need to process again...\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] || !type) {\n return;\n }\n\n span.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.otel.fastify',\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${type}.fastify`,\n });\n\n // Also update the name, we don't need to \"middleware - \" prefix\n const name = attributes['fastify.name'] || attributes['plugin.name'] || attributes['hook.name'];\n if (typeof name === 'string') {\n // Also remove `fastify -> ` prefix\n span.updateName(name.replace(/^fastify -> /, ''));\n }\n}\n"],"names":[],"mappings":";;;;;AAcA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsEA,MAAM,gBAAA,GAAmB,SAAS;;AAE3B,MAAM,iBAAkB,GAAE,sBAAsB;AACvD,EAAE,gBAAgB;AAClB,EAAE;AACF;AACA,IAAI,IAAI,sBAAsB,CAAC;AAC/B,MAAM,WAAW,CAAC,IAAI,EAAE;AACxB,QAAQ,wBAAwB,CAAC,IAAI,CAAC;AACtC,OAAO;AACP,KAAK,CAAC;AACN;;AAEA,MAAM,mBAAoB,IAAG,MAAM;AACnC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,iBAAiB,EAAE;AACzB,KAAK;AACL,GAAG;AACH,CAAC,CAAE;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,kBAAmB,GAAE,iBAAiB,CAAC,mBAAmB;;AAEvE;AACA;AACA;AACA;AACA;AACA,SAAS,wBAAwB,CAAC,MAAM,EAAS,QAAQ,EAAyB,KAAK,EAAgC;AACvH,EAAE,MAAM,UAAA,GAAa,KAAK,CAAC,UAAU;AACrC;AACA,EAAE,OAAO,UAAW,IAAG,OAAO,UAAA,IAAc,GAAG;AAC/C;;AAEA;AACA;AACA;AAC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