@sentry/node 9.34.0 → 9.35.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.
- package/build/cjs/index.js +10 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/integrations/anr/index.js +1 -1
- package/build/cjs/integrations/featureFlagShims/launchDarkly.js +43 -0
- package/build/cjs/integrations/featureFlagShims/launchDarkly.js.map +1 -0
- package/build/cjs/integrations/featureFlagShims/openFeature.js +55 -0
- package/build/cjs/integrations/featureFlagShims/openFeature.js.map +1 -0
- package/build/cjs/integrations/featureFlagShims/statsig.js +23 -0
- package/build/cjs/integrations/featureFlagShims/statsig.js.map +1 -0
- package/build/cjs/integrations/featureFlagShims/unleash.js +23 -0
- package/build/cjs/integrations/featureFlagShims/unleash.js.map +1 -0
- package/build/cjs/integrations/local-variables/local-variables-async.js +1 -1
- package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js +2 -7
- package/build/cjs/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
- package/build/esm/index.js +4 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/integrations/anr/index.js +1 -1
- package/build/esm/integrations/anr/worker-script.js +2 -2
- package/build/esm/integrations/featureFlagShims/launchDarkly.js +40 -0
- package/build/esm/integrations/featureFlagShims/launchDarkly.js.map +1 -0
- package/build/esm/integrations/featureFlagShims/openFeature.js +52 -0
- package/build/esm/integrations/featureFlagShims/openFeature.js.map +1 -0
- package/build/esm/integrations/featureFlagShims/statsig.js +21 -0
- package/build/esm/integrations/featureFlagShims/statsig.js.map +1 -0
- package/build/esm/integrations/featureFlagShims/unleash.js +21 -0
- package/build/esm/integrations/featureFlagShims/unleash.js.map +1 -0
- package/build/esm/integrations/local-variables/local-variables-async.js +1 -1
- package/build/esm/integrations/local-variables/worker-script.js +2 -2
- package/build/esm/integrations/tracing/fastify/fastify-otel/index.js +2 -7
- package/build/esm/integrations/tracing/fastify/fastify-otel/index.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integrations/featureFlagShims/index.d.ts +5 -0
- package/build/types/integrations/featureFlagShims/index.d.ts.map +1 -0
- package/build/types/integrations/featureFlagShims/launchDarkly.d.ts +10 -0
- package/build/types/integrations/featureFlagShims/launchDarkly.d.ts.map +1 -0
- package/build/types/integrations/featureFlagShims/openFeature.d.ts +23 -0
- package/build/types/integrations/featureFlagShims/openFeature.d.ts.map +1 -0
- package/build/types/integrations/featureFlagShims/statsig.d.ts +6 -0
- package/build/types/integrations/featureFlagShims/statsig.d.ts.map +1 -0
- package/build/types/integrations/featureFlagShims/unleash.d.ts +6 -0
- package/build/types/integrations/featureFlagShims/unleash.d.ts.map +1 -0
- package/build/types-ts3.8/index.d.ts +1 -0
- package/build/types-ts3.8/integrations/featureFlagShims/index.d.ts +5 -0
- package/build/types-ts3.8/integrations/featureFlagShims/launchDarkly.d.ts +10 -0
- package/build/types-ts3.8/integrations/featureFlagShims/openFeature.d.ts +23 -0
- package/build/types-ts3.8/integrations/featureFlagShims/statsig.d.ts +6 -0
- package/build/types-ts3.8/integrations/featureFlagShims/unleash.d.ts +6 -0
- package/package.json +3 -3
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineIntegration, isBrowser, consoleSandbox } from '@sentry/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This is a shim for the LaunchDarkly integration.
|
|
5
|
+
* We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.
|
|
6
|
+
*/
|
|
7
|
+
const launchDarklyIntegrationShim = defineIntegration((_options) => {
|
|
8
|
+
if (!isBrowser()) {
|
|
9
|
+
consoleSandbox(() => {
|
|
10
|
+
// eslint-disable-next-line no-console
|
|
11
|
+
console.warn('The launchDarklyIntegration() can only be used in the browser.');
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
name: 'LaunchDarkly',
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* This is a shim for the LaunchDarkly flag used handler.
|
|
22
|
+
*/
|
|
23
|
+
function buildLaunchDarklyFlagUsedHandlerShim() {
|
|
24
|
+
if (!isBrowser()) {
|
|
25
|
+
consoleSandbox(() => {
|
|
26
|
+
// eslint-disable-next-line no-console
|
|
27
|
+
console.warn('The buildLaunchDarklyFlagUsedHandler() can only be used in the browser.');
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
name: 'sentry-flag-auditor',
|
|
33
|
+
type: 'flag-used',
|
|
34
|
+
synchronous: true,
|
|
35
|
+
method: () => null,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { buildLaunchDarklyFlagUsedHandlerShim, launchDarklyIntegrationShim };
|
|
40
|
+
//# sourceMappingURL=launchDarkly.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launchDarkly.js","sources":["../../../../src/integrations/featureFlagShims/launchDarkly.ts"],"sourcesContent":["import { consoleSandbox, defineIntegration, isBrowser } from '@sentry/core';\n\n/**\n * This is a shim for the LaunchDarkly integration.\n * We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.\n */\nexport const launchDarklyIntegrationShim = defineIntegration((_options?: unknown) => {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The launchDarklyIntegration() can only be used in the browser.');\n });\n }\n\n return {\n name: 'LaunchDarkly',\n };\n});\n\n/**\n * This is a shim for the LaunchDarkly flag used handler.\n */\nexport function buildLaunchDarklyFlagUsedHandlerShim(): unknown {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The buildLaunchDarklyFlagUsedHandler() can only be used in the browser.');\n });\n }\n\n return {\n name: 'sentry-flag-auditor',\n type: 'flag-used',\n synchronous: true,\n method: () => null,\n };\n}\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACO,MAAM,8BAA8B,iBAAiB,CAAC,CAAC,QAAQ,KAAe;AACrF,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE;AACpB,IAAI,cAAc,CAAC,MAAM;AACzB;AACA,MAAM,OAAO,CAAC,IAAI,CAAC,gEAAgE,CAAC;AACpF,KAAK,CAAC;AACN;;AAEA,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,cAAc;AACxB,GAAG;AACH,CAAC;;AAED;AACA;AACA;AACO,SAAS,oCAAoC,GAAY;AAChE,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE;AACpB,IAAI,cAAc,CAAC,MAAM;AACzB;AACA,MAAM,OAAO,CAAC,IAAI,CAAC,yEAAyE,CAAC;AAC7F,KAAK,CAAC;AACN;;AAEA,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,qBAAqB;AAC/B,IAAI,IAAI,EAAE,WAAW;AACrB,IAAI,WAAW,EAAE,IAAI;AACrB,IAAI,MAAM,EAAE,MAAM,IAAI;AACtB,GAAG;AACH;;;;"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { defineIntegration, isBrowser, consoleSandbox } from '@sentry/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This is a shim for the OpenFeature integration.
|
|
5
|
+
* We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.
|
|
6
|
+
*/
|
|
7
|
+
const openFeatureIntegrationShim = defineIntegration((_options) => {
|
|
8
|
+
if (!isBrowser()) {
|
|
9
|
+
consoleSandbox(() => {
|
|
10
|
+
// eslint-disable-next-line no-console
|
|
11
|
+
console.warn('The openFeatureIntegration() can only be used in the browser.');
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
name: 'OpenFeature',
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* This is a shim for the OpenFeature integration hook.
|
|
22
|
+
*/
|
|
23
|
+
class OpenFeatureIntegrationHookShim {
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
constructor() {
|
|
28
|
+
if (!isBrowser()) {
|
|
29
|
+
consoleSandbox(() => {
|
|
30
|
+
// eslint-disable-next-line no-console
|
|
31
|
+
console.warn('The OpenFeatureIntegrationHook can only be used in the browser.');
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
after() {
|
|
40
|
+
// No-op
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
*/
|
|
46
|
+
error() {
|
|
47
|
+
// No-op
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { OpenFeatureIntegrationHookShim, openFeatureIntegrationShim };
|
|
52
|
+
//# sourceMappingURL=openFeature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openFeature.js","sources":["../../../../src/integrations/featureFlagShims/openFeature.ts"],"sourcesContent":["import { consoleSandbox, defineIntegration, isBrowser } from '@sentry/core';\n\n/**\n * This is a shim for the OpenFeature integration.\n * We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.\n */\nexport const openFeatureIntegrationShim = defineIntegration((_options?: unknown) => {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The openFeatureIntegration() can only be used in the browser.');\n });\n }\n\n return {\n name: 'OpenFeature',\n };\n});\n\n/**\n * This is a shim for the OpenFeature integration hook.\n */\nexport class OpenFeatureIntegrationHookShim {\n /**\n *\n */\n public constructor() {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The OpenFeatureIntegrationHook can only be used in the browser.');\n });\n }\n }\n\n /**\n *\n */\n public after(): void {\n // No-op\n }\n\n /**\n *\n */\n public error(): void {\n // No-op\n }\n}\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACO,MAAM,6BAA6B,iBAAiB,CAAC,CAAC,QAAQ,KAAe;AACpF,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE;AACpB,IAAI,cAAc,CAAC,MAAM;AACzB;AACA,MAAM,OAAO,CAAC,IAAI,CAAC,+DAA+D,CAAC;AACnF,KAAK,CAAC;AACN;;AAEA,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,aAAa;AACvB,GAAG;AACH,CAAC;;AAED;AACA;AACA;AACO,MAAM,8BAA+B,CAAA;AAC5C;AACA;AACA;AACA,GAAS,WAAW,GAAG;AACvB,IAAI,IAAI,CAAC,SAAS,EAAE,EAAE;AACtB,MAAM,cAAc,CAAC,MAAM;AAC3B;AACA,QAAQ,OAAO,CAAC,IAAI,CAAC,iEAAiE,CAAC;AACvF,OAAO,CAAC;AACR;AACA;;AAEA;AACA;AACA;AACA,GAAS,KAAK,GAAS;AACvB;AACA;;AAEA;AACA;AACA;AACA,GAAS,KAAK,GAAS;AACvB;AACA;AACA;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineIntegration, isBrowser, consoleSandbox } from '@sentry/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This is a shim for the Statsig integration.
|
|
5
|
+
* We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.
|
|
6
|
+
*/
|
|
7
|
+
const statsigIntegrationShim = defineIntegration((_options) => {
|
|
8
|
+
if (!isBrowser()) {
|
|
9
|
+
consoleSandbox(() => {
|
|
10
|
+
// eslint-disable-next-line no-console
|
|
11
|
+
console.warn('The statsigIntegration() can only be used in the browser.');
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
name: 'Statsig',
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export { statsigIntegrationShim };
|
|
21
|
+
//# sourceMappingURL=statsig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statsig.js","sources":["../../../../src/integrations/featureFlagShims/statsig.ts"],"sourcesContent":["import { consoleSandbox, defineIntegration, isBrowser } from '@sentry/core';\n\n/**\n * This is a shim for the Statsig integration.\n * We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.\n */\nexport const statsigIntegrationShim = defineIntegration((_options?: unknown) => {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The statsigIntegration() can only be used in the browser.');\n });\n }\n\n return {\n name: 'Statsig',\n };\n});\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACO,MAAM,yBAAyB,iBAAiB,CAAC,CAAC,QAAQ,KAAe;AAChF,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE;AACpB,IAAI,cAAc,CAAC,MAAM;AACzB;AACA,MAAM,OAAO,CAAC,IAAI,CAAC,2DAA2D,CAAC;AAC/E,KAAK,CAAC;AACN;;AAEA,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,SAAS;AACnB,GAAG;AACH,CAAC;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineIntegration, isBrowser, consoleSandbox } from '@sentry/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This is a shim for the Unleash integration.
|
|
5
|
+
* We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.
|
|
6
|
+
*/
|
|
7
|
+
const unleashIntegrationShim = defineIntegration((_options) => {
|
|
8
|
+
if (!isBrowser()) {
|
|
9
|
+
consoleSandbox(() => {
|
|
10
|
+
// eslint-disable-next-line no-console
|
|
11
|
+
console.warn('The unleashIntegration() can only be used in the browser.');
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
name: 'Unleash',
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export { unleashIntegrationShim };
|
|
21
|
+
//# sourceMappingURL=unleash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unleash.js","sources":["../../../../src/integrations/featureFlagShims/unleash.ts"],"sourcesContent":["import { consoleSandbox, defineIntegration, isBrowser } from '@sentry/core';\n\n/**\n * This is a shim for the Unleash integration.\n * We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.\n */\nexport const unleashIntegrationShim = defineIntegration((_options?: unknown) => {\n if (!isBrowser()) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('The unleashIntegration() can only be used in the browser.');\n });\n }\n\n return {\n name: 'Unleash',\n };\n});\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACO,MAAM,yBAAyB,iBAAiB,CAAC,CAAC,QAAQ,KAAe;AAChF,EAAE,IAAI,CAAC,SAAS,EAAE,EAAE;AACpB,IAAI,cAAc,CAAC,MAAM;AACzB;AACA,MAAM,OAAO,CAAC,IAAI,CAAC,2DAA2D,CAAC;AAC/E,KAAK,CAAC;AACN;;AAEA,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,SAAS;AACnB,GAAG;AACH,CAAC;;;;"}
|
|
@@ -4,7 +4,7 @@ import { isDebuggerEnabled } from '../../utils/debug.js';
|
|
|
4
4
|
import { LOCAL_VARIABLES_KEY, functionNamesMatch } from './common.js';
|
|
5
5
|
|
|
6
6
|
// This string is a placeholder that gets overwritten with the worker code.
|
|
7
|
-
const base64WorkerScript = '
|
|
7
|
+
const base64WorkerScript = 'LyohIEBzZW50cnkvbm9kZSA5LjM1LjAgKDhkNTA4ZWYpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGF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XIuc2V0UGF1c2VPbkV4Y2VwdGlvbnMiLHtzdGF0ZToiYWxsIn0pfSksKGFzeW5jIGU9PntsKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pKX19KSgpLmNhdGNoKChlPT57bCgiRmFpbGVkIHRvIHN0YXJ0IGRlYnVnZ2VyIixlKX0pKSxzZXRJbnRlcnZhbCgoKCk9Pnt9KSwxZTQpOw==';
|
|
8
8
|
|
|
9
9
|
function log(...args) {
|
|
10
10
|
logger.log('[LocalVariables]', ...args);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! @sentry/node 9.
|
|
2
|
-
import{Session as e}from"node:inspector/promises";import{workerData as t}from"node:worker_threads";const n="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,o=globalThis,i="9.
|
|
1
|
+
/*! @sentry/node 9.35.0 (8d508ef) | https://github.com/getsentry/sentry-javascript */
|
|
2
|
+
import{Session as e}from"node:inspector/promises";import{workerData as t}from"node:worker_threads";const n="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,o=globalThis,i="9.35.0";const a=["debug","info","warn","error","log","assert","trace"],s={};function c(e){if(!("console"in o))return e();const t=o.console,n={},i=Object.keys(s);i.forEach((e=>{const o=s[e];n[e]=t[e],t[e]=o}));try{return e()}finally{i.forEach((e=>{t[e]=n[e]}))}}!function(e,t,n=o){const a=n.__SENTRY__=n.__SENTRY__||{},s=a[i]=a[i]||{};s[e]||(s[e]=t())}("logger",(function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return n?a.forEach((n=>{t[n]=(...t)=>{e&&c((()=>{o.console[n](`Sentry Logger [${n}]:`,...t)}))}})):a.forEach((e=>{t[e]=()=>{}})),t}));const r="__SENTRY_ERROR_LOCAL_VARIABLES__";const u=t;function l(...e){u.debug&&c((()=>console.log("[LocalVariables Worker]",...e)))}async function f(e,t,n,o){const i=await e.post("Runtime.getProperties",{objectId:t,ownProperties:!0});o[n]=i.result.filter((e=>"length"!==e.name&&!isNaN(parseInt(e.name,10)))).sort(((e,t)=>parseInt(e.name,10)-parseInt(t.name,10))).map((e=>e.value?.value))}async function g(e,t,n,o){const i=await e.post("Runtime.getProperties",{objectId:t,ownProperties:!0});o[n]=i.result.map((e=>[e.name,e.value?.value])).reduce(((e,[t,n])=>(e[t]=n,e)),{})}function d(e,t){e.value&&("value"in e.value?void 0===e.value.value||null===e.value.value?t[e.name]=`<${e.value.value}>`:t[e.name]=e.value.value:"description"in e.value&&"function"!==e.value.type?t[e.name]=`<${e.value.description}>`:"undefined"===e.value.type&&(t[e.name]="<undefined>"))}async function b(e,t){const n=await e.post("Runtime.getProperties",{objectId:t,ownProperties:!0}),o={};for(const t of n.result)if(t.value?.objectId&&"Array"===t.value.className){const n=t.value.objectId;await f(e,n,t.name,o)}else if(t.value?.objectId&&"Object"===t.value.className){const n=t.value.objectId;await g(e,n,t.name,o)}else t.value&&d(t,o);return o}let p;(async function(){const t=new e;t.connectToMainThread(),l("Connected to main thread");let n=!1;t.on("Debugger.resumed",(()=>{n=!1})),t.on("Debugger.paused",(e=>{n=!0,async function(e,{reason:t,data:{objectId:n},callFrames:o}){if("exception"!==t&&"promiseRejection"!==t)return;if(p?.(),null==n)return;const i=[];for(let t=0;t<o.length;t++){const{scopeChain:n,functionName:a,this:s}=o[t],c=n.find((e=>"local"===e.type)),r="global"!==s.className&&s.className?`${s.className}.${a}`:a;if(void 0===c?.object.objectId)i[t]={function:r};else{const n=await b(e,c.object.objectId);i[t]={function:r,vars:n}}}await e.post("Runtime.callFunctionOn",{functionDeclaration:`function() { this.${r} = this.${r} || ${JSON.stringify(i)}; }`,silent:!0,objectId:n}),await e.post("Runtime.releaseObject",{objectId:n})}(t,e.params).then((async()=>{n&&await t.post("Debugger.resume")}),(async e=>{n&&await t.post("Debugger.resume")}))})),await t.post("Debugger.enable");const o=!1!==u.captureAllExceptions;if(await t.post("Debugger.setPauseOnExceptions",{state:o?"all":"uncaught"}),o){const e=u.maxExceptionsPerSecond||50;p=function(e,t,n){let o=0,i=5,a=0;return setInterval((()=>{0===a?o>e&&(i*=2,n(i),i>86400&&(i=86400),a=i):(a-=1,0===a&&t()),o=0}),1e3).unref(),()=>{o+=1}}(e,(async()=>{l("Rate-limit lifted."),await t.post("Debugger.setPauseOnExceptions",{state:"all"})}),(async e=>{l(`Rate-limit exceeded. Disabling capturing of caught exceptions for ${e} seconds.`),await t.post("Debugger.setPauseOnExceptions",{state:"uncaught"})}))}})().catch((e=>{l("Failed to start debugger",e)})),setInterval((()=>{}),1e4);
|
|
@@ -3,6 +3,7 @@ import { diag, propagation, context, trace, SpanStatusCode } from '@opentelemetr
|
|
|
3
3
|
import { getRPCMetadata, RPCType } from '@opentelemetry/core';
|
|
4
4
|
import { InstrumentationBase } from '@opentelemetry/instrumentation';
|
|
5
5
|
import { ATTR_HTTP_ROUTE, ATTR_SERVICE_NAME, ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_STATUS_CODE } from '@opentelemetry/semantic-conventions';
|
|
6
|
+
import * as minimatch from 'minimatch';
|
|
6
7
|
|
|
7
8
|
/*
|
|
8
9
|
Vendored in and modified from @fastify/otel version 0.8.0
|
|
@@ -89,18 +90,12 @@ class FastifyOtelInstrumentation extends InstrumentationBase {
|
|
|
89
90
|
throw new TypeError('ignorePaths must be a string or a function');
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
|
|
93
|
+
const globMatcher = minimatch.minimatch;
|
|
93
94
|
|
|
94
95
|
this[kIgnorePaths] = routeOptions => {
|
|
95
96
|
if (typeof ignorePaths === 'function') {
|
|
96
97
|
return ignorePaths(routeOptions);
|
|
97
98
|
} else {
|
|
98
|
-
// Using minimatch to match the path until path.matchesGlob is out of experimental
|
|
99
|
-
// path.matchesGlob uses minimatch internally
|
|
100
|
-
if (globMatcher == null) {
|
|
101
|
-
globMatcher = require('minimatch').minimatch;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
99
|
return globMatcher(routeOptions.url, ignorePaths);
|
|
105
100
|
}
|
|
106
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../src/integrations/tracing/fastify/fastify-otel/index.js"],"sourcesContent":["/*\nVendored in and modified from @fastify/otel version 0.8.0\nhttps://github.com/fastify/otel/releases/tag/v0.8.0\n\nTried not to modify the original code too much keeping it as a JavaScript CJS module to make it easier to update when required\n\nModifications include:\n- Removed reading of package.json to get the version and package name\n\nMIT License\n\nCopyright (c) 2024 Fastify\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\n/* eslint-disable @typescript-eslint/explicit-member-accessibility */\n/* eslint-disable jsdoc/require-jsdoc */\n/* eslint-disable max-lines */\n/* eslint-disable no-param-reassign */\nimport dc from 'node:diagnostics_channel';\nimport { context, diag, propagation, SpanStatusCode, trace } from '@opentelemetry/api';\nimport { getRPCMetadata, RPCType } from '@opentelemetry/core';\nimport { InstrumentationBase } from '@opentelemetry/instrumentation';\nimport {\n ATTR_HTTP_REQUEST_METHOD,\n ATTR_HTTP_RESPONSE_STATUS_CODE,\n ATTR_HTTP_ROUTE,\n ATTR_SERVICE_NAME,\n} from '@opentelemetry/semantic-conventions';\n\n// SENTRY VENDOR NOTE\n// Instead of using the package.json file, we hard code the package name and version here.\nconst PACKAGE_NAME = '@fastify/otel';\nconst PACKAGE_VERSION = '0.8.0';\n\n// Constants\nconst SUPPORTED_VERSIONS = '>=4.0.0 <6';\nconst FASTIFY_HOOKS = [\n 'onRequest',\n 'preParsing',\n 'preValidation',\n 'preHandler',\n 'preSerialization',\n 'onSend',\n 'onResponse',\n 'onError',\n];\nconst ATTRIBUTE_NAMES = {\n HOOK_NAME: 'hook.name',\n FASTIFY_TYPE: 'fastify.type',\n HOOK_CALLBACK_NAME: 'hook.callback.name',\n ROOT: 'fastify.root',\n};\nconst HOOK_TYPES = {\n ROUTE: 'route-hook',\n INSTANCE: 'hook',\n HANDLER: 'request-handler',\n};\nconst ANONYMOUS_FUNCTION_NAME = 'anonymous';\n\n// Symbols\nconst kInstrumentation = Symbol('fastify otel instance');\nconst kRequestSpan = Symbol('fastify otel request spans');\nconst kRequestContext = Symbol('fastify otel request context');\nconst kAddHookOriginal = Symbol('fastify otel addhook original');\nconst kSetNotFoundOriginal = Symbol('fastify otel setnotfound original');\nconst kIgnorePaths = Symbol('fastify otel ignore path');\n\nexport class FastifyOtelInstrumentation extends InstrumentationBase {\n constructor(config) {\n super(PACKAGE_NAME, PACKAGE_VERSION, config);\n this.servername = config?.servername ?? process.env.OTEL_SERVICE_NAME ?? 'fastify';\n this[kIgnorePaths] = null;\n this._logger = diag.createComponentLogger({ namespace: PACKAGE_NAME });\n\n if (config?.ignorePaths != null || process.env.OTEL_FASTIFY_IGNORE_PATHS != null) {\n const ignorePaths = config?.ignorePaths ?? process.env.OTEL_FASTIFY_IGNORE_PATHS;\n\n if ((typeof ignorePaths !== 'string' || ignorePaths.length === 0) && typeof ignorePaths !== 'function') {\n throw new TypeError('ignorePaths must be a string or a function');\n }\n\n let globMatcher = null;\n\n this[kIgnorePaths] = routeOptions => {\n if (typeof ignorePaths === 'function') {\n return ignorePaths(routeOptions);\n } else {\n // Using minimatch to match the path until path.matchesGlob is out of experimental\n // path.matchesGlob uses minimatch internally\n if (globMatcher == null) {\n globMatcher = require('minimatch').minimatch;\n }\n\n return globMatcher(routeOptions.url, ignorePaths);\n }\n };\n }\n }\n\n enable() {\n if (this._handleInitialization === undefined && this.getConfig().registerOnInitialization) {\n const FastifyInstrumentationPlugin = this.plugin();\n this._handleInitialization = message => {\n message.fastify.register(FastifyInstrumentationPlugin);\n };\n dc.subscribe('fastify.initialization', this._handleInitialization);\n }\n return super.enable();\n }\n\n disable() {\n if (this._handleInitialization) {\n dc.unsubscribe('fastify.initialization', this._handleInitialization);\n this._handleInitialization = undefined;\n }\n return super.disable();\n }\n\n // We do not do patching in this instrumentation\n init() {\n return [];\n }\n\n plugin() {\n const instrumentation = this;\n\n FastifyInstrumentationPlugin[Symbol.for('skip-override')] = true;\n FastifyInstrumentationPlugin[Symbol.for('fastify.display-name')] = '@fastify/otel';\n FastifyInstrumentationPlugin[Symbol.for('plugin-meta')] = {\n fastify: SUPPORTED_VERSIONS,\n name: '@fastify/otel',\n };\n\n return FastifyInstrumentationPlugin;\n\n function FastifyInstrumentationPlugin(instance, opts, done) {\n instance.decorate(kInstrumentation, instrumentation);\n // addHook and notfoundHandler are essentially inherited from the prototype\n // what is important is to bound it to the right instance\n instance.decorate(kAddHookOriginal, instance.addHook);\n instance.decorate(kSetNotFoundOriginal, instance.setNotFoundHandler);\n instance.decorateRequest('opentelemetry', function openetelemetry() {\n const ctx = this[kRequestContext];\n const span = this[kRequestSpan];\n return {\n span,\n tracer: instrumentation.tracer,\n context: ctx,\n inject: (carrier, setter) => {\n return propagation.inject(ctx, carrier, setter);\n },\n extract: (carrier, getter) => {\n return propagation.extract(ctx, carrier, getter);\n },\n };\n });\n instance.decorateRequest(kRequestSpan, null);\n instance.decorateRequest(kRequestContext, null);\n\n instance.addHook('onRoute', function (routeOptions) {\n if (instrumentation[kIgnorePaths]?.(routeOptions) === true) {\n instrumentation._logger.debug(\n `Ignoring route instrumentation ${routeOptions.method} ${routeOptions.url} because it matches the ignore path`,\n );\n return;\n }\n\n for (const hook of FASTIFY_HOOKS) {\n if (routeOptions[hook] != null) {\n const handlerLike = routeOptions[hook];\n\n if (typeof handlerLike === 'function') {\n routeOptions[hook] = handlerWrapper(handlerLike, {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - route -> ${hook}`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.ROUTE,\n [ATTR_HTTP_ROUTE]: routeOptions.url,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n handlerLike.name?.length > 0 ? handlerLike.name : ANONYMOUS_FUNCTION_NAME /* c8 ignore next */,\n });\n } else if (Array.isArray(handlerLike)) {\n const wrappedHandlers = [];\n\n for (const handler of handlerLike) {\n wrappedHandlers.push(\n handlerWrapper(handler, {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - route -> ${hook}`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.ROUTE,\n [ATTR_HTTP_ROUTE]: routeOptions.url,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n handler.name?.length > 0 ? handler.name : ANONYMOUS_FUNCTION_NAME,\n }),\n );\n }\n\n routeOptions[hook] = wrappedHandlers;\n }\n }\n }\n\n // We always want to add the onSend hook to the route to be executed last\n if (routeOptions.onSend != null) {\n routeOptions.onSend = Array.isArray(routeOptions.onSend)\n ? [...routeOptions.onSend, onSendHook]\n : [routeOptions.onSend, onSendHook];\n } else {\n routeOptions.onSend = onSendHook;\n }\n\n // We always want to add the onError hook to the route to be executed last\n if (routeOptions.onError != null) {\n routeOptions.onError = Array.isArray(routeOptions.onError)\n ? [...routeOptions.onError, onErrorHook]\n : [routeOptions.onError, onErrorHook];\n } else {\n routeOptions.onError = onErrorHook;\n }\n\n routeOptions.handler = handlerWrapper(routeOptions.handler, {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - route-handler`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.HANDLER,\n [ATTR_HTTP_ROUTE]: routeOptions.url,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n routeOptions.handler.name.length > 0 ? routeOptions.handler.name : ANONYMOUS_FUNCTION_NAME,\n });\n });\n\n instance.addHook('onRequest', function (request, _reply, hookDone) {\n if (this[kInstrumentation].isEnabled() === false) {\n return hookDone();\n } else if (\n this[kInstrumentation][kIgnorePaths]?.({\n url: request.url,\n method: request.method,\n }) === true\n ) {\n this[kInstrumentation]._logger.debug(\n `Ignoring request ${request.method} ${request.url} because it matches the ignore path`,\n );\n return hookDone();\n }\n\n let ctx = context.active();\n\n if (trace.getSpan(ctx) == null) {\n ctx = propagation.extract(ctx, request.headers);\n }\n\n const rpcMetadata = getRPCMetadata(ctx);\n\n if (request.routeOptions.url != null && rpcMetadata?.type === RPCType.HTTP) {\n rpcMetadata.route = request.routeOptions.url;\n }\n\n /** @type {import('@opentelemetry/api').Span} */\n const span = this[kInstrumentation].tracer.startSpan(\n 'request',\n {\n attributes: {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.ROOT]: '@fastify/otel',\n [ATTR_HTTP_ROUTE]: request.url,\n [ATTR_HTTP_REQUEST_METHOD]: request.method,\n },\n },\n ctx,\n );\n\n request[kRequestContext] = trace.setSpan(ctx, span);\n request[kRequestSpan] = span;\n\n context.with(request[kRequestContext], () => {\n hookDone();\n });\n });\n\n // onResponse is the last hook to be executed, only added for 404 handlers\n instance.addHook('onResponse', function (request, reply, hookDone) {\n const span = request[kRequestSpan];\n\n if (span != null) {\n span.setStatus({\n code: SpanStatusCode.OK,\n message: 'OK',\n });\n span.setAttributes({\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: 404,\n });\n span.end();\n }\n\n request[kRequestSpan] = null;\n\n hookDone();\n });\n\n instance.addHook = addHookPatched;\n instance.setNotFoundHandler = setNotFoundHandlerPatched;\n\n done();\n\n function onSendHook(request, reply, payload, hookDone) {\n /** @type {import('@opentelemetry/api').Span} */\n const span = request[kRequestSpan];\n\n if (span != null) {\n if (reply.statusCode < 500) {\n span.setStatus({\n code: SpanStatusCode.OK,\n message: 'OK',\n });\n }\n\n span.setAttributes({\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: reply.statusCode,\n });\n span.end();\n }\n\n request[kRequestSpan] = null;\n\n hookDone(null, payload);\n }\n\n function onErrorHook(request, reply, error, hookDone) {\n /** @type {Span} */\n const span = request[kRequestSpan];\n\n if (span != null) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n span.recordException(error);\n }\n\n hookDone();\n }\n\n function addHookPatched(name, hook) {\n const addHookOriginal = this[kAddHookOriginal];\n\n if (FASTIFY_HOOKS.includes(name)) {\n return addHookOriginal.call(\n this,\n name,\n handlerWrapper(hook, {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - ${name}`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n hook.name?.length > 0 ? hook.name : ANONYMOUS_FUNCTION_NAME /* c8 ignore next */,\n }),\n );\n } else {\n return addHookOriginal.call(this, name, hook);\n }\n }\n\n function setNotFoundHandlerPatched(hooks, handler) {\n const setNotFoundHandlerOriginal = this[kSetNotFoundOriginal];\n if (typeof hooks === 'function') {\n handler = handlerWrapper(hooks, {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - not-found-handler`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n hooks.name?.length > 0 ? hooks.name : ANONYMOUS_FUNCTION_NAME /* c8 ignore next */,\n });\n setNotFoundHandlerOriginal.call(this, handler);\n } else {\n if (hooks.preValidation != null) {\n hooks.preValidation = handlerWrapper(hooks.preValidation, {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - not-found-handler - preValidation`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n hooks.preValidation.name?.length > 0\n ? hooks.preValidation.name\n : ANONYMOUS_FUNCTION_NAME /* c8 ignore next */,\n });\n }\n\n if (hooks.preHandler != null) {\n hooks.preHandler = handlerWrapper(hooks.preHandler, {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - not-found-handler - preHandler`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n hooks.preHandler.name?.length > 0\n ? hooks.preHandler.name\n : ANONYMOUS_FUNCTION_NAME /* c8 ignore next */,\n });\n }\n\n handler = handlerWrapper(handler, {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - not-found-handler`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n handler.name?.length > 0 ? handler.name : ANONYMOUS_FUNCTION_NAME /* c8 ignore next */,\n });\n setNotFoundHandlerOriginal.call(this, hooks, handler);\n }\n }\n\n function handlerWrapper(handler, spanAttributes = {}) {\n return function handlerWrapped(...args) {\n /** @type {FastifyOtelInstrumentation} */\n const instrumentation = this[kInstrumentation];\n const [request] = args;\n\n if (instrumentation.isEnabled() === false) {\n return handler.call(this, ...args);\n }\n\n const ctx = request[kRequestContext] ?? context.active();\n const span = instrumentation.tracer.startSpan(\n `handler - ${\n handler.name?.length > 0\n ? handler.name\n : this.pluginName /* c8 ignore next */ ?? ANONYMOUS_FUNCTION_NAME /* c8 ignore next */\n }`,\n {\n attributes: spanAttributes,\n },\n ctx,\n );\n\n return context.with(\n trace.setSpan(ctx, span),\n function () {\n try {\n const res = handler.call(this, ...args);\n\n if (typeof res?.then === 'function') {\n return res.then(\n result => {\n span.end();\n return result;\n },\n error => {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n span.recordException(error);\n span.end();\n return Promise.reject(error);\n },\n );\n }\n\n span.end();\n return res;\n } catch (error) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n span.recordException(error);\n span.end();\n throw error;\n }\n },\n this,\n );\n };\n }\n }\n }\n}\n"],"names":["dc"],"mappings":";;;;;;AAAA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAiBA;AACA;AACA,MAAM,YAAA,GAAe,eAAe;AACpC,MAAM,eAAA,GAAkB,OAAO;;AAE/B;AACA,MAAM,kBAAA,GAAqB,YAAY;AACvC,MAAM,gBAAgB;AACtB,EAAE,WAAW;AACb,EAAE,YAA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;AAEA,gBAAA,IAAA,CAAA,GAAA,EAAA;AACA,gBAAA,OAAA,GAAA;AACA,eAAA,CAAA,OAAA,KAAA,EAAA;AACA,gBAAA,IAAA,CAAA,SAAA,CAAA;AACA,kBAAA,IAAA,EAAA,cAAA,CAAA,KAAA;AACA,kBAAA,OAAA,EAAA,KAAA,CAAA,OAAA;AACA,iBAAA,CAAA;AACA,gBAAA,IAAA,CAAA,eAAA,CAAA,KAAA,CAAA;AACA,gBAAA,IAAA,CAAA,GAAA,EAAA;AACA,gBAAA,MAAA,KAAA;AACA;AACA,aAAA;AACA,YAAA,IAAA;AACA,WAAA;AACA,SAAA;AACA;AACA;AACA;AACA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/integrations/tracing/fastify/fastify-otel/index.js"],"sourcesContent":["/*\nVendored in and modified from @fastify/otel version 0.8.0\nhttps://github.com/fastify/otel/releases/tag/v0.8.0\n\nTried not to modify the original code too much keeping it as a JavaScript CJS module to make it easier to update when required\n\nModifications include:\n- Removed reading of package.json to get the version and package name\n\nMIT License\n\nCopyright (c) 2024 Fastify\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\n/* eslint-disable jsdoc/require-jsdoc */\n/* eslint-disable max-lines */\n/* eslint-disable no-param-reassign */\nimport dc from 'node:diagnostics_channel';\nimport { context, diag, propagation, SpanStatusCode, trace } from '@opentelemetry/api';\nimport { getRPCMetadata, RPCType } from '@opentelemetry/core';\nimport { InstrumentationBase } from '@opentelemetry/instrumentation';\nimport {\n ATTR_HTTP_REQUEST_METHOD,\n ATTR_HTTP_RESPONSE_STATUS_CODE,\n ATTR_HTTP_ROUTE,\n ATTR_SERVICE_NAME,\n} from '@opentelemetry/semantic-conventions';\nimport * as minimatch from 'minimatch';\n\n// SENTRY VENDOR NOTE\n// Instead of using the package.json file, we hard code the package name and version here.\nconst PACKAGE_NAME = '@fastify/otel';\nconst PACKAGE_VERSION = '0.8.0';\n\n// Constants\nconst SUPPORTED_VERSIONS = '>=4.0.0 <6';\nconst FASTIFY_HOOKS = [\n 'onRequest',\n 'preParsing',\n 'preValidation',\n 'preHandler',\n 'preSerialization',\n 'onSend',\n 'onResponse',\n 'onError',\n];\nconst ATTRIBUTE_NAMES = {\n HOOK_NAME: 'hook.name',\n FASTIFY_TYPE: 'fastify.type',\n HOOK_CALLBACK_NAME: 'hook.callback.name',\n ROOT: 'fastify.root',\n};\nconst HOOK_TYPES = {\n ROUTE: 'route-hook',\n INSTANCE: 'hook',\n HANDLER: 'request-handler',\n};\nconst ANONYMOUS_FUNCTION_NAME = 'anonymous';\n\n// Symbols\nconst kInstrumentation = Symbol('fastify otel instance');\nconst kRequestSpan = Symbol('fastify otel request spans');\nconst kRequestContext = Symbol('fastify otel request context');\nconst kAddHookOriginal = Symbol('fastify otel addhook original');\nconst kSetNotFoundOriginal = Symbol('fastify otel setnotfound original');\nconst kIgnorePaths = Symbol('fastify otel ignore path');\n\nexport class FastifyOtelInstrumentation extends InstrumentationBase {\n constructor(config) {\n super(PACKAGE_NAME, PACKAGE_VERSION, config);\n this.servername = config?.servername ?? process.env.OTEL_SERVICE_NAME ?? 'fastify';\n this[kIgnorePaths] = null;\n this._logger = diag.createComponentLogger({ namespace: PACKAGE_NAME });\n\n if (config?.ignorePaths != null || process.env.OTEL_FASTIFY_IGNORE_PATHS != null) {\n const ignorePaths = config?.ignorePaths ?? process.env.OTEL_FASTIFY_IGNORE_PATHS;\n\n if ((typeof ignorePaths !== 'string' || ignorePaths.length === 0) && typeof ignorePaths !== 'function') {\n throw new TypeError('ignorePaths must be a string or a function');\n }\n\n const globMatcher = minimatch.minimatch;\n\n this[kIgnorePaths] = routeOptions => {\n if (typeof ignorePaths === 'function') {\n return ignorePaths(routeOptions);\n } else {\n return globMatcher(routeOptions.url, ignorePaths);\n }\n };\n }\n }\n\n enable() {\n if (this._handleInitialization === undefined && this.getConfig().registerOnInitialization) {\n const FastifyInstrumentationPlugin = this.plugin();\n this._handleInitialization = message => {\n message.fastify.register(FastifyInstrumentationPlugin);\n };\n dc.subscribe('fastify.initialization', this._handleInitialization);\n }\n return super.enable();\n }\n\n disable() {\n if (this._handleInitialization) {\n dc.unsubscribe('fastify.initialization', this._handleInitialization);\n this._handleInitialization = undefined;\n }\n return super.disable();\n }\n\n // We do not do patching in this instrumentation\n init() {\n return [];\n }\n\n plugin() {\n const instrumentation = this;\n\n FastifyInstrumentationPlugin[Symbol.for('skip-override')] = true;\n FastifyInstrumentationPlugin[Symbol.for('fastify.display-name')] = '@fastify/otel';\n FastifyInstrumentationPlugin[Symbol.for('plugin-meta')] = {\n fastify: SUPPORTED_VERSIONS,\n name: '@fastify/otel',\n };\n\n return FastifyInstrumentationPlugin;\n\n function FastifyInstrumentationPlugin(instance, opts, done) {\n instance.decorate(kInstrumentation, instrumentation);\n // addHook and notfoundHandler are essentially inherited from the prototype\n // what is important is to bound it to the right instance\n instance.decorate(kAddHookOriginal, instance.addHook);\n instance.decorate(kSetNotFoundOriginal, instance.setNotFoundHandler);\n instance.decorateRequest('opentelemetry', function openetelemetry() {\n const ctx = this[kRequestContext];\n const span = this[kRequestSpan];\n return {\n span,\n tracer: instrumentation.tracer,\n context: ctx,\n inject: (carrier, setter) => {\n return propagation.inject(ctx, carrier, setter);\n },\n extract: (carrier, getter) => {\n return propagation.extract(ctx, carrier, getter);\n },\n };\n });\n instance.decorateRequest(kRequestSpan, null);\n instance.decorateRequest(kRequestContext, null);\n\n instance.addHook('onRoute', function (routeOptions) {\n if (instrumentation[kIgnorePaths]?.(routeOptions) === true) {\n instrumentation._logger.debug(\n `Ignoring route instrumentation ${routeOptions.method} ${routeOptions.url} because it matches the ignore path`,\n );\n return;\n }\n\n for (const hook of FASTIFY_HOOKS) {\n if (routeOptions[hook] != null) {\n const handlerLike = routeOptions[hook];\n\n if (typeof handlerLike === 'function') {\n routeOptions[hook] = handlerWrapper(handlerLike, {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - route -> ${hook}`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.ROUTE,\n [ATTR_HTTP_ROUTE]: routeOptions.url,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n handlerLike.name?.length > 0 ? handlerLike.name : ANONYMOUS_FUNCTION_NAME /* c8 ignore next */,\n });\n } else if (Array.isArray(handlerLike)) {\n const wrappedHandlers = [];\n\n for (const handler of handlerLike) {\n wrappedHandlers.push(\n handlerWrapper(handler, {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - route -> ${hook}`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.ROUTE,\n [ATTR_HTTP_ROUTE]: routeOptions.url,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n handler.name?.length > 0 ? handler.name : ANONYMOUS_FUNCTION_NAME,\n }),\n );\n }\n\n routeOptions[hook] = wrappedHandlers;\n }\n }\n }\n\n // We always want to add the onSend hook to the route to be executed last\n if (routeOptions.onSend != null) {\n routeOptions.onSend = Array.isArray(routeOptions.onSend)\n ? [...routeOptions.onSend, onSendHook]\n : [routeOptions.onSend, onSendHook];\n } else {\n routeOptions.onSend = onSendHook;\n }\n\n // We always want to add the onError hook to the route to be executed last\n if (routeOptions.onError != null) {\n routeOptions.onError = Array.isArray(routeOptions.onError)\n ? [...routeOptions.onError, onErrorHook]\n : [routeOptions.onError, onErrorHook];\n } else {\n routeOptions.onError = onErrorHook;\n }\n\n routeOptions.handler = handlerWrapper(routeOptions.handler, {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - route-handler`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.HANDLER,\n [ATTR_HTTP_ROUTE]: routeOptions.url,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n routeOptions.handler.name.length > 0 ? routeOptions.handler.name : ANONYMOUS_FUNCTION_NAME,\n });\n });\n\n instance.addHook('onRequest', function (request, _reply, hookDone) {\n if (this[kInstrumentation].isEnabled() === false) {\n return hookDone();\n } else if (\n this[kInstrumentation][kIgnorePaths]?.({\n url: request.url,\n method: request.method,\n }) === true\n ) {\n this[kInstrumentation]._logger.debug(\n `Ignoring request ${request.method} ${request.url} because it matches the ignore path`,\n );\n return hookDone();\n }\n\n let ctx = context.active();\n\n if (trace.getSpan(ctx) == null) {\n ctx = propagation.extract(ctx, request.headers);\n }\n\n const rpcMetadata = getRPCMetadata(ctx);\n\n if (request.routeOptions.url != null && rpcMetadata?.type === RPCType.HTTP) {\n rpcMetadata.route = request.routeOptions.url;\n }\n\n /** @type {import('@opentelemetry/api').Span} */\n const span = this[kInstrumentation].tracer.startSpan(\n 'request',\n {\n attributes: {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.ROOT]: '@fastify/otel',\n [ATTR_HTTP_ROUTE]: request.url,\n [ATTR_HTTP_REQUEST_METHOD]: request.method,\n },\n },\n ctx,\n );\n\n request[kRequestContext] = trace.setSpan(ctx, span);\n request[kRequestSpan] = span;\n\n context.with(request[kRequestContext], () => {\n hookDone();\n });\n });\n\n // onResponse is the last hook to be executed, only added for 404 handlers\n instance.addHook('onResponse', function (request, reply, hookDone) {\n const span = request[kRequestSpan];\n\n if (span != null) {\n span.setStatus({\n code: SpanStatusCode.OK,\n message: 'OK',\n });\n span.setAttributes({\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: 404,\n });\n span.end();\n }\n\n request[kRequestSpan] = null;\n\n hookDone();\n });\n\n instance.addHook = addHookPatched;\n instance.setNotFoundHandler = setNotFoundHandlerPatched;\n\n done();\n\n function onSendHook(request, reply, payload, hookDone) {\n /** @type {import('@opentelemetry/api').Span} */\n const span = request[kRequestSpan];\n\n if (span != null) {\n if (reply.statusCode < 500) {\n span.setStatus({\n code: SpanStatusCode.OK,\n message: 'OK',\n });\n }\n\n span.setAttributes({\n [ATTR_HTTP_RESPONSE_STATUS_CODE]: reply.statusCode,\n });\n span.end();\n }\n\n request[kRequestSpan] = null;\n\n hookDone(null, payload);\n }\n\n function onErrorHook(request, reply, error, hookDone) {\n /** @type {Span} */\n const span = request[kRequestSpan];\n\n if (span != null) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n span.recordException(error);\n }\n\n hookDone();\n }\n\n function addHookPatched(name, hook) {\n const addHookOriginal = this[kAddHookOriginal];\n\n if (FASTIFY_HOOKS.includes(name)) {\n return addHookOriginal.call(\n this,\n name,\n handlerWrapper(hook, {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - ${name}`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n hook.name?.length > 0 ? hook.name : ANONYMOUS_FUNCTION_NAME /* c8 ignore next */,\n }),\n );\n } else {\n return addHookOriginal.call(this, name, hook);\n }\n }\n\n function setNotFoundHandlerPatched(hooks, handler) {\n const setNotFoundHandlerOriginal = this[kSetNotFoundOriginal];\n if (typeof hooks === 'function') {\n handler = handlerWrapper(hooks, {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - not-found-handler`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n hooks.name?.length > 0 ? hooks.name : ANONYMOUS_FUNCTION_NAME /* c8 ignore next */,\n });\n setNotFoundHandlerOriginal.call(this, handler);\n } else {\n if (hooks.preValidation != null) {\n hooks.preValidation = handlerWrapper(hooks.preValidation, {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - not-found-handler - preValidation`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n hooks.preValidation.name?.length > 0\n ? hooks.preValidation.name\n : ANONYMOUS_FUNCTION_NAME /* c8 ignore next */,\n });\n }\n\n if (hooks.preHandler != null) {\n hooks.preHandler = handlerWrapper(hooks.preHandler, {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - not-found-handler - preHandler`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n hooks.preHandler.name?.length > 0\n ? hooks.preHandler.name\n : ANONYMOUS_FUNCTION_NAME /* c8 ignore next */,\n });\n }\n\n handler = handlerWrapper(handler, {\n [ATTR_SERVICE_NAME]: instance[kInstrumentation].servername,\n [ATTRIBUTE_NAMES.HOOK_NAME]: `${this.pluginName} - not-found-handler`,\n [ATTRIBUTE_NAMES.FASTIFY_TYPE]: HOOK_TYPES.INSTANCE,\n [ATTRIBUTE_NAMES.HOOK_CALLBACK_NAME]:\n handler.name?.length > 0 ? handler.name : ANONYMOUS_FUNCTION_NAME /* c8 ignore next */,\n });\n setNotFoundHandlerOriginal.call(this, hooks, handler);\n }\n }\n\n function handlerWrapper(handler, spanAttributes = {}) {\n return function handlerWrapped(...args) {\n /** @type {FastifyOtelInstrumentation} */\n const instrumentation = this[kInstrumentation];\n const [request] = args;\n\n if (instrumentation.isEnabled() === false) {\n return handler.call(this, ...args);\n }\n\n const ctx = request[kRequestContext] ?? context.active();\n const span = instrumentation.tracer.startSpan(\n `handler - ${\n handler.name?.length > 0\n ? handler.name\n : this.pluginName /* c8 ignore next */ ?? ANONYMOUS_FUNCTION_NAME /* c8 ignore next */\n }`,\n {\n attributes: spanAttributes,\n },\n ctx,\n );\n\n return context.with(\n trace.setSpan(ctx, span),\n function () {\n try {\n const res = handler.call(this, ...args);\n\n if (typeof res?.then === 'function') {\n return res.then(\n result => {\n span.end();\n return result;\n },\n error => {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n span.recordException(error);\n span.end();\n return Promise.reject(error);\n },\n );\n }\n\n span.end();\n return res;\n } catch (error) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n span.recordException(error);\n span.end();\n throw error;\n }\n },\n this,\n );\n };\n }\n }\n }\n}\n"],"names":["dc"],"mappings":";;;;;;;AAAA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAiBA;AACA;AACA,MAAM,YAAA,GAAe,eAAe;AACpC,MAAM,eAAA,GAAkB,OAAO;;AAE/B;AACA,MAAM,kBAAA,GAAq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ACA,gBAAA,OAAA,GAAA;AACA,eAAA,CAAA,OAAA,KAAA,EAAA;AACA,gBAAA,IAAA,CAAA,SAAA,CAAA;AACA,kBAAA,IAAA,EAAA,cAAA,CAAA,KAAA;AACA,kBAAA,OAAA,EAAA,KAAA,CAAA,OAAA;AACA,iBAAA,CAAA;AACA,gBAAA,IAAA,CAAA,eAAA,CAAA,KAAA,CAAA;AACA,gBAAA,IAAA,CAAA,GAAA,EAAA;AACA,gBAAA,MAAA,KAAA;AACA;AACA,aAAA;AACA,YAAA,IAAA;AACA,WAAA;AACA,SAAA;AACA;AACA;AACA;AACA;;;;"}
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"9.
|
|
1
|
+
{"type":"module","version":"9.35.0","sideEffects":false}
|
package/build/types/index.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ export { amqplibIntegration } from './integrations/tracing/amqplib';
|
|
|
34
34
|
export { vercelAIIntegration } from './integrations/tracing/vercelai';
|
|
35
35
|
export { childProcessIntegration } from './integrations/childProcess';
|
|
36
36
|
export { createSentryWinstonTransport } from './integrations/winston';
|
|
37
|
+
export { launchDarklyIntegration, buildLaunchDarklyFlagUsedHandler, openFeatureIntegration, OpenFeatureIntegrationHook, statsigIntegration, unleashIntegration, } from './integrations/featureFlagShims';
|
|
37
38
|
export { SentryContextManager } from './otel/contextManager';
|
|
38
39
|
export { generateInstrumentOnce } from './otel/instrument';
|
|
39
40
|
export { init, getDefaultIntegrations, getDefaultIntegrationsWithoutPerformance, initWithoutDefaultIntegrations, validateOpenTelemetrySetup, } from './sdk';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2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K,EACL,WAAW,EACX,yBAAyB,EACzB,aAAa,EACb,cAAc,EACd,WAAW,EACX,sBAAsB,EACtB,2BAA2B,EAE3B,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,4BAA4B,EAC5B,gCAAgC,EAChC,gCAAgC,EAChC,qCAAqC,EACrC,gBAAgB,EAChB,KAAK,EACL,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,yBAAyB,EACzB,iBAAiB,EACjB,yBAAyB,EACzB,wBAAwB,EACxB,YAAY,EACZ,cAAc,EACd,UAAU,EACV,cAAc,EACd,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,aAAa,EACb,cAAc,EACd,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,QAAQ,EACR,yBAAyB,EACzB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,OAAO,EACP,aAAa,EACb,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,uBAAuB,GACxB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { launchDarklyIntegrationShim as launchDarklyIntegration, buildLaunchDarklyFlagUsedHandlerShim as buildLaunchDarklyFlagUsedHandler, } from './launchDarkly';
|
|
2
|
+
export { openFeatureIntegrationShim as openFeatureIntegration, OpenFeatureIntegrationHookShim as OpenFeatureIntegrationHook, } from './openFeature';
|
|
3
|
+
export { statsigIntegrationShim as statsigIntegration } from './statsig';
|
|
4
|
+
export { unleashIntegrationShim as unleashIntegration } from './unleash';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/featureFlagShims/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,IAAI,uBAAuB,EACtD,oCAAoC,IAAI,gCAAgC,GACzE,MAAM,gBAAgB,CAAC;AAExB,OAAO,EACL,0BAA0B,IAAI,sBAAsB,EACpD,8BAA8B,IAAI,0BAA0B,GAC7D,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,sBAAsB,IAAI,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEzE,OAAO,EAAE,sBAAsB,IAAI,kBAAkB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a shim for the LaunchDarkly integration.
|
|
3
|
+
* We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.
|
|
4
|
+
*/
|
|
5
|
+
export declare const launchDarklyIntegrationShim: (_options?: unknown) => import("@sentry/core").Integration;
|
|
6
|
+
/**
|
|
7
|
+
* This is a shim for the LaunchDarkly flag used handler.
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildLaunchDarklyFlagUsedHandlerShim(): unknown;
|
|
10
|
+
//# sourceMappingURL=launchDarkly.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launchDarkly.d.ts","sourceRoot":"","sources":["../../../../src/integrations/featureFlagShims/launchDarkly.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,2BAA2B,4DAWtC,CAAC;AAEH;;GAEG;AACH,wBAAgB,oCAAoC,IAAI,OAAO,CAc9D"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a shim for the OpenFeature integration.
|
|
3
|
+
* We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.
|
|
4
|
+
*/
|
|
5
|
+
export declare const openFeatureIntegrationShim: (_options?: unknown) => import("@sentry/core").Integration;
|
|
6
|
+
/**
|
|
7
|
+
* This is a shim for the OpenFeature integration hook.
|
|
8
|
+
*/
|
|
9
|
+
export declare class OpenFeatureIntegrationHookShim {
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
constructor();
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
after(): void;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
error(): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=openFeature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openFeature.d.ts","sourceRoot":"","sources":["../../../../src/integrations/featureFlagShims/openFeature.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,0BAA0B,4DAWrC,CAAC;AAEH;;GAEG;AACH,qBAAa,8BAA8B;IACzC;;OAEG;;IAUH;;OAEG;IACI,KAAK,IAAI,IAAI;IAIpB;;OAEG;IACI,KAAK,IAAI,IAAI;CAGrB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a shim for the Statsig integration.
|
|
3
|
+
* We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.
|
|
4
|
+
*/
|
|
5
|
+
export declare const statsigIntegrationShim: (_options?: unknown) => import("@sentry/core").Integration;
|
|
6
|
+
//# sourceMappingURL=statsig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statsig.d.ts","sourceRoot":"","sources":["../../../../src/integrations/featureFlagShims/statsig.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,sBAAsB,4DAWjC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a shim for the Unleash integration.
|
|
3
|
+
* We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.
|
|
4
|
+
*/
|
|
5
|
+
export declare const unleashIntegrationShim: (_options?: unknown) => import("@sentry/core").Integration;
|
|
6
|
+
//# sourceMappingURL=unleash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unleash.d.ts","sourceRoot":"","sources":["../../../../src/integrations/featureFlagShims/unleash.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,sBAAsB,4DAWjC,CAAC"}
|
|
@@ -34,6 +34,7 @@ export { amqplibIntegration } from './integrations/tracing/amqplib';
|
|
|
34
34
|
export { vercelAIIntegration } from './integrations/tracing/vercelai';
|
|
35
35
|
export { childProcessIntegration } from './integrations/childProcess';
|
|
36
36
|
export { createSentryWinstonTransport } from './integrations/winston';
|
|
37
|
+
export { launchDarklyIntegration, buildLaunchDarklyFlagUsedHandler, openFeatureIntegration, OpenFeatureIntegrationHook, statsigIntegration, unleashIntegration, } from './integrations/featureFlagShims';
|
|
37
38
|
export { SentryContextManager } from './otel/contextManager';
|
|
38
39
|
export { generateInstrumentOnce } from './otel/instrument';
|
|
39
40
|
export { init, getDefaultIntegrations, getDefaultIntegrationsWithoutPerformance, initWithoutDefaultIntegrations, validateOpenTelemetrySetup, } from './sdk';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { launchDarklyIntegrationShim as launchDarklyIntegration, buildLaunchDarklyFlagUsedHandlerShim as buildLaunchDarklyFlagUsedHandler, } from './launchDarkly';
|
|
2
|
+
export { openFeatureIntegrationShim as openFeatureIntegration, OpenFeatureIntegrationHookShim as OpenFeatureIntegrationHook, } from './openFeature';
|
|
3
|
+
export { statsigIntegrationShim as statsigIntegration } from './statsig';
|
|
4
|
+
export { unleashIntegrationShim as unleashIntegration } from './unleash';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a shim for the LaunchDarkly integration.
|
|
3
|
+
* We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.
|
|
4
|
+
*/
|
|
5
|
+
export declare const launchDarklyIntegrationShim: (_options?: unknown) => import("@sentry/core").Integration;
|
|
6
|
+
/**
|
|
7
|
+
* This is a shim for the LaunchDarkly flag used handler.
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildLaunchDarklyFlagUsedHandlerShim(): unknown;
|
|
10
|
+
//# sourceMappingURL=launchDarkly.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a shim for the OpenFeature integration.
|
|
3
|
+
* We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.
|
|
4
|
+
*/
|
|
5
|
+
export declare const openFeatureIntegrationShim: (_options?: unknown) => import("@sentry/core").Integration;
|
|
6
|
+
/**
|
|
7
|
+
* This is a shim for the OpenFeature integration hook.
|
|
8
|
+
*/
|
|
9
|
+
export declare class OpenFeatureIntegrationHookShim {
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
constructor();
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
after(): void;
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
error(): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=openFeature.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a shim for the Statsig integration.
|
|
3
|
+
* We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.
|
|
4
|
+
*/
|
|
5
|
+
export declare const statsigIntegrationShim: (_options?: unknown) => import("@sentry/core").Integration;
|
|
6
|
+
//# sourceMappingURL=statsig.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is a shim for the Unleash integration.
|
|
3
|
+
* We need this in order to not throw runtime errors when accidentally importing this on the server through a meta framework like Next.js.
|
|
4
|
+
*/
|
|
5
|
+
export declare const unleashIntegrationShim: (_options?: unknown) => import("@sentry/core").Integration;
|
|
6
|
+
//# sourceMappingURL=unleash.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/node",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.35.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",
|
|
@@ -95,8 +95,8 @@
|
|
|
95
95
|
"@opentelemetry/sdk-trace-base": "^1.30.1",
|
|
96
96
|
"@opentelemetry/semantic-conventions": "^1.34.0",
|
|
97
97
|
"@prisma/instrumentation": "6.10.1",
|
|
98
|
-
"@sentry/core": "9.
|
|
99
|
-
"@sentry/opentelemetry": "9.
|
|
98
|
+
"@sentry/core": "9.35.0",
|
|
99
|
+
"@sentry/opentelemetry": "9.35.0",
|
|
100
100
|
"import-in-the-middle": "^1.14.2",
|
|
101
101
|
"minimatch": "^9.0.0"
|
|
102
102
|
},
|