@sentry/google-cloud-serverless 10.23.0 → 10.25.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.
@@ -1 +1 @@
1
- {"version":3,"file":"cloud_events.js","sources":["../../../src/gcpfunction/cloud_events.ts"],"sourcesContent":["import {\n debug,\n handleCallbackErrors,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n} from '@sentry/core';\nimport { captureException, flush, getCurrentScope, startSpanManual } from '@sentry/node';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { domainify, markEventUnhandled, proxyFunction } from '../utils';\nimport type { CloudEventFunction, CloudEventFunctionWithCallback, WrapperOptions } from './general';\n\nexport type CloudEventFunctionWrapperOptions = WrapperOptions;\n\n/**\n * Wraps an event function handler adding it error capture and tracing capabilities.\n *\n * @param fn Event handler\n * @param options Options\n * @returns Event handler\n */\nexport function wrapCloudEventFunction(\n fn: CloudEventFunction | CloudEventFunctionWithCallback,\n wrapOptions: Partial<CloudEventFunctionWrapperOptions> = {},\n): CloudEventFunctionWithCallback {\n return proxyFunction(fn, f => domainify(_wrapCloudEventFunction(f, wrapOptions)));\n}\n\nfunction _wrapCloudEventFunction(\n fn: CloudEventFunction | CloudEventFunctionWithCallback,\n wrapOptions: Partial<CloudEventFunctionWrapperOptions> = {},\n): CloudEventFunctionWithCallback {\n const options: CloudEventFunctionWrapperOptions = {\n flushTimeout: 2000,\n ...wrapOptions,\n };\n return (context, callback) => {\n return startSpanManual(\n {\n name: context.type || '<unknown>',\n op: 'function.gcp.cloud_event',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_cloud_event',\n },\n },\n span => {\n const scope = getCurrentScope();\n scope.setContext('gcp.function.context', { ...context });\n\n const newCallback = domainify((...args: unknown[]) => {\n if (args[0] !== null && args[0] !== undefined) {\n captureException(args[0], scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_cloud_event'));\n }\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(options.flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n if (typeof callback === 'function') {\n callback(...args);\n }\n });\n });\n\n if (fn.length > 1) {\n return handleCallbackErrors(\n () => (fn as CloudEventFunctionWithCallback)(context, newCallback),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_cloud_event'));\n },\n );\n }\n\n return Promise.resolve()\n .then(() => (fn as CloudEventFunction)(context))\n .then(\n result => newCallback(null, result),\n err => newCallback(err, undefined),\n );\n },\n );\n };\n}\n"],"names":["proxyFunction","domainify","startSpanManual","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","getCurrentScope","captureException","markEventUnhandled","flush","DEBUG_BUILD","debug","handleCallbackErrors"],"mappings":";;;;;;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,sBAAsB;AACtC,EAAE,EAAE;AACJ,EAAE,WAAW,GAA8C,EAAE;AAC7D,EAAkC;AAClC,EAAE,OAAOA,mBAAa,CAAC,EAAE,EAAE,KAAKC,eAAS,CAAC,uBAAuB,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;AACnF;;AAEA,SAAS,uBAAuB;AAChC,EAAE,EAAE;AACJ,EAAE,WAAW,GAA8C,EAAE;AAC7D,EAAkC;AAClC,EAAE,MAAM,OAAO,GAAqC;AACpD,IAAI,YAAY,EAAE,IAAI;AACtB,IAAI,GAAG,WAAW;AAClB,GAAG;AACH,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,KAAK;AAChC,IAAI,OAAOC,oBAAe;AAC1B,MAAM;AACN,QAAQ,IAAI,EAAE,OAAO,CAAC,IAAA,IAAQ,WAAW;AACzC,QAAQ,EAAE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AACX;;AAEA,QAAQ,OAAO,OAAO,CAAC,OAAO;AAC9B,WAAW,IAAI,CAAC,MAAM,CAAC,EAAA,GAA0B,OAAO,CAAC;AACzD,WAAW,IAAI;AACf,YAAY,UAAU,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC;AAC/C,YAAY,OAAO,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC;AAC9C,WAAW;AACX,OAAO;AACP,KAAK;AACL,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"cloud_events.js","sources":["../../../src/gcpfunction/cloud_events.ts"],"sourcesContent":["import {\n debug,\n handleCallbackErrors,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n} from '@sentry/core';\nimport { captureException, flush, getCurrentScope, startSpanManual } from '@sentry/node';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { domainify, markEventUnhandled, proxyFunction } from '../utils';\nimport type { CloudEventFunction, CloudEventFunctionWithCallback, WrapperOptions } from './general';\n\nexport type CloudEventFunctionWrapperOptions = WrapperOptions;\n\n/**\n * Wraps an event function handler adding it error capture and tracing capabilities.\n *\n * @param fn Event handler\n * @param options Options\n * @returns Event handler\n */\nexport function wrapCloudEventFunction(\n fn: CloudEventFunction | CloudEventFunctionWithCallback,\n wrapOptions: Partial<CloudEventFunctionWrapperOptions> = {},\n): CloudEventFunctionWithCallback {\n return proxyFunction(fn, f => domainify(_wrapCloudEventFunction(f, wrapOptions)));\n}\n\nfunction _wrapCloudEventFunction(\n fn: CloudEventFunction | CloudEventFunctionWithCallback,\n wrapOptions: Partial<CloudEventFunctionWrapperOptions> = {},\n): CloudEventFunctionWithCallback {\n const options: CloudEventFunctionWrapperOptions = {\n flushTimeout: 2000,\n ...wrapOptions,\n };\n return (context, callback) => {\n return startSpanManual(\n {\n name: context.type || '<unknown>',\n op: 'function.gcp.cloud_event',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_cloud_event',\n },\n },\n span => {\n const scope = getCurrentScope();\n scope.setContext('gcp.function.context', { ...context });\n\n const newCallback = domainify((...args: unknown[]) => {\n if (args[0] !== null && args[0] !== undefined) {\n captureException(args[0], scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_cloud_event'));\n }\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(options.flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n if (typeof callback === 'function') {\n callback(...args);\n }\n });\n });\n\n if (fn.length > 1) {\n return handleCallbackErrors(\n () => (fn as CloudEventFunctionWithCallback)(context, newCallback),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_cloud_event'));\n },\n );\n }\n\n return Promise.resolve()\n .then(() => (fn as CloudEventFunction)(context))\n .then(\n result => newCallback(null, result),\n err => newCallback(err, undefined),\n );\n },\n );\n };\n}\n"],"names":["proxyFunction","domainify","startSpanManual","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","getCurrentScope","captureException","markEventUnhandled","flush","DEBUG_BUILD","debug","handleCallbackErrors"],"mappings":";;;;;;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,sBAAsB;AACtC,EAAE,EAAE;AACJ,EAAE,WAAW,GAA8C,EAAE;AAC7D,EAAkC;AAClC,EAAE,OAAOA,mBAAa,CAAC,EAAE,EAAE,KAAKC,eAAS,CAAC,uBAAuB,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;AACnF;;AAEA,SAAS,uBAAuB;AAChC,EAAE,EAAE;AACJ,EAAE,WAAW,GAA8C,EAAE;AAC7D,EAAkC;AAClC,EAAE,MAAM,OAAO,GAAqC;AACpD,IAAI,YAAY,EAAE,IAAI;AACtB,IAAI,GAAG,WAAW;AAClB,GAAG;AAC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MAAM,CAAC,EAAA,GAAsC,OAAO,EAAE,WAAW,CAAC;AAC9E,YAAY,OAAO;AACnB,cAAcL,qBAAgB,CAAC,GAAG,EAAE,KAAA,IAASC,wBAAkB,CAAC,KAAK,EAAE,0CAA0C,CAAC,CAAC;AACnH,YAAY,CAAC;AACb,WAAW;AACX,QAAQ;;AAER,QAAQ,OAAO,OAAO,CAAC,OAAO;AAC9B,WAAW,IAAI,CAAC,MAAM,CAAC,EAAA,GAA0B,OAAO,CAAC;AACzD,WAAW,IAAI;AACf,YAAY,UAAU,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC;AAC/C,YAAY,OAAO,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC;AAC9C,WAAW;AACX,MAAM,CAAC;AACP,KAAK;AACL,EAAE,CAAC;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sources":["../../../src/gcpfunction/events.ts"],"sourcesContent":["import {\n debug,\n handleCallbackErrors,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n} from '@sentry/core';\nimport { captureException, flush, getCurrentScope, startSpanManual } from '@sentry/node';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { domainify, markEventUnhandled, proxyFunction } from '../utils';\nimport type { EventFunction, EventFunctionWithCallback, WrapperOptions } from './general';\n\nexport type EventFunctionWrapperOptions = WrapperOptions;\n\n/**\n * Wraps an event function handler adding it error capture and tracing capabilities.\n *\n * @param fn Event handler\n * @param options Options\n * @returns Event handler\n */\nexport function wrapEventFunction(\n fn: EventFunction | EventFunctionWithCallback,\n wrapOptions: Partial<EventFunctionWrapperOptions> = {},\n): EventFunctionWithCallback {\n return proxyFunction(fn, f => domainify(_wrapEventFunction(f, wrapOptions)));\n}\n\n/** */\nfunction _wrapEventFunction<F extends EventFunction | EventFunctionWithCallback>(\n fn: F,\n wrapOptions: Partial<EventFunctionWrapperOptions> = {},\n): (...args: Parameters<F>) => ReturnType<F> | Promise<void> {\n const options: EventFunctionWrapperOptions = {\n flushTimeout: 2000,\n ...wrapOptions,\n };\n return (...eventFunctionArguments: Parameters<F>): ReturnType<F> | Promise<void> => {\n const [data, context, callback] = eventFunctionArguments;\n\n return startSpanManual(\n {\n name: context.eventType,\n op: 'function.gcp.event',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_event',\n },\n },\n span => {\n const scope = getCurrentScope();\n scope.setContext('gcp.function.context', { ...context });\n\n const newCallback = domainify((...args: unknown[]) => {\n if (args[0] !== null && args[0] !== undefined) {\n captureException(args[0], scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_event'));\n }\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(options.flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n if (typeof callback === 'function') {\n callback(...args);\n }\n });\n });\n\n if (fn.length > 2) {\n return handleCallbackErrors(\n () => (fn as EventFunctionWithCallback)(data, context, newCallback),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_event'));\n },\n );\n }\n\n return Promise.resolve()\n .then(() => (fn as EventFunction)(data, context))\n .then(\n result => newCallback(null, result),\n err => newCallback(err, undefined),\n );\n },\n );\n };\n}\n"],"names":["proxyFunction","domainify","startSpanManual","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","getCurrentScope","captureException","markEventUnhandled","flush","DEBUG_BUILD","debug","handleCallbackErrors"],"mappings":";;;;;;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB;AACjC,EAAE,EAAE;AACJ,EAAE,WAAW,GAAyC,EAAE;AACxD,EAA6B;AAC7B,EAAE,OAAOA,mBAAa,CAAC,EAAE,EAAE,KAAKC,eAAS,CAAC,kBAAkB,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;AAC3C,aAAa;AACb,aAAa,IAAI,CAAC,MAAM;AACxB,cAAc,IAAI,OAAO,QAAA,KAAa,UAAU,EAAE;AAClD,gBAAgB,QAAQ,CAAC,GAAG,IAAI,CAAC;AACjC;AACA,aAAa,CAAC;AACd,SAAS,CAAC;;AAEV,QAAQ,IAAI,EAAE,CAAC,MAAA,GAAS,CAAC,EAAE;AAC3B,UAAU,OAAOC,yBAAoB;AACrC,YAAY,MAAM,CAAC,EAAA,GAAiC,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC;AAC/E,YAAY,OAAO;AACnB,cAAcL,qBAAgB,CAAC,GAAG,EAAE,KAAA,IAASC,wBAAkB,CAAC,KAAK,EAAE,oCAAoC,CAAC,CAAC;AAC7G,aAAa;AACb,WAAW;AACX;;AAEA,QAAQ,OAAO,OAAO,CAAC,OAAO;AAC9B,WAAW,IAAI,CAAC,MAAM,CAAC,EAAA,GAAqB,IAAI,EAAE,OAAO,CAAC;AAC1D,WAAW,IAAI;AACf,YAAY,UAAU,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC;AAC/C,YAAY,OAAO,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC;AAC9C,WAAW;AACX,OAAO;AACP,KAAK;AACL,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"events.js","sources":["../../../src/gcpfunction/events.ts"],"sourcesContent":["import {\n debug,\n handleCallbackErrors,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n} from '@sentry/core';\nimport { captureException, flush, getCurrentScope, startSpanManual } from '@sentry/node';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { domainify, markEventUnhandled, proxyFunction } from '../utils';\nimport type { EventFunction, EventFunctionWithCallback, WrapperOptions } from './general';\n\nexport type EventFunctionWrapperOptions = WrapperOptions;\n\n/**\n * Wraps an event function handler adding it error capture and tracing capabilities.\n *\n * @param fn Event handler\n * @param options Options\n * @returns Event handler\n */\nexport function wrapEventFunction(\n fn: EventFunction | EventFunctionWithCallback,\n wrapOptions: Partial<EventFunctionWrapperOptions> = {},\n): EventFunctionWithCallback {\n return proxyFunction(fn, f => domainify(_wrapEventFunction(f, wrapOptions)));\n}\n\n/** */\nfunction _wrapEventFunction<F extends EventFunction | EventFunctionWithCallback>(\n fn: F,\n wrapOptions: Partial<EventFunctionWrapperOptions> = {},\n): (...args: Parameters<F>) => ReturnType<F> | Promise<void> {\n const options: EventFunctionWrapperOptions = {\n flushTimeout: 2000,\n ...wrapOptions,\n };\n return (...eventFunctionArguments: Parameters<F>): ReturnType<F> | Promise<void> => {\n const [data, context, callback] = eventFunctionArguments;\n\n return startSpanManual(\n {\n name: context.eventType,\n op: 'function.gcp.event',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_event',\n },\n },\n span => {\n const scope = getCurrentScope();\n scope.setContext('gcp.function.context', { ...context });\n\n const newCallback = domainify((...args: unknown[]) => {\n if (args[0] !== null && args[0] !== undefined) {\n captureException(args[0], scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_event'));\n }\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(options.flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n if (typeof callback === 'function') {\n callback(...args);\n }\n });\n });\n\n if (fn.length > 2) {\n return handleCallbackErrors(\n () => (fn as EventFunctionWithCallback)(data, context, newCallback),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_event'));\n },\n );\n }\n\n return Promise.resolve()\n .then(() => (fn as EventFunction)(data, context))\n .then(\n result => newCallback(null, result),\n err => newCallback(err, undefined),\n );\n },\n );\n };\n}\n"],"names":["proxyFunction","domainify","startSpanManual","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","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CAAC,EAAE,KAAA,IAASC,wBAAkB,CAAC,KAAK,EAAE,oCAAoC,CAAC,CAAC;AAC/G,UAAU;AACV,UAAU,IAAI,CAAC,GAAG,EAAE;;AAEpB;AACA,UAAUC,UAAK,CAAC,OAAO,CAAC,YAAY;AACpC,aAAa,IAAI,CAAC,IAAI,EAAE,KAAK;AAC7B,cAAcC,0BAAeC,UAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3C,YAAY,CAAC;AACb,aAAa,IAAI,CAAC,MAAM;AACxB,cAAc,IAAI,OAAO,QAAA,KAAa,UAAU,EAAE;AAClD,gBAAgB,QAAQ,CAAC,GAAG,IAAI,CAAC;AACjC,cAAc;AACd,YAAY,CAAC,CAAC;AACd,QAAQ,CAAC,CAAC;;AAEV,QAAQ,IAAI,EAAE,CAAC,MAAA,GAAS,CAAC,EAAE;AAC3B,UAAU,OAAOC,yBAAoB;AACrC,YAAY,MAAM,CAAC,EAAA,GAAiC,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC;AAC/E,YAAY,OAAO;AACnB,cAAcL,qBAAgB,CAAC,GAAG,EAAE,KAAA,IAASC,wBAAkB,CAAC,KAAK,EAAE,oCAAoC,CAAC,CAAC;AAC7G,YAAY,CAAC;AACb,WAAW;AACX,QAAQ;;AAER,QAAQ,OAAO,OAAO,CAAC,OAAO;AAC9B,WAAW,IAAI,CAAC,MAAM,CAAC,EAAA,GAAqB,IAAI,EAAE,OAAO,CAAC;AAC1D,WAAW,IAAI;AACf,YAAY,UAAU,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC;AAC/C,YAAY,OAAO,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC;AAC9C,WAAW;AACX,MAAM,CAAC;AACP,KAAK;AACL,EAAE,CAAC;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sources":["../../../src/gcpfunction/http.ts"],"sourcesContent":["import {\n debug,\n handleCallbackErrors,\n httpRequestToRequestData,\n isString,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n setHttpStatus,\n stripUrlQueryAndFragment,\n} from '@sentry/core';\nimport { captureException, continueTrace, flush, getCurrentScope, startSpanManual } from '@sentry/node';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { domainify, markEventUnhandled, proxyFunction } from '../utils';\nimport type { HttpFunction, WrapperOptions } from './general';\n\n/**\n * Wraps an HTTP function handler adding it error capture and tracing capabilities.\n *\n * @param fn HTTP Handler\n * @param options Options\n * @returns HTTP handler\n */\nexport function wrapHttpFunction(fn: HttpFunction, wrapOptions: Partial<WrapperOptions> = {}): HttpFunction {\n const wrap = (f: HttpFunction): HttpFunction => domainify(_wrapHttpFunction(f, wrapOptions));\n\n let overrides: Record<PropertyKey, unknown> | undefined;\n\n // Functions emulator from firebase-tools has a hack-ish workaround that saves the actual function\n // passed to `onRequest(...)` and in fact runs it so we need to wrap it too.\n const emulatorFunc = (fn as HttpFunction & { __emulator_func?: HttpFunction }).__emulator_func;\n if (emulatorFunc) {\n overrides = { __emulator_func: proxyFunction(emulatorFunc, wrap) };\n }\n return proxyFunction(fn, wrap, overrides);\n}\n\n/** */\nfunction _wrapHttpFunction(fn: HttpFunction, options: Partial<WrapperOptions>): HttpFunction {\n const flushTimeout = options.flushTimeout || 2000;\n return (req, res) => {\n const reqMethod = (req.method || '').toUpperCase();\n const reqUrl = stripUrlQueryAndFragment(req.originalUrl || req.url || '');\n\n const sentryTrace = req.headers && isString(req.headers['sentry-trace']) ? req.headers['sentry-trace'] : undefined;\n const baggage = req.headers?.baggage;\n\n return continueTrace({ sentryTrace, baggage }, () => {\n const normalizedRequest = httpRequestToRequestData(req);\n getCurrentScope().setSDKProcessingMetadata({ normalizedRequest });\n\n return startSpanManual(\n {\n name: `${reqMethod} ${reqUrl}`,\n op: 'function.gcp.http',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_http',\n },\n },\n span => {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const _end = res.end;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n res.end = function (chunk?: any | (() => void), encoding?: string | (() => void), cb?: () => void): any {\n setHttpStatus(span, res.statusCode);\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n _end.call(this, chunk, encoding, cb);\n });\n };\n\n return handleCallbackErrors(\n () => fn(req, res),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_http'));\n },\n );\n },\n );\n });\n };\n}\n"],"names":["domainify","proxyFunction","stripUrlQueryAndFragment","isString","continueTrace","httpRequestToRequestData","getCurrentScope","startSpanManual","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","setHttpStatus","flush","DEBUG_BUILD","debug","handleCallbackErrors","captureException","markEventUnhandled"],"mappings":";;;;;;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,EAAE,EAAgB,WAAW,GAA4B,EAAE,EAAgB;AAC5G,EAAE,MAAM,IAAA,GAAO,CAAC,CAAC,KAAiCA,eAAS,CAAC,iBAAiB,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;;AAE9F,EAAE,IAAI,SAAS;;AAEf;AACA;AACA,EAAE,MAAM,YAAA,GAAe,CAAC,EAAA,GAAyD,eAAe;AAChG,EAAE,IAAI,YAAY,EAAE;AACpB,IAAI,SAAA,GAAY,EAAE,eAAe,EAAEC,mBAAa,CAAC,YAAY,EAAE,IAAI,CAAA,EAAG;AACtE;AACA,EAAE,OAAOA,mBAAa,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC;AAC3C;;AAEA;AACA,SAAS,iBAAiB,CAAC,EAAE,EAAgB,OAAO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,YAAA,IAAA,CAAA,GAAA,EAAA;;AAEA;AACA,YAAAC,UAAA,CAAA,YAAA;AACA,eAAA,IAAA,CAAA,IAAA,EAAA,CAAA,IAAA;AACA,gBAAAC,sBAAA,IAAAC,UAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AACA,eAAA;AACA,eAAA,IAAA,CAAA,MAAA;AACA,gBAAA,IAAA,CAAA,IAAA,CAAA,IAAA,EAAA,KAAA,EAAA,QAAA,EAAA,EAAA,CAAA;AACA,eAAA,CAAA;AACA,WAAA;;AAEA,UAAA,OAAAC,yBAAA;AACA,YAAA,MAAA,EAAA,CAAA,GAAA,EAAA,GAAA,CAAA;AACA,YAAA,GAAA,IAAA;AACA,cAAAC,qBAAA,CAAA,GAAA,EAAA,KAAA,IAAAC,wBAAA,CAAA,KAAA,EAAA,mCAAA,CAAA,CAAA;AACA,aAAA;AACA,WAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA,GAAA;AACA;;;;"}
1
+ {"version":3,"file":"http.js","sources":["../../../src/gcpfunction/http.ts"],"sourcesContent":["import {\n debug,\n handleCallbackErrors,\n httpRequestToRequestData,\n isString,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n setHttpStatus,\n stripUrlQueryAndFragment,\n} from '@sentry/core';\nimport { captureException, continueTrace, flush, getCurrentScope, startSpanManual } from '@sentry/node';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { domainify, markEventUnhandled, proxyFunction } from '../utils';\nimport type { HttpFunction, WrapperOptions } from './general';\n\n/**\n * Wraps an HTTP function handler adding it error capture and tracing capabilities.\n *\n * @param fn HTTP Handler\n * @param options Options\n * @returns HTTP handler\n */\nexport function wrapHttpFunction(fn: HttpFunction, wrapOptions: Partial<WrapperOptions> = {}): HttpFunction {\n const wrap = (f: HttpFunction): HttpFunction => domainify(_wrapHttpFunction(f, wrapOptions));\n\n let overrides: Record<PropertyKey, unknown> | undefined;\n\n // Functions emulator from firebase-tools has a hack-ish workaround that saves the actual function\n // passed to `onRequest(...)` and in fact runs it so we need to wrap it too.\n const emulatorFunc = (fn as HttpFunction & { __emulator_func?: HttpFunction }).__emulator_func;\n if (emulatorFunc) {\n overrides = { __emulator_func: proxyFunction(emulatorFunc, wrap) };\n }\n return proxyFunction(fn, wrap, overrides);\n}\n\n/** */\nfunction _wrapHttpFunction(fn: HttpFunction, options: Partial<WrapperOptions>): HttpFunction {\n const flushTimeout = options.flushTimeout || 2000;\n return (req, res) => {\n const reqMethod = (req.method || '').toUpperCase();\n const reqUrl = stripUrlQueryAndFragment(req.originalUrl || req.url || '');\n\n const sentryTrace = req.headers && isString(req.headers['sentry-trace']) ? req.headers['sentry-trace'] : undefined;\n const baggage = req.headers?.baggage;\n\n return continueTrace({ sentryTrace, baggage }, () => {\n const normalizedRequest = httpRequestToRequestData(req);\n getCurrentScope().setSDKProcessingMetadata({ normalizedRequest });\n\n return startSpanManual(\n {\n name: `${reqMethod} ${reqUrl}`,\n op: 'function.gcp.http',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_http',\n },\n },\n span => {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const _end = res.end;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n res.end = function (chunk?: any | (() => void), encoding?: string | (() => void), cb?: () => void): any {\n setHttpStatus(span, res.statusCode);\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n _end.call(this, chunk, encoding, cb);\n });\n };\n\n return handleCallbackErrors(\n () => fn(req, res),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_http'));\n },\n );\n },\n );\n });\n };\n}\n"],"names":["domainify","proxyFunction","stripUrlQueryAndFragment","isString","continueTrace","httpRequestToRequestData","getCurrentScope","startSpanManual","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","setHttpStatus","flush","DEBUG_BUILD","debug","handleCallbackErrors","captureException","markEventUnhandled"],"mappings":";;;;;;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,EAAE,EAAgB,WAAW,GAA4B,EAAE,EAAgB;AAC5G,EAAE,MAAM,IAAA,GAAO,CAAC,CAAC,KAAiCA,eAAS,CAAC,iBAAiB,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;;AAE9F,EAAE,IAAI,SAAS;;AAEf;AACA;AACA,EAAE,MAAM,YAAA,GAAe,CAAC,EAAA,GAAyD,eAAe;AAChG,EAAE,IAAI,YAAY,EAAE;AACpB,IAAI,SAAA,GAAY,EAAE,eAAe,EAAEC,mBAAa,CAAC,YAAY,EAAE,IAAI,CAAA,EAAG;AACtE,EAAE;AACF,EAAE,OAAOA,mBAAa,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC;AAC3C;;AAEA;AACA,SAAS,iBAAiB,CAAC,EAAE,EAAgB,OAAO,EAAyC;AAC7F,EAAE,MAAM,YAAA,GAAe,OAAO,CAAC,YAAA,IAAgB,IAAI;AACnD,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,KAAK;AACvB,IAAI,MAAM,SAAA,GAAY,CAAC,GAAG,CAAC,MAAA,IAAU,EAAE,EAAE,WAAW,EAAE;AACtD,IAAI,MAAM,MAAA,GAASC,6BAAwB,CAAC,GAAG,CAAC,WAAA,IAAe,GAAG,CAAC,GAAA,IAAO,EAAE,CAAC;;AAE7E,IAAI,MAAM,WAAA,GAAc,GAAG,CAAC,WAAWC,aAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA,GAAI,GAAG,CAAC,OAAO,CAAC,cAAc,CAAA,GAAI,SAAS;AACtH,IAAI,MAAM,OAAA,G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,IAAAC,wBAAA,CAAA,KAAA,EAAA,mCAAA,CAAA,CAAA;AACA,YAAA,CAAA;AACA,WAAA;AACA,QAAA,CAAA;AACA,OAAA;AACA,IAAA,CAAA,CAAA;AACA,EAAA,CAAA;AACA;;;;"}
@@ -98,6 +98,7 @@ exports.localVariablesIntegration = node.localVariablesIntegration;
98
98
  exports.logger = node.logger;
99
99
  exports.lruMemoizerIntegration = node.lruMemoizerIntegration;
100
100
  exports.makeNodeTransport = node.makeNodeTransport;
101
+ exports.metrics = node.metrics;
101
102
  exports.modulesIntegration = node.modulesIntegration;
102
103
  exports.mongoIntegration = node.mongoIntegration;
103
104
  exports.mongooseIntegration = node.mongooseIntegration;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"google-cloud-grpc.js","sources":["../../../src/integrations/google-cloud-grpc.ts"],"sourcesContent":["import type { Client, IntegrationFn } from '@sentry/core';\nimport { defineIntegration, fill, getClient, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\nimport { startInactiveSpan } from '@sentry/node';\nimport type { EventEmitter } from 'events';\n\nexport interface GrpcFunction extends CallableFunction {\n (...args: unknown[]): EventEmitter;\n}\n\nexport interface GrpcFunctionObject extends GrpcFunction {\n requestStream: boolean;\n responseStream: boolean;\n originalName: string;\n}\n\ninterface StubOptions {\n servicePath?: string;\n}\n\ninterface CreateStubFunc extends CallableFunction {\n (createStub: unknown, options: StubOptions): PromiseLike<Stub>;\n}\n\nexport interface Stub {\n [key: string]: GrpcFunctionObject;\n}\n\nconst SERVICE_PATH_REGEX = /^(\\w+)\\.googleapis.com$/;\n\nconst INTEGRATION_NAME = 'GoogleCloudGrpc';\n\nconst SETUP_CLIENTS = new WeakMap<Client, boolean>();\n\nconst _googleCloudGrpcIntegration = ((options: { optional?: boolean } = {}) => {\n const optional = options.optional || false;\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const gaxModule = require('google-gax');\n fill(\n gaxModule.GrpcClient.prototype, // eslint-disable-line @typescript-eslint/no-unsafe-member-access\n 'createStub',\n wrapCreateStub,\n );\n } catch (e) {\n if (!optional) {\n throw e;\n }\n }\n },\n setup(client) {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Google Cloud Platform service requests tracking for GRPC APIs.\n */\nexport const googleCloudGrpcIntegration = defineIntegration(_googleCloudGrpcIntegration);\n\n/** Returns a wrapped function that returns a stub with tracing enabled */\nfunction wrapCreateStub(origCreate: CreateStubFunc): CreateStubFunc {\n return async function (this: unknown, ...args: Parameters<CreateStubFunc>) {\n const servicePath = args[1]?.servicePath;\n if (servicePath == null || servicePath == undefined) {\n return origCreate.apply(this, args);\n }\n const serviceIdentifier = identifyService(servicePath);\n const stub = await origCreate.apply(this, args);\n for (const methodName of Object.keys(Object.getPrototypeOf(stub))) {\n fillGrpcFunction(stub, serviceIdentifier, methodName);\n }\n return stub;\n };\n}\n\n/** Patches the function in grpc stub to enable tracing */\nexport function fillGrpcFunction(stub: Stub, serviceIdentifier: string, methodName: string): void {\n const funcObj = stub[methodName];\n if (typeof funcObj !== 'function') {\n return;\n }\n const callType =\n !funcObj.requestStream && !funcObj.responseStream\n ? 'unary call'\n : funcObj.requestStream && !funcObj.responseStream\n ? 'client stream'\n : !funcObj.requestStream && funcObj.responseStream\n ? 'server stream'\n : 'bidi stream';\n if (callType != 'unary call') {\n return;\n }\n fill(\n stub,\n methodName,\n (orig: GrpcFunction): GrpcFunction =>\n (...args) => {\n const ret = orig.apply(stub, args);\n if (typeof ret?.on !== 'function' || !SETUP_CLIENTS.has(getClient() as Client)) {\n return ret;\n }\n const span = startInactiveSpan({\n name: `${callType} ${methodName}`,\n onlyIfParent: true,\n op: `grpc.${serviceIdentifier}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.grpc.serverless',\n },\n });\n ret.on('status', () => {\n if (span) {\n span.end();\n }\n });\n return ret;\n },\n );\n}\n\n/** Identifies service by its address */\nfunction identifyService(servicePath: string): string {\n const match = servicePath.match(SERVICE_PATH_REGEX);\n return match?.[1] || servicePath;\n}\n"],"names":["fill","defineIntegration","getClient","startInactiveSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN"],"mappings":";;;;;AA2BA,MAAM,kBAAA,GAAqB,yBAAyB;;AAEpD,MAAM,gBAAA,GAAmB,iBAAiB;;AAE1C,MAAM,aAAA,GAAgB,IAAI,OAAO,EAAmB;;AAEpD,MAAM,2BAAA,IAA+B,CAAC,OAAO,GAA2B,EAAE,KAAK;AAC/E,EAAE,MAAM,QAAA,GAAW,OAAO,CAAC,QAAA,IAAY,KAAK;AAC5C,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,IAAI;AACV;AACA,QAAQ,MAAM,SAAA,GAAY,OAAO,CAAC,YAAY,CAAC;AAC/C,QAAQA,SAAI;AACZ,UAAU,SAAS,CAAC,UAAU,CAAC,SAAS;AACxC,UAAU,YAAY;AACtB,UAAU,cAAc;AACxB,SAAS;AACT,OAAM,C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grpc.js","sources":["../../../src/integrations/google-cloud-grpc.ts"],"sourcesContent":["import type { Client, IntegrationFn } from '@sentry/core';\nimport { defineIntegration, fill, getClient, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\nimport { startInactiveSpan } from '@sentry/node';\nimport type { EventEmitter } from 'events';\n\nexport interface GrpcFunction extends CallableFunction {\n (...args: unknown[]): EventEmitter;\n}\n\nexport interface GrpcFunctionObject extends GrpcFunction {\n requestStream: boolean;\n responseStream: boolean;\n originalName: string;\n}\n\ninterface StubOptions {\n servicePath?: string;\n}\n\ninterface CreateStubFunc extends CallableFunction {\n (createStub: unknown, options: StubOptions): PromiseLike<Stub>;\n}\n\nexport interface Stub {\n [key: string]: GrpcFunctionObject;\n}\n\nconst SERVICE_PATH_REGEX = /^(\\w+)\\.googleapis.com$/;\n\nconst INTEGRATION_NAME = 'GoogleCloudGrpc';\n\nconst SETUP_CLIENTS = new WeakMap<Client, boolean>();\n\nconst _googleCloudGrpcIntegration = ((options: { optional?: boolean } = {}) => {\n const optional = options.optional || false;\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const gaxModule = require('google-gax');\n fill(\n gaxModule.GrpcClient.prototype, // eslint-disable-line @typescript-eslint/no-unsafe-member-access\n 'createStub',\n wrapCreateStub,\n );\n } catch (e) {\n if (!optional) {\n throw e;\n }\n }\n },\n setup(client) {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Google Cloud Platform service requests tracking for GRPC APIs.\n */\nexport const googleCloudGrpcIntegration = defineIntegration(_googleCloudGrpcIntegration);\n\n/** Returns a wrapped function that returns a stub with tracing enabled */\nfunction wrapCreateStub(origCreate: CreateStubFunc): CreateStubFunc {\n return async function (this: unknown, ...args: Parameters<CreateStubFunc>) {\n const servicePath = args[1]?.servicePath;\n if (servicePath == null || servicePath == undefined) {\n return origCreate.apply(this, args);\n }\n const serviceIdentifier = identifyService(servicePath);\n const stub = await origCreate.apply(this, args);\n for (const methodName of Object.keys(Object.getPrototypeOf(stub))) {\n fillGrpcFunction(stub, serviceIdentifier, methodName);\n }\n return stub;\n };\n}\n\n/** Patches the function in grpc stub to enable tracing */\nexport function fillGrpcFunction(stub: Stub, serviceIdentifier: string, methodName: string): void {\n const funcObj = stub[methodName];\n if (typeof funcObj !== 'function') {\n return;\n }\n const callType =\n !funcObj.requestStream && !funcObj.responseStream\n ? 'unary call'\n : funcObj.requestStream && !funcObj.responseStream\n ? 'client stream'\n : !funcObj.requestStream && funcObj.responseStream\n ? 'server stream'\n : 'bidi stream';\n if (callType != 'unary call') {\n return;\n }\n fill(\n stub,\n methodName,\n (orig: GrpcFunction): GrpcFunction =>\n (...args) => {\n const ret = orig.apply(stub, args);\n if (typeof ret?.on !== 'function' || !SETUP_CLIENTS.has(getClient() as Client)) {\n return ret;\n }\n const span = startInactiveSpan({\n name: `${callType} ${methodName}`,\n onlyIfParent: true,\n op: `grpc.${serviceIdentifier}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.grpc.serverless',\n },\n });\n ret.on('status', () => {\n if (span) {\n span.end();\n }\n });\n return ret;\n },\n );\n}\n\n/** Identifies service by its address */\nfunction identifyService(servicePath: string): string {\n const match = servicePath.match(SERVICE_PATH_REGEX);\n return match?.[1] || servicePath;\n}\n"],"names":["fill","defineIntegration","getClient","startInactiveSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN"],"mappings":";;;;;AA2BA,MAAM,kBAAA,GAAqB,yBAAyB;;AAEpD,MAAM,gBAAA,GAAmB,iBAAiB;;AAE1C,MAAM,aAAA,GAAgB,IAAI,OAAO,EAAmB;;AAEpD,MAAM,2BAAA,IAA+B,CAAC,OAAO,GAA2B,EAAE,KAAK;AAC/E,EAAE,MAAM,QAAA,GAAW,OAAO,CAAC,QAAA,IAAY,KAAK;AAC5C,EAAE,OAAO;AACT,IAAI,IAAI,EAA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A;AACA,YAAA,IAAA,CAAA,GAAA,EAAA;AACA,UAAA;AACA,QAAA,CAAA,CAAA;AACA,QAAA,OAAA,GAAA;AACA,MAAA,CAAA;AACA,GAAA;AACA;;AAEA;AACA,SAAA,eAAA,CAAA,WAAA,EAAA;AACA,EAAA,MAAA,KAAA,GAAA,WAAA,CAAA,KAAA,CAAA,kBAAA,CAAA;AACA,EAAA,OAAA,KAAA,GAAA,CAAA,CAAA,IAAA,WAAA;AACA;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"google-cloud-http.js","sources":["../../../src/integrations/google-cloud-http.ts"],"sourcesContent":["import type * as common from '@google-cloud/common';\nimport type { Client, IntegrationFn } from '@sentry/core';\nimport {\n defineIntegration,\n fill,\n getClient,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n} from '@sentry/core';\nimport { startInactiveSpan } from '@sentry/node';\n\ntype RequestOptions = common.DecorateRequestOptions;\ntype ResponseCallback = common.BodyResponseCallback;\n// This interace could be replaced with just type alias once the `strictBindCallApply` mode is enabled.\ninterface RequestFunction extends CallableFunction {\n (reqOpts: RequestOptions, callback: ResponseCallback): void;\n}\n\nconst INTEGRATION_NAME = 'GoogleCloudHttp';\n\nconst SETUP_CLIENTS = new WeakMap<Client, boolean>();\n\nconst _googleCloudHttpIntegration = ((options: { optional?: boolean } = {}) => {\n const optional = options.optional || false;\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const commonModule = require('@google-cloud/common') as typeof common;\n fill(commonModule.Service.prototype, 'request', wrapRequestFunction);\n } catch (e) {\n if (!optional) {\n throw e;\n }\n }\n },\n setup(client) {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Google Cloud Platform service requests tracking for RESTful APIs.\n */\nexport const googleCloudHttpIntegration = defineIntegration(_googleCloudHttpIntegration);\n\n/** Returns a wrapped function that makes a request with tracing enabled */\nfunction wrapRequestFunction(orig: RequestFunction): RequestFunction {\n return function (this: common.Service, reqOpts: RequestOptions, callback: ResponseCallback): void {\n const httpMethod = reqOpts.method || 'GET';\n const span = SETUP_CLIENTS.has(getClient() as Client)\n ? startInactiveSpan({\n name: `${httpMethod} ${reqOpts.uri}`,\n onlyIfParent: true,\n op: `http.client.${identifyService(this.apiEndpoint)}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.serverless',\n },\n })\n : new SentryNonRecordingSpan();\n orig.call(this, reqOpts, (...args: Parameters<ResponseCallback>) => {\n span.end();\n callback(...args);\n });\n };\n}\n\n/** Identifies service by its base url */\nfunction identifyService(apiEndpoint: string): string {\n const match = apiEndpoint.match(/^https:\\/\\/(\\w+)\\.googleapis.com$/);\n return match?.[1] || apiEndpoint.replace(/^(http|https)?:\\/\\//, '');\n}\n"],"names":["fill","defineIntegration","getClient","startInactiveSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SentryNonRecordingSpan"],"mappings":";;;;;AAkBA,MAAM,gBAAA,GAAmB,iBAAiB;;AAE1C,MAAM,aAAA,GAAgB,IAAI,OAAO,EAAmB;;AAEpD,MAAM,2BAAA,IAA+B,CAAC,OAAO,GAA2B,EAAE,KAAK;AAC/E,EAAE,MAAM,QAAA,GAAW,OAAO,CAAC,QAAA,IAAY,KAAK;AAC5C,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,IAAI;AACV;AACA,QAAQ,MAAM,YAAA,GAAe,OAAO,CAAC,sBAAsB,CAAA;AAC3D,QAAQA,SAAI,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,mBAAmB,CAAC;AAC5E,OAAM,CAAE,OAAO,CAAC,EAAE;AAClB,QAAQ,IAAI,CAAC,QAAQ,EAAE;AACvB,UAAU,MAAM,CAAC;AACjB;AACA;AACA,KAAK;AACL,IAAI,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":["import type * as common from '@google-cloud/common';\nimport type { Client, IntegrationFn } from '@sentry/core';\nimport {\n defineIntegration,\n fill,\n getClient,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n} from '@sentry/core';\nimport { startInactiveSpan } from '@sentry/node';\n\ntype RequestOptions = common.DecorateRequestOptions;\ntype ResponseCallback = common.BodyResponseCallback;\n// This interace could be replaced with just type alias once the `strictBindCallApply` mode is enabled.\ninterface RequestFunction extends CallableFunction {\n (reqOpts: RequestOptions, callback: ResponseCallback): void;\n}\n\nconst INTEGRATION_NAME = 'GoogleCloudHttp';\n\nconst SETUP_CLIENTS = new WeakMap<Client, boolean>();\n\nconst _googleCloudHttpIntegration = ((options: { optional?: boolean } = {}) => {\n const optional = options.optional || false;\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const commonModule = require('@google-cloud/common') as typeof common;\n fill(commonModule.Service.prototype, 'request', wrapRequestFunction);\n } catch (e) {\n if (!optional) {\n throw e;\n }\n }\n },\n setup(client) {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Google Cloud Platform service requests tracking for RESTful APIs.\n */\nexport const googleCloudHttpIntegration = defineIntegration(_googleCloudHttpIntegration);\n\n/** Returns a wrapped function that makes a request with tracing enabled */\nfunction wrapRequestFunction(orig: RequestFunction): RequestFunction {\n return function (this: common.Service, reqOpts: RequestOptions, callback: ResponseCallback): void {\n const httpMethod = reqOpts.method || 'GET';\n const span = SETUP_CLIENTS.has(getClient() as Client)\n ? startInactiveSpan({\n name: `${httpMethod} ${reqOpts.uri}`,\n onlyIfParent: true,\n op: `http.client.${identifyService(this.apiEndpoint)}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.serverless',\n },\n })\n : new SentryNonRecordingSpan();\n orig.call(this, reqOpts, (...args: Parameters<ResponseCallback>) => {\n span.end();\n callback(...args);\n });\n };\n}\n\n/** Identifies service by its base url */\nfunction identifyService(apiEndpoint: string): string {\n const match = apiEndpoint.match(/^https:\\/\\/(\\w+)\\.googleapis.com$/);\n return match?.[1] || apiEndpoint.replace(/^(http|https)?:\\/\\//, '');\n}\n"],"names":["fill","defineIntegration","getClient","startInactiveSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SentryNonRecordingSpan"],"mappings":";;;;;AAkBA,MAAM,gBAAA,GAAmB,iBAAiB;;AAE1C,MAAM,aAAA,GAAgB,IAAI,OAAO,EAAmB;;AAEpD,MAAM,2BAAA,IAA+B,CAAC,OAAO,GAA2B,EAAE,KAAK;AAC/E,EAAE,MAAM,QAAA,GAAW,OAAO,CAAC,QAAA,IAAY,KAAK;AAC5C,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,IAAI;AACV;AACA,QAAQ,MAAM,YAAA,GAAe,OAAO,CAAC,sBAAsB,CAAA;AAC3D,QAAQA,SAAI,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,mBAAmB,CAAC;AAC5E,MAAM,CAAA,CAAE,OAAO,CAAC,EAAE;AAClB,QAAQ,IAAI,CAAC,QAAQ,EAAE;AACvB,UAAU,MAAM,CAAC;AACjB,QAAQ;AACR,MAAM;AACN,IAAI,CAAC;AACL,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;AACrC,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;MACa,0BAAA,GAA6BC,sBAAiB,CAAC,2BAA2B;;AAEvF;AACA,SAAS,mBAAmB,CAAC,IAAI,EAAoC;AACrE,EAAE,OAAO,WAAgC,OAAO,EAAkB,QAAQ,EAA0B;AACpG,IAAI,MAAM,UAAA,GAAa,OAAO,CAAC,MAAA,IAAU,KAAK;AAC9C,IAAI,MAAM,OAAO,aAAa,CAAC,GAAG,CAACC,cAAS,EAAC;AAC7C,QAAQC,sBAAiB,CAAC;AAC1B,UAAU,IAAI,EAAE,CAAC,EAAA,UAAA,CAAA,CAAA,EAAA,OAAA,CAAA,GAAA,CAAA,CAAA;AACA,UAAA,YAAA,EAAA,IAAA;AACA,UAAA,EAAA,EAAA,CAAA,YAAA,EAAA,eAAA,CAAA,IAAA,CAAA,WAAA,CAAA,CAAA,CAAA;AACA,UAAA,UAAA,EAAA;AACA,YAAA,CAAAC,qCAAA,GAAA,sBAAA;AACA,WAAA;AACA,SAAA;AACA,QAAA,IAAAC,2BAAA,EAAA;AACA,IAAA,IAAA,CAAA,IAAA,CAAA,IAAA,EAAA,OAAA,EAAA,CAAA,GAAA,IAAA,KAAA;AACA,MAAA,IAAA,CAAA,GAAA,EAAA;AACA,MAAA,QAAA,CAAA,GAAA,IAAA,CAAA;AACA,IAAA,CAAA,CAAA;AACA,EAAA,CAAA;AACA;;AAEA;AACA,SAAA,eAAA,CAAA,WAAA,EAAA;AACA,EAAA,MAAA,KAAA,GAAA,WAAA,CAAA,KAAA,CAAA,mCAAA,CAAA;AACA,EAAA,OAAA,KAAA,GAAA,CAAA,CAAA,IAAA,WAAA,CAAA,OAAA,CAAA,qBAAA,EAAA,EAAA,CAAA;AACA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../src/utils.ts"],"sourcesContent":["import type { Scope } from '@sentry/core';\nimport { addExceptionMechanism, withIsolationScope } from '@sentry/core';\n\n/**\n * @param fn function to run\n * @returns function which runs in the newly created domain or in the existing one\n */\nexport function domainify<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R | void {\n return (...args) => withIsolationScope(() => fn(...args));\n}\n\n/**\n * @param source function to be wrapped\n * @param wrap wrapping function that takes source and returns a wrapper\n * @param overrides properties to override in the source\n * @returns wrapped function\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function proxyFunction<A extends any[], R, F extends (...args: A) => R>(\n source: F,\n wrap: (source: F) => F,\n overrides?: Record<PropertyKey, unknown>,\n): F {\n const wrapper = wrap(source);\n const handler: ProxyHandler<F> = {\n apply: <T>(_target: F, thisArg: T, args: A) => {\n return wrapper.apply(thisArg, args);\n },\n };\n\n if (overrides) {\n handler.get = (target, prop) => {\n if (Object.prototype.hasOwnProperty.call(overrides, prop)) {\n return overrides[prop as string];\n }\n return (target as Record<PropertyKey, unknown>)[prop as string];\n };\n }\n\n return new Proxy(source, handler);\n}\n\n/**\n * Marks an event as unhandled by adding a span processor to the passed scope.\n */\nexport function markEventUnhandled(scope: Scope, type: string): Scope {\n scope.addEventProcessor(event => {\n addExceptionMechanism(event, { handled: false, type });\n return event;\n });\n\n return scope;\n}\n"],"names":["withIsolationScope","addExceptionMechanism"],"mappings":";;;;AAGA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAyB,EAAE,EAA+C;AACnG,EAAE,OAAO,CAAC,GAAG,IAAI,KAAKA,uBAAkB,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;AAC3D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa;AAC7B,EAAE,MAAM;AACR,EAAE,IAAI;AACN,EAAE,SAAS;AACX,EAAK;AACL,EAAE,MAAM,OAAA,GAAU,IAAI,CAAC,MAAM,CAAC;AAC9B,EAAE,MAAM,OAAO,GAAoB;AACnC,IAAI,KAAK,EAAE,CAAI,OAAO,EAAK,OAAO,EAAK,IAAI,KAAQ;AACnD,MAAM,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;AACzC,KAAK;AACL,GAAG;;AAEH,EAAE,IAAI,SAAS,EAAE;AACjB,IAAI,OAAO,CAAC,GAAA,GAAM,CAAC,MAAM,EAAE,IAAI,KAAK;AACpC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE;AACjE,QAAQ,OAAO,SAAS,CAAC,IAAA,EAAe;AACxC;AACA,MAAM,OAAO,CAAC,MAAA,GAAwC,MAAe;AACrE,KAAK;AACL;;AAEA,EAAE,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC;AACnC;;AAEA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,KAAK,EAAS,IAAI,EAAiB;AACtE,EAAE,KAAK,CAAC,iBAAiB,CAAC,SAAS;AACnC,IAAIC,0BAAqB,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,IAAA,EAAM,CAAC;AAC1D,IAAI,OAAO,KAAK;AAChB,GAAG,CAAC;;AAEJ,EAAE,OAAO,KAAK;AACd;;;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../src/utils.ts"],"sourcesContent":["import type { Scope } from '@sentry/core';\nimport { addExceptionMechanism, withIsolationScope } from '@sentry/core';\n\n/**\n * @param fn function to run\n * @returns function which runs in the newly created domain or in the existing one\n */\nexport function domainify<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R | void {\n return (...args) => withIsolationScope(() => fn(...args));\n}\n\n/**\n * @param source function to be wrapped\n * @param wrap wrapping function that takes source and returns a wrapper\n * @param overrides properties to override in the source\n * @returns wrapped function\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function proxyFunction<A extends any[], R, F extends (...args: A) => R>(\n source: F,\n wrap: (source: F) => F,\n overrides?: Record<PropertyKey, unknown>,\n): F {\n const wrapper = wrap(source);\n const handler: ProxyHandler<F> = {\n apply: <T>(_target: F, thisArg: T, args: A) => {\n return wrapper.apply(thisArg, args);\n },\n };\n\n if (overrides) {\n handler.get = (target, prop) => {\n if (Object.prototype.hasOwnProperty.call(overrides, prop)) {\n return overrides[prop as string];\n }\n return (target as Record<PropertyKey, unknown>)[prop as string];\n };\n }\n\n return new Proxy(source, handler);\n}\n\n/**\n * Marks an event as unhandled by adding a span processor to the passed scope.\n */\nexport function markEventUnhandled(scope: Scope, type: string): Scope {\n scope.addEventProcessor(event => {\n addExceptionMechanism(event, { handled: false, type });\n return event;\n });\n\n return scope;\n}\n"],"names":["withIsolationScope","addExceptionMechanism"],"mappings":";;;;AAGA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAyB,EAAE,EAA+C;AACnG,EAAE,OAAO,CAAC,GAAG,IAAI,KAAKA,uBAAkB,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;AAC3D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa;AAC7B,EAAE,MAAM;AACR,EAAE,IAAI;AACN,EAAE,SAAS;AACX,EAAK;AACL,EAAE,MAAM,OAAA,GAAU,IAAI,CAAC,MAAM,CAAC;AAC9B,EAAE,MAAM,OAAO,GAAoB;AACnC,IAAI,KAAK,EAAE,CAAI,OAAO,EAAK,OAAO,EAAK,IAAI,KAAQ;AACnD,MAAM,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;AACzC,IAAI,CAAC;AACL,GAAG;;AAEH,EAAE,IAAI,SAAS,EAAE;AACjB,IAAI,OAAO,CAAC,GAAA,GAAM,CAAC,MAAM,EAAE,IAAI,KAAK;AACpC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE;AACjE,QAAQ,OAAO,SAAS,CAAC,IAAA,EAAe;AACxC,MAAM;AACN,MAAM,OAAO,CAAC,MAAA,GAAwC,MAAe;AACrE,IAAI,CAAC;AACL,EAAE;;AAEF,EAAE,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC;AACnC;;AAEA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,KAAK,EAAS,IAAI,EAAiB;AACtE,EAAE,KAAK,CAAC,iBAAiB,CAAC,SAAS;AACnC,IAAIC,0BAAqB,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,IAAA,EAAM,CAAC;AAC1D,IAAI,OAAO,KAAK;AAChB,EAAE,CAAC,CAAC;;AAEJ,EAAE,OAAO,KAAK;AACd;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"cloud_events.js","sources":["../../../src/gcpfunction/cloud_events.ts"],"sourcesContent":["import {\n debug,\n handleCallbackErrors,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n} from '@sentry/core';\nimport { captureException, flush, getCurrentScope, startSpanManual } from '@sentry/node';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { domainify, markEventUnhandled, proxyFunction } from '../utils';\nimport type { CloudEventFunction, CloudEventFunctionWithCallback, WrapperOptions } from './general';\n\nexport type CloudEventFunctionWrapperOptions = WrapperOptions;\n\n/**\n * Wraps an event function handler adding it error capture and tracing capabilities.\n *\n * @param fn Event handler\n * @param options Options\n * @returns Event handler\n */\nexport function wrapCloudEventFunction(\n fn: CloudEventFunction | CloudEventFunctionWithCallback,\n wrapOptions: Partial<CloudEventFunctionWrapperOptions> = {},\n): CloudEventFunctionWithCallback {\n return proxyFunction(fn, f => domainify(_wrapCloudEventFunction(f, wrapOptions)));\n}\n\nfunction _wrapCloudEventFunction(\n fn: CloudEventFunction | CloudEventFunctionWithCallback,\n wrapOptions: Partial<CloudEventFunctionWrapperOptions> = {},\n): CloudEventFunctionWithCallback {\n const options: CloudEventFunctionWrapperOptions = {\n flushTimeout: 2000,\n ...wrapOptions,\n };\n return (context, callback) => {\n return startSpanManual(\n {\n name: context.type || '<unknown>',\n op: 'function.gcp.cloud_event',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_cloud_event',\n },\n },\n span => {\n const scope = getCurrentScope();\n scope.setContext('gcp.function.context', { ...context });\n\n const newCallback = domainify((...args: unknown[]) => {\n if (args[0] !== null && args[0] !== undefined) {\n captureException(args[0], scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_cloud_event'));\n }\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(options.flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n if (typeof callback === 'function') {\n callback(...args);\n }\n });\n });\n\n if (fn.length > 1) {\n return handleCallbackErrors(\n () => (fn as CloudEventFunctionWithCallback)(context, newCallback),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_cloud_event'));\n },\n );\n }\n\n return Promise.resolve()\n .then(() => (fn as CloudEventFunction)(context))\n .then(\n result => newCallback(null, result),\n err => newCallback(err, undefined),\n );\n },\n );\n };\n}\n"],"names":[],"mappings":";;;;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,sBAAsB;AACtC,EAAE,EAAE;AACJ,EAAE,WAAW,GAA8C,EAAE;AAC7D,EAAkC;AAClC,EAAE,OAAO,aAAa,CAAC,EAAE,EAAE,KAAK,SAAS,CAAC,uBAAuB,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;AACnF;;AAEA,SAAS,uBAAuB;AAChC,EAAE,EAAE;AACJ,EAAE,WAAW,GAA8C,EAAE;AAC7D,EAAkC;AAClC,EAAE,MAAM,OAAO,GAAqC;AACpD,IAAI,YAAY,EAAE,IAAI;AACtB,IAAI,GAAG,WAAW;AAClB,GAAG;AACH,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,KAAK;AAChC,IAAI,OAAO,eAAe;AAC1B,MAAM;AACN,QAAQ,IAAI,EAAE,OAAO,CAAC,IAAA,IAAQ,WAAW;AACzC,QAAQ,EAAE,EAAE,0BAA0B;AACtC,QAAQ,UAAU,EAAE;AACpB,UAAU,CAAC,gCAAgC,GAAG,WAAW;AACzD,UAAU,CAAC,gCAAgC,GAAG,0CAA0C;AACxF,SAAS;AACT,OAAO;AACP,MAAM,QAAQ;AACd,QAAQ,MAAM,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AAO,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC;AAC9C,WAAW;AACX,OAAO;AACP,KAAK;AACL,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"cloud_events.js","sources":["../../../src/gcpfunction/cloud_events.ts"],"sourcesContent":["import {\n debug,\n handleCallbackErrors,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n} from '@sentry/core';\nimport { captureException, flush, getCurrentScope, startSpanManual } from '@sentry/node';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { domainify, markEventUnhandled, proxyFunction } from '../utils';\nimport type { CloudEventFunction, CloudEventFunctionWithCallback, WrapperOptions } from './general';\n\nexport type CloudEventFunctionWrapperOptions = WrapperOptions;\n\n/**\n * Wraps an event function handler adding it error capture and tracing capabilities.\n *\n * @param fn Event handler\n * @param options Options\n * @returns Event handler\n */\nexport function wrapCloudEventFunction(\n fn: CloudEventFunction | CloudEventFunctionWithCallback,\n wrapOptions: Partial<CloudEventFunctionWrapperOptions> = {},\n): CloudEventFunctionWithCallback {\n return proxyFunction(fn, f => domainify(_wrapCloudEventFunction(f, wrapOptions)));\n}\n\nfunction _wrapCloudEventFunction(\n fn: CloudEventFunction | CloudEventFunctionWithCallback,\n wrapOptions: Partial<CloudEventFunctionWrapperOptions> = {},\n): CloudEventFunctionWithCallback {\n const options: CloudEventFunctionWrapperOptions = {\n flushTimeout: 2000,\n ...wrapOptions,\n };\n return (context, callback) => {\n return startSpanManual(\n {\n name: context.type || '<unknown>',\n op: 'function.gcp.cloud_event',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_cloud_event',\n },\n },\n span => {\n const scope = getCurrentScope();\n scope.setContext('gcp.function.context', { ...context });\n\n const newCallback = domainify((...args: unknown[]) => {\n if (args[0] !== null && args[0] !== undefined) {\n captureException(args[0], scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_cloud_event'));\n }\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(options.flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n if (typeof callback === 'function') {\n callback(...args);\n }\n });\n });\n\n if (fn.length > 1) {\n return handleCallbackErrors(\n () => (fn as CloudEventFunctionWithCallback)(context, newCallback),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_cloud_event'));\n },\n );\n }\n\n return Promise.resolve()\n .then(() => (fn as CloudEventFunction)(context))\n .then(\n result => newCallback(null, result),\n err => newCallback(err, undefined),\n );\n },\n );\n };\n}\n"],"names":[],"mappings":";;;;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,sBAAsB;AACtC,EAAE,EAAE;AACJ,EAAE,WAAW,GAA8C,EAAE;AAC7D,EAAkC;AAClC,EAAE,OAAO,aAAa,CAAC,EAAE,EAAE,KAAK,SAAS,CAAC,uBAAuB,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;AACnF;;AAEA,SAAS,uBAAuB;AAChC,EAAE,EAAE;AACJ,EAAE,WAAW,GAA8C,EAAE;AAC7D,EAAkC;AAClC,EAAE,MAAM,OAAO,GAAqC;AACpD,IAAI,YAAY,EAAE,IAAI;AACtB,IAAI,GAAG,WAAW;AAClB,GAAG;AACH,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,KAAK;AAChC,IAAI,OAAO,eAAe;AAC1B,MAAM;AACN,QAAQ,IAAI,EAAE,OAAO,CAAC,IAAA,IAAQ,WAAW;AACzC,QAAQ,EAAE,EAAE,0BAA0B;AACtC,QAAQ,UAAU,EAAE;AACpB,UAAU,CAAC,gCAAgC,GAAG,WAAW;AACzD,UAAU,CAAC,gCAAgC,GAAG,0CAA0C;AACxF,SAAS;AACT,OAAO;AACP,MAAM,QAAQ;AACd,QAAQ,MAAM,KAAA,GAAQ,e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E,MAAM,CAAC;AAC/C,YAAY,OAAO,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC;AAC9C,WAAW;AACX,MAAM,CAAC;AACP,KAAK;AACL,EAAE,CAAC;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sources":["../../../src/gcpfunction/events.ts"],"sourcesContent":["import {\n debug,\n handleCallbackErrors,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n} from '@sentry/core';\nimport { captureException, flush, getCurrentScope, startSpanManual } from '@sentry/node';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { domainify, markEventUnhandled, proxyFunction } from '../utils';\nimport type { EventFunction, EventFunctionWithCallback, WrapperOptions } from './general';\n\nexport type EventFunctionWrapperOptions = WrapperOptions;\n\n/**\n * Wraps an event function handler adding it error capture and tracing capabilities.\n *\n * @param fn Event handler\n * @param options Options\n * @returns Event handler\n */\nexport function wrapEventFunction(\n fn: EventFunction | EventFunctionWithCallback,\n wrapOptions: Partial<EventFunctionWrapperOptions> = {},\n): EventFunctionWithCallback {\n return proxyFunction(fn, f => domainify(_wrapEventFunction(f, wrapOptions)));\n}\n\n/** */\nfunction _wrapEventFunction<F extends EventFunction | EventFunctionWithCallback>(\n fn: F,\n wrapOptions: Partial<EventFunctionWrapperOptions> = {},\n): (...args: Parameters<F>) => ReturnType<F> | Promise<void> {\n const options: EventFunctionWrapperOptions = {\n flushTimeout: 2000,\n ...wrapOptions,\n };\n return (...eventFunctionArguments: Parameters<F>): ReturnType<F> | Promise<void> => {\n const [data, context, callback] = eventFunctionArguments;\n\n return startSpanManual(\n {\n name: context.eventType,\n op: 'function.gcp.event',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_event',\n },\n },\n span => {\n const scope = getCurrentScope();\n scope.setContext('gcp.function.context', { ...context });\n\n const newCallback = domainify((...args: unknown[]) => {\n if (args[0] !== null && args[0] !== undefined) {\n captureException(args[0], scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_event'));\n }\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(options.flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n if (typeof callback === 'function') {\n callback(...args);\n }\n });\n });\n\n if (fn.length > 2) {\n return handleCallbackErrors(\n () => (fn as EventFunctionWithCallback)(data, context, newCallback),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_event'));\n },\n );\n }\n\n return Promise.resolve()\n .then(() => (fn as EventFunction)(data, context))\n .then(\n result => newCallback(null, result),\n err => newCallback(err, undefined),\n );\n },\n );\n };\n}\n"],"names":[],"mappings":";;;;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB;AACjC,EAAE,EAAE;AACJ,EAAE,WAAW,GAAyC,EAAE;AACxD,EAA6B;AAC7B,EAAE,OAAO,aAAa,CAAC,EAAE,EAAE,KAAK,SAAS,CAAC,kBAAkB,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;AAC9E;;AAEA;AACA,SAAS,kBAAkB;AAC3B,EAAE,EAAE;AACJ,EAAE,WAAW,GAAyC,EAAE;AACxD,EAA6D;AAC7D,EAAE,MAAM,OAAO,GAAgC;AAC/C,IAAI,YAAY,EAAE,IAAI;AACtB,IAAI,GAAG,WAAW;AAClB,GAAG;AACH,EAAE,OAAO,CAAC,GAAG,sBAAsB,KAAmD;AACtF,IAAI,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAA,GAAI,sBAAsB;;AAE5D,IAAI,OAAO,eAAe;AAC1B,MAAM;AACN,QAAQ,IAAI,EAAE,OAAO,CAAC,SAAS;AAC/B,QAAQ,EAAE,EAAE,oBAAoB;AAChC,QAAQ,UAAU,EAAE;AACpB,UAAU,CAAC,gCA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I,CAAC,MAAM,CAAC,EAAA,GAAqB,IAAI,EAAE,OAAO,CAAC;AAC1D,WAAW,IAAI;AACf,YAAY,UAAU,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC;AAC/C,YAAY,OAAO,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC;AAC9C,WAAW;AACX,OAAO;AACP,KAAK;AACL,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"events.js","sources":["../../../src/gcpfunction/events.ts"],"sourcesContent":["import {\n debug,\n handleCallbackErrors,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n} from '@sentry/core';\nimport { captureException, flush, getCurrentScope, startSpanManual } from '@sentry/node';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { domainify, markEventUnhandled, proxyFunction } from '../utils';\nimport type { EventFunction, EventFunctionWithCallback, WrapperOptions } from './general';\n\nexport type EventFunctionWrapperOptions = WrapperOptions;\n\n/**\n * Wraps an event function handler adding it error capture and tracing capabilities.\n *\n * @param fn Event handler\n * @param options Options\n * @returns Event handler\n */\nexport function wrapEventFunction(\n fn: EventFunction | EventFunctionWithCallback,\n wrapOptions: Partial<EventFunctionWrapperOptions> = {},\n): EventFunctionWithCallback {\n return proxyFunction(fn, f => domainify(_wrapEventFunction(f, wrapOptions)));\n}\n\n/** */\nfunction _wrapEventFunction<F extends EventFunction | EventFunctionWithCallback>(\n fn: F,\n wrapOptions: Partial<EventFunctionWrapperOptions> = {},\n): (...args: Parameters<F>) => ReturnType<F> | Promise<void> {\n const options: EventFunctionWrapperOptions = {\n flushTimeout: 2000,\n ...wrapOptions,\n };\n return (...eventFunctionArguments: Parameters<F>): ReturnType<F> | Promise<void> => {\n const [data, context, callback] = eventFunctionArguments;\n\n return startSpanManual(\n {\n name: context.eventType,\n op: 'function.gcp.event',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_event',\n },\n },\n span => {\n const scope = getCurrentScope();\n scope.setContext('gcp.function.context', { ...context });\n\n const newCallback = domainify((...args: unknown[]) => {\n if (args[0] !== null && args[0] !== undefined) {\n captureException(args[0], scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_event'));\n }\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(options.flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n if (typeof callback === 'function') {\n callback(...args);\n }\n });\n });\n\n if (fn.length > 2) {\n return handleCallbackErrors(\n () => (fn as EventFunctionWithCallback)(data, context, newCallback),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_event'));\n },\n );\n }\n\n return Promise.resolve()\n .then(() => (fn as EventFunction)(data, context))\n .then(\n result => newCallback(null, result),\n err => newCallback(err, undefined),\n );\n },\n );\n };\n}\n"],"names":[],"mappings":";;;;;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB;AACjC,EAAE,EAAE;AACJ,EAAE,WAAW,GAAyC,EAAE;AACxD,EAA6B;AAC7B,EAAE,OAAO,aAAa,CAAC,EAAE,EAAE,KAAK,SAAS,CAAC,kBAAkB,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;AAC9E;;AAEA;AACA,SAAS,kBAAkB;AAC3B,EAAE,EAAE;AACJ,EAAE,WAAW,GAAyC,EAAE;AACxD,EAA6D;AAC7D,EAAE,MAAM,OAAO,GAAgC;AAC/C,IAAI,YAAY,EAAE,IAAI;AACtB,IAAI,GAAG,WAAW;AAClB,GAAG;AACH,EAAE,OAAO,CAAC,GAAG,sBAAsB,KAAmD;AACtF,IAAI,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAA,GAAI,sBAAsB;;AAE5D,IAAI,OAAO,eAAe;AAC1B,MAAM;AACN,QAAQ,IAAI,EAAE,OAAO,CAA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AAC,KAAK,EAAE,oCAAoC,CAAC,CAAC;AAC7G,YAAY,CAAC;AACb,WAAW;AACX,QAAQ;;AAER,QAAQ,OAAO,OAAO,CAAC,OAAO;AAC9B,WAAW,IAAI,CAAC,MAAM,CAAC,EAAA,GAAqB,IAAI,EAAE,OAAO,CAAC;AAC1D,WAAW,IAAI;AACf,YAAY,UAAU,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC;AAC/C,YAAY,OAAO,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC;AAC9C,WAAW;AACX,MAAM,CAAC;AACP,KAAK;AACL,EAAE,CAAC;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sources":["../../../src/gcpfunction/http.ts"],"sourcesContent":["import {\n debug,\n handleCallbackErrors,\n httpRequestToRequestData,\n isString,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n setHttpStatus,\n stripUrlQueryAndFragment,\n} from '@sentry/core';\nimport { captureException, continueTrace, flush, getCurrentScope, startSpanManual } from '@sentry/node';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { domainify, markEventUnhandled, proxyFunction } from '../utils';\nimport type { HttpFunction, WrapperOptions } from './general';\n\n/**\n * Wraps an HTTP function handler adding it error capture and tracing capabilities.\n *\n * @param fn HTTP Handler\n * @param options Options\n * @returns HTTP handler\n */\nexport function wrapHttpFunction(fn: HttpFunction, wrapOptions: Partial<WrapperOptions> = {}): HttpFunction {\n const wrap = (f: HttpFunction): HttpFunction => domainify(_wrapHttpFunction(f, wrapOptions));\n\n let overrides: Record<PropertyKey, unknown> | undefined;\n\n // Functions emulator from firebase-tools has a hack-ish workaround that saves the actual function\n // passed to `onRequest(...)` and in fact runs it so we need to wrap it too.\n const emulatorFunc = (fn as HttpFunction & { __emulator_func?: HttpFunction }).__emulator_func;\n if (emulatorFunc) {\n overrides = { __emulator_func: proxyFunction(emulatorFunc, wrap) };\n }\n return proxyFunction(fn, wrap, overrides);\n}\n\n/** */\nfunction _wrapHttpFunction(fn: HttpFunction, options: Partial<WrapperOptions>): HttpFunction {\n const flushTimeout = options.flushTimeout || 2000;\n return (req, res) => {\n const reqMethod = (req.method || '').toUpperCase();\n const reqUrl = stripUrlQueryAndFragment(req.originalUrl || req.url || '');\n\n const sentryTrace = req.headers && isString(req.headers['sentry-trace']) ? req.headers['sentry-trace'] : undefined;\n const baggage = req.headers?.baggage;\n\n return continueTrace({ sentryTrace, baggage }, () => {\n const normalizedRequest = httpRequestToRequestData(req);\n getCurrentScope().setSDKProcessingMetadata({ normalizedRequest });\n\n return startSpanManual(\n {\n name: `${reqMethod} ${reqUrl}`,\n op: 'function.gcp.http',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_http',\n },\n },\n span => {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const _end = res.end;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n res.end = function (chunk?: any | (() => void), encoding?: string | (() => void), cb?: () => void): any {\n setHttpStatus(span, res.statusCode);\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n _end.call(this, chunk, encoding, cb);\n });\n };\n\n return handleCallbackErrors(\n () => fn(req, res),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_http'));\n },\n );\n },\n );\n });\n };\n}\n"],"names":[],"mappings":";;;;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,EAAE,EAAgB,WAAW,GAA4B,EAAE,EAAgB;AAC5G,EAAE,MAAM,IAAA,GAAO,CAAC,CAAC,KAAiC,SAAS,CAAC,iBAAiB,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;;AAE9F,EAAE,IAAI,SAAS;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AAA,GAAA,OAAA;AACA,YAAA,CAAA,gCAAA,GAAA,mCAAA;AACA,WAAA;AACA,SAAA;AACA,QAAA,IAAA,IAAA;AACA;AACA,UAAA,MAAA,IAAA,GAAA,GAAA,CAAA,GAAA;AACA;AACA,UAAA,GAAA,CAAA,GAAA,GAAA,UAAA,KAAA,EAAA,QAAA,EAAA,EAAA,EAAA;AACA,YAAA,aAAA,CAAA,IAAA,EAAA,GAAA,CAAA,UAAA,CAAA;AACA,YAAA,IAAA,CAAA,GAAA,EAAA;;AAEA;AACA,YAAA,KAAA,CAAA,YAAA;AACA,eAAA,IAAA,CAAA,IAAA,EAAA,CAAA,IAAA;AACA,gBAAA,WAAA,IAAA,KAAA,CAAA,KAAA,CAAA,CAAA,CAAA;AACA,eAAA;AACA,eAAA,IAAA,CAAA,MAAA;AACA,gBAAA,IAAA,CAAA,IAAA,CAAA,IAAA,EAAA,KAAA,EAAA,QAAA,EAAA,EAAA,CAAA;AACA,eAAA,CAAA;AACA,WAAA;;AAEA,UAAA,OAAA,oBAAA;AACA,YAAA,MAAA,EAAA,CAAA,GAAA,EAAA,GAAA,CAAA;AACA,YAAA,GAAA,IAAA;AACA,cAAA,gBAAA,CAAA,GAAA,EAAA,KAAA,IAAA,kBAAA,CAAA,KAAA,EAAA,mCAAA,CAAA,CAAA;AACA,aAAA;AACA,WAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA,GAAA;AACA;;;;"}
1
+ {"version":3,"file":"http.js","sources":["../../../src/gcpfunction/http.ts"],"sourcesContent":["import {\n debug,\n handleCallbackErrors,\n httpRequestToRequestData,\n isString,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n setHttpStatus,\n stripUrlQueryAndFragment,\n} from '@sentry/core';\nimport { captureException, continueTrace, flush, getCurrentScope, startSpanManual } from '@sentry/node';\nimport { DEBUG_BUILD } from '../debug-build';\nimport { domainify, markEventUnhandled, proxyFunction } from '../utils';\nimport type { HttpFunction, WrapperOptions } from './general';\n\n/**\n * Wraps an HTTP function handler adding it error capture and tracing capabilities.\n *\n * @param fn HTTP Handler\n * @param options Options\n * @returns HTTP handler\n */\nexport function wrapHttpFunction(fn: HttpFunction, wrapOptions: Partial<WrapperOptions> = {}): HttpFunction {\n const wrap = (f: HttpFunction): HttpFunction => domainify(_wrapHttpFunction(f, wrapOptions));\n\n let overrides: Record<PropertyKey, unknown> | undefined;\n\n // Functions emulator from firebase-tools has a hack-ish workaround that saves the actual function\n // passed to `onRequest(...)` and in fact runs it so we need to wrap it too.\n const emulatorFunc = (fn as HttpFunction & { __emulator_func?: HttpFunction }).__emulator_func;\n if (emulatorFunc) {\n overrides = { __emulator_func: proxyFunction(emulatorFunc, wrap) };\n }\n return proxyFunction(fn, wrap, overrides);\n}\n\n/** */\nfunction _wrapHttpFunction(fn: HttpFunction, options: Partial<WrapperOptions>): HttpFunction {\n const flushTimeout = options.flushTimeout || 2000;\n return (req, res) => {\n const reqMethod = (req.method || '').toUpperCase();\n const reqUrl = stripUrlQueryAndFragment(req.originalUrl || req.url || '');\n\n const sentryTrace = req.headers && isString(req.headers['sentry-trace']) ? req.headers['sentry-trace'] : undefined;\n const baggage = req.headers?.baggage;\n\n return continueTrace({ sentryTrace, baggage }, () => {\n const normalizedRequest = httpRequestToRequestData(req);\n getCurrentScope().setSDKProcessingMetadata({ normalizedRequest });\n\n return startSpanManual(\n {\n name: `${reqMethod} ${reqUrl}`,\n op: 'function.gcp.http',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_http',\n },\n },\n span => {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const _end = res.end;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n res.end = function (chunk?: any | (() => void), encoding?: string | (() => void), cb?: () => void): any {\n setHttpStatus(span, res.statusCode);\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n _end.call(this, chunk, encoding, cb);\n });\n };\n\n return handleCallbackErrors(\n () => fn(req, res),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_http'));\n },\n );\n },\n );\n });\n };\n}\n"],"names":[],"mappings":";;;;;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,EAAE,EAAgB,WAAW,GAA4B,EAAE,EAAgB;AAC5G,EAAE,MAAM,IAAA,GAAO,CAAC,CAAC,KAAiC,SAAS,CAAC,iBAAiB,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;;AAE9F,EAAE,IAAI,SAAS;;AAEf;AACA;AACA,EAAE,MAAM,YAAA,GAAe,CAAC,EAAA,GAAyD,eAAe;AAChG,EAAE,IAAI,YAAY,EAAE;AACpB,IAAI,SAAA,GAAY,EAAE,eAAe,EAAE,aAAa,CAAC,YAAY,EAAE,IAAI,CAAA,EAAG;AACtE,EAAE;AACF,EAAE,OAAO,aAAa,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC;AAC3C;;AAEA;AACA,SAAS,iBAAiB,CAAC,EAAE,EAAgB,OAAO,EAAyC;AAC7F,EAAE,MAAM,YAAA,GAAe,OAAO,CAAC,YAAA,IAAgB,IAAI;AACnD,EAAE,OAAO,CAAC,GAAG,EAAE,GAAG,KAAK;AACvB,IAAI,MAAM,SAAA,GAAY,CAAC,GAAG,CAAC,MAAA,IAAU,EAAE,EAAE,WAAW,EAAE;AACtD,IAAI,MAAM,MAAA,GAAS,wBAAwB,CAAC,GAAG,CAAC,WAAA,IAAe,GAAG,CAAC,GAAA,IAAO,EAAE,CAAC;;AAE7E,IAAI,MAAM,WAAA,GAAc,GAAG,CAAC,WAAW,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA,GAAI,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GAAA,IAAA;AACA,cAAA,gBAAA,CAAA,GAAA,EAAA,KAAA,IAAA,kBAAA,CAAA,KAAA,EAAA,mCAAA,CAAA,CAAA;AACA,YAAA,CAAA;AACA,WAAA;AACA,QAAA,CAAA;AACA,OAAA;AACA,IAAA,CAAA,CAAA;AACA,EAAA,CAAA;AACA;;;;"}
@@ -1,4 +1,4 @@
1
- export { NODE_VERSION, NodeClient, OpenFeatureIntegrationHook, SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, Scope, addBreadcrumb, addEventProcessor, addIntegration, amqplibIntegration, anrIntegration, anthropicAIIntegration, buildLaunchDarklyFlagUsedHandler, captureCheckIn, captureEvent, captureException, captureFeedback, captureMessage, captureSession, childProcessIntegration, close, connectIntegration, consoleIntegration, consoleLoggingIntegration, contextLinesIntegration, continueTrace, createConsolaReporter, createGetModuleFromFilename, createLangChainCallbackHandler, createSentryWinstonTransport, createTransport, cron, dataloaderIntegration, defaultStackParser, disableAnrDetectionForCallback, endSession, eventFiltersIntegration, expressErrorHandler, expressIntegration, fastifyIntegration, featureFlagsIntegration, firebaseIntegration, flush, fsIntegration, functionToStringIntegration, generateInstrumentOnce, genericPoolIntegration, getActiveSpan, getAutoPerformanceIntegrations, getClient, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSentryRelease, getSpanDescendants, getSpanStatusFromHttpCode, getTraceData, getTraceMetaTags, googleGenAIIntegration, graphqlIntegration, growthbookIntegration, hapiIntegration, honoIntegration, httpHeadersToSpanAttributes, httpIntegration, httpServerIntegration, httpServerSpansIntegration, inboundFiltersIntegration, initOpenTelemetry, instrumentSupabaseClient, isEnabled, isInitialized, kafkaIntegration, knexIntegration, koaIntegration, langChainIntegration, lastEventId, launchDarklyIntegration, linkedErrorsIntegration, localVariablesIntegration, logger, lruMemoizerIntegration, makeNodeTransport, modulesIntegration, mongoIntegration, mongooseIntegration, mysql2Integration, mysqlIntegration, nativeNodeFetchIntegration, nodeContextIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, openAIIntegration, openFeatureIntegration, parameterize, pinoIntegration, postgresIntegration, postgresJsIntegration, prismaIntegration, profiler, redisIntegration, requestDataIntegration, setContext, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, setupConnectErrorHandler, setupExpressErrorHandler, setupHapiErrorHandler, setupHonoErrorHandler, setupKoaErrorHandler, spanToBaggageHeader, spanToJSON, spanToTraceHeader, spotlightIntegration, startInactiveSpan, startNewTrace, startSession, startSpan, startSpanManual, statsigIntegration, supabaseIntegration, suppressTracing, systemErrorIntegration, tediousIntegration, trpcMiddleware, unleashIntegration, updateSpanName, vercelAIIntegration, winterCGHeadersToDict, withActiveSpan, withIsolationScope, withMonitor, withScope, wrapMcpServerWithSentry, zodErrorsIntegration } from '@sentry/node';
1
+ export { NODE_VERSION, NodeClient, OpenFeatureIntegrationHook, SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, Scope, addBreadcrumb, addEventProcessor, addIntegration, amqplibIntegration, anrIntegration, anthropicAIIntegration, buildLaunchDarklyFlagUsedHandler, captureCheckIn, captureEvent, captureException, captureFeedback, captureMessage, captureSession, childProcessIntegration, close, connectIntegration, consoleIntegration, consoleLoggingIntegration, contextLinesIntegration, continueTrace, createConsolaReporter, createGetModuleFromFilename, createLangChainCallbackHandler, createSentryWinstonTransport, createTransport, cron, dataloaderIntegration, defaultStackParser, disableAnrDetectionForCallback, endSession, eventFiltersIntegration, expressErrorHandler, expressIntegration, fastifyIntegration, featureFlagsIntegration, firebaseIntegration, flush, fsIntegration, functionToStringIntegration, generateInstrumentOnce, genericPoolIntegration, getActiveSpan, getAutoPerformanceIntegrations, getClient, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSentryRelease, getSpanDescendants, getSpanStatusFromHttpCode, getTraceData, getTraceMetaTags, googleGenAIIntegration, graphqlIntegration, growthbookIntegration, hapiIntegration, honoIntegration, httpHeadersToSpanAttributes, httpIntegration, httpServerIntegration, httpServerSpansIntegration, inboundFiltersIntegration, initOpenTelemetry, instrumentSupabaseClient, isEnabled, isInitialized, kafkaIntegration, knexIntegration, koaIntegration, langChainIntegration, lastEventId, launchDarklyIntegration, linkedErrorsIntegration, localVariablesIntegration, logger, lruMemoizerIntegration, makeNodeTransport, metrics, modulesIntegration, mongoIntegration, mongooseIntegration, mysql2Integration, mysqlIntegration, nativeNodeFetchIntegration, nodeContextIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, openAIIntegration, openFeatureIntegration, parameterize, pinoIntegration, postgresIntegration, postgresJsIntegration, prismaIntegration, profiler, redisIntegration, requestDataIntegration, setContext, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, setupConnectErrorHandler, setupExpressErrorHandler, setupHapiErrorHandler, setupHonoErrorHandler, setupKoaErrorHandler, spanToBaggageHeader, spanToJSON, spanToTraceHeader, spotlightIntegration, startInactiveSpan, startNewTrace, startSession, startSpan, startSpanManual, statsigIntegration, supabaseIntegration, suppressTracing, systemErrorIntegration, tediousIntegration, trpcMiddleware, unleashIntegration, updateSpanName, vercelAIIntegration, winterCGHeadersToDict, withActiveSpan, withIsolationScope, withMonitor, withScope, wrapMcpServerWithSentry, zodErrorsIntegration } from '@sentry/node';
2
2
  export { captureConsoleIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration } from '@sentry/core';
3
3
  export { getDefaultIntegrations, init } from './sdk.js';
4
4
  export { googleCloudHttpIntegration } from './integrations/google-cloud-http.js';
@@ -1 +1 @@
1
- {"version":3,"file":"google-cloud-grpc.js","sources":["../../../src/integrations/google-cloud-grpc.ts"],"sourcesContent":["import type { Client, IntegrationFn } from '@sentry/core';\nimport { defineIntegration, fill, getClient, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\nimport { startInactiveSpan } from '@sentry/node';\nimport type { EventEmitter } from 'events';\n\nexport interface GrpcFunction extends CallableFunction {\n (...args: unknown[]): EventEmitter;\n}\n\nexport interface GrpcFunctionObject extends GrpcFunction {\n requestStream: boolean;\n responseStream: boolean;\n originalName: string;\n}\n\ninterface StubOptions {\n servicePath?: string;\n}\n\ninterface CreateStubFunc extends CallableFunction {\n (createStub: unknown, options: StubOptions): PromiseLike<Stub>;\n}\n\nexport interface Stub {\n [key: string]: GrpcFunctionObject;\n}\n\nconst SERVICE_PATH_REGEX = /^(\\w+)\\.googleapis.com$/;\n\nconst INTEGRATION_NAME = 'GoogleCloudGrpc';\n\nconst SETUP_CLIENTS = new WeakMap<Client, boolean>();\n\nconst _googleCloudGrpcIntegration = ((options: { optional?: boolean } = {}) => {\n const optional = options.optional || false;\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const gaxModule = require('google-gax');\n fill(\n gaxModule.GrpcClient.prototype, // eslint-disable-line @typescript-eslint/no-unsafe-member-access\n 'createStub',\n wrapCreateStub,\n );\n } catch (e) {\n if (!optional) {\n throw e;\n }\n }\n },\n setup(client) {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Google Cloud Platform service requests tracking for GRPC APIs.\n */\nexport const googleCloudGrpcIntegration = defineIntegration(_googleCloudGrpcIntegration);\n\n/** Returns a wrapped function that returns a stub with tracing enabled */\nfunction wrapCreateStub(origCreate: CreateStubFunc): CreateStubFunc {\n return async function (this: unknown, ...args: Parameters<CreateStubFunc>) {\n const servicePath = args[1]?.servicePath;\n if (servicePath == null || servicePath == undefined) {\n return origCreate.apply(this, args);\n }\n const serviceIdentifier = identifyService(servicePath);\n const stub = await origCreate.apply(this, args);\n for (const methodName of Object.keys(Object.getPrototypeOf(stub))) {\n fillGrpcFunction(stub, serviceIdentifier, methodName);\n }\n return stub;\n };\n}\n\n/** Patches the function in grpc stub to enable tracing */\nexport function fillGrpcFunction(stub: Stub, serviceIdentifier: string, methodName: string): void {\n const funcObj = stub[methodName];\n if (typeof funcObj !== 'function') {\n return;\n }\n const callType =\n !funcObj.requestStream && !funcObj.responseStream\n ? 'unary call'\n : funcObj.requestStream && !funcObj.responseStream\n ? 'client stream'\n : !funcObj.requestStream && funcObj.responseStream\n ? 'server stream'\n : 'bidi stream';\n if (callType != 'unary call') {\n return;\n }\n fill(\n stub,\n methodName,\n (orig: GrpcFunction): GrpcFunction =>\n (...args) => {\n const ret = orig.apply(stub, args);\n if (typeof ret?.on !== 'function' || !SETUP_CLIENTS.has(getClient() as Client)) {\n return ret;\n }\n const span = startInactiveSpan({\n name: `${callType} ${methodName}`,\n onlyIfParent: true,\n op: `grpc.${serviceIdentifier}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.grpc.serverless',\n },\n });\n ret.on('status', () => {\n if (span) {\n span.end();\n }\n });\n return ret;\n },\n );\n}\n\n/** Identifies service by its address */\nfunction identifyService(servicePath: string): string {\n const match = servicePath.match(SERVICE_PATH_REGEX);\n return match?.[1] || servicePath;\n}\n"],"names":[],"mappings":";;;AA2BA,MAAM,kBAAA,GAAqB,yBAAyB;;AAEpD,MAAM,gBAAA,GAAmB,iBAAiB;;AAE1C,MAAM,aAAA,GAAgB,IAAI,OAAO,EAAmB;;AAEpD,MAAM,2BAAA,IAA+B,CAAC,OAAO,GAA2B,EAAE,KAAK;AAC/E,EAAE,MAAM,QAAA,GAAW,OAAO,CAAC,QAAA,IAAY,KAAK;AAC5C,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,IAAI;AACV;AACA,QAAQ,MAAM,SAAA,GA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,MAAA,KAAA,GAAA,WAAA,CAAA,KAAA,CAAA,kBAAA,CAAA;AACA,EAAA,OAAA,KAAA,GAAA,CAAA,CAAA,IAAA,WAAA;AACA;;;;"}
1
+ {"version":3,"file":"google-cloud-grpc.js","sources":["../../../src/integrations/google-cloud-grpc.ts"],"sourcesContent":["import type { Client, IntegrationFn } from '@sentry/core';\nimport { defineIntegration, fill, getClient, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\nimport { startInactiveSpan } from '@sentry/node';\nimport type { EventEmitter } from 'events';\n\nexport interface GrpcFunction extends CallableFunction {\n (...args: unknown[]): EventEmitter;\n}\n\nexport interface GrpcFunctionObject extends GrpcFunction {\n requestStream: boolean;\n responseStream: boolean;\n originalName: string;\n}\n\ninterface StubOptions {\n servicePath?: string;\n}\n\ninterface CreateStubFunc extends CallableFunction {\n (createStub: unknown, options: StubOptions): PromiseLike<Stub>;\n}\n\nexport interface Stub {\n [key: string]: GrpcFunctionObject;\n}\n\nconst SERVICE_PATH_REGEX = /^(\\w+)\\.googleapis.com$/;\n\nconst INTEGRATION_NAME = 'GoogleCloudGrpc';\n\nconst SETUP_CLIENTS = new WeakMap<Client, boolean>();\n\nconst _googleCloudGrpcIntegration = ((options: { optional?: boolean } = {}) => {\n const optional = options.optional || false;\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const gaxModule = require('google-gax');\n fill(\n gaxModule.GrpcClient.prototype, // eslint-disable-line @typescript-eslint/no-unsafe-member-access\n 'createStub',\n wrapCreateStub,\n );\n } catch (e) {\n if (!optional) {\n throw e;\n }\n }\n },\n setup(client) {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Google Cloud Platform service requests tracking for GRPC APIs.\n */\nexport const googleCloudGrpcIntegration = defineIntegration(_googleCloudGrpcIntegration);\n\n/** Returns a wrapped function that returns a stub with tracing enabled */\nfunction wrapCreateStub(origCreate: CreateStubFunc): CreateStubFunc {\n return async function (this: unknown, ...args: Parameters<CreateStubFunc>) {\n const servicePath = args[1]?.servicePath;\n if (servicePath == null || servicePath == undefined) {\n return origCreate.apply(this, args);\n }\n const serviceIdentifier = identifyService(servicePath);\n const stub = await origCreate.apply(this, args);\n for (const methodName of Object.keys(Object.getPrototypeOf(stub))) {\n fillGrpcFunction(stub, serviceIdentifier, methodName);\n }\n return stub;\n };\n}\n\n/** Patches the function in grpc stub to enable tracing */\nexport function fillGrpcFunction(stub: Stub, serviceIdentifier: string, methodName: string): void {\n const funcObj = stub[methodName];\n if (typeof funcObj !== 'function') {\n return;\n }\n const callType =\n !funcObj.requestStream && !funcObj.responseStream\n ? 'unary call'\n : funcObj.requestStream && !funcObj.responseStream\n ? 'client stream'\n : !funcObj.requestStream && funcObj.responseStream\n ? 'server stream'\n : 'bidi stream';\n if (callType != 'unary call') {\n return;\n }\n fill(\n stub,\n methodName,\n (orig: GrpcFunction): GrpcFunction =>\n (...args) => {\n const ret = orig.apply(stub, args);\n if (typeof ret?.on !== 'function' || !SETUP_CLIENTS.has(getClient() as Client)) {\n return ret;\n }\n const span = startInactiveSpan({\n name: `${callType} ${methodName}`,\n onlyIfParent: true,\n op: `grpc.${serviceIdentifier}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.grpc.serverless',\n },\n });\n ret.on('status', () => {\n if (span) {\n span.end();\n }\n });\n return ret;\n },\n );\n}\n\n/** Identifies service by its address */\nfunction identifyService(servicePath: string): string {\n const match = servicePath.match(SERVICE_PATH_REGEX);\n return match?.[1] || servicePath;\n}\n"],"names":[],"mappings":";;;AA2BA,MAAM,kBAAA,GAAqB,yBAAyB;;AAEpD,MAAM,gBAAA,GAAmB,iBAAiB;;AAE1C,MAAM,aAAA,GAAgB,IAAI,OAAO,EAAmB;;AAEpD,MAAM,2BAAA,IAA+B,CAAC,OAAO,GAA2B,EAAE,KAAK;AAC/E,EAAE,MAAM,QAA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QAAA,GAAA,CAAA,EAAA,CAAA,QAAA,EAAA,MAAA;AACA,UAAA,IAAA,IAAA,EAAA;AACA,YAAA,IAAA,CAAA,GAAA,EAAA;AACA,UAAA;AACA,QAAA,CAAA,CAAA;AACA,QAAA,OAAA,GAAA;AACA,MAAA,CAAA;AACA,GAAA;AACA;;AAEA;AACA,SAAA,eAAA,CAAA,WAAA,EAAA;AACA,EAAA,MAAA,KAAA,GAAA,WAAA,CAAA,KAAA,CAAA,kBAAA,CAAA;AACA,EAAA,OAAA,KAAA,GAAA,CAAA,CAAA,IAAA,WAAA;AACA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"google-cloud-http.js","sources":["../../../src/integrations/google-cloud-http.ts"],"sourcesContent":["import type * as common from '@google-cloud/common';\nimport type { Client, IntegrationFn } from '@sentry/core';\nimport {\n defineIntegration,\n fill,\n getClient,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n} from '@sentry/core';\nimport { startInactiveSpan } from '@sentry/node';\n\ntype RequestOptions = common.DecorateRequestOptions;\ntype ResponseCallback = common.BodyResponseCallback;\n// This interace could be replaced with just type alias once the `strictBindCallApply` mode is enabled.\ninterface RequestFunction extends CallableFunction {\n (reqOpts: RequestOptions, callback: ResponseCallback): void;\n}\n\nconst INTEGRATION_NAME = 'GoogleCloudHttp';\n\nconst SETUP_CLIENTS = new WeakMap<Client, boolean>();\n\nconst _googleCloudHttpIntegration = ((options: { optional?: boolean } = {}) => {\n const optional = options.optional || false;\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const commonModule = require('@google-cloud/common') as typeof common;\n fill(commonModule.Service.prototype, 'request', wrapRequestFunction);\n } catch (e) {\n if (!optional) {\n throw e;\n }\n }\n },\n setup(client) {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Google Cloud Platform service requests tracking for RESTful APIs.\n */\nexport const googleCloudHttpIntegration = defineIntegration(_googleCloudHttpIntegration);\n\n/** Returns a wrapped function that makes a request with tracing enabled */\nfunction wrapRequestFunction(orig: RequestFunction): RequestFunction {\n return function (this: common.Service, reqOpts: RequestOptions, callback: ResponseCallback): void {\n const httpMethod = reqOpts.method || 'GET';\n const span = SETUP_CLIENTS.has(getClient() as Client)\n ? startInactiveSpan({\n name: `${httpMethod} ${reqOpts.uri}`,\n onlyIfParent: true,\n op: `http.client.${identifyService(this.apiEndpoint)}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.serverless',\n },\n })\n : new SentryNonRecordingSpan();\n orig.call(this, reqOpts, (...args: Parameters<ResponseCallback>) => {\n span.end();\n callback(...args);\n });\n };\n}\n\n/** Identifies service by its base url */\nfunction identifyService(apiEndpoint: string): string {\n const match = apiEndpoint.match(/^https:\\/\\/(\\w+)\\.googleapis.com$/);\n return match?.[1] || apiEndpoint.replace(/^(http|https)?:\\/\\//, '');\n}\n"],"names":[],"mappings":";;;AAkBA,MAAM,gBAAA,GAAmB,iBAAiB;;AAE1C,MAAM,aAAA,GAAgB,IAAI,OAAO,EAAmB;;AAEpD,MAAM,2BAAA,IAA+B,CAAC,OAAO,GAA2B,EAAE,KAAK;AAC/E,EAAE,MAAM,QAAA,GAAW,OAAO,CAAC,QAAA,IAAY,KAAK;AAC5C,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,IAAI;AACV;AACA,QAAQ,MAAM,YAAA,GAAe,OAAO,CAAC,sBAAsB,CAAA;AAC3D,QAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,mBAAmB,CAAC;AAC5E,OAAM,CAAE,OAAO,CAAC,EAAE;AAClB,QAAQ,IAAI,CAAC,QAAQ,EAAE;AACvB,UAAU,MAAM,CAAC;AACjB;AACA;AACA,KAAK;AACL,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;AACrC,KAAK;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;MACa,0BAAA,GAA6B,iBAAiB,CAAC,2BAA2B;;AAEvF;AACA,SAAS,mBAAmB,CAAC,IAAI,EAAoC;AACrE,EAAE,OAAO,WAAgC,OAAO,EAAkB,QAAQ,EAA0B;AACpG,IAAI,MAAM,UAAA,GAAa,OAAO,CAAC,MAAA,IAAU,KAAK;AAC9C,IAAI,MAAM,OAAO,aAAa,CAAC,GAAG,CAAC,SAAS,EAAC;AAC7C,QAAQ,iBAAiB,CAAC;AAC1B,UAAU,IAAI,EAAE,CAAC,EAAA,UAAA,CAAA,CAAA,EAAA,OAAA,CAAA,GAAA,CAAA,CAAA;AACA,UAAA,YAAA,EAAA,IAAA;AACA,UAAA,EAAA,EAAA,CAAA,YAAA,EAAA,eAAA,CAAA,IAAA,CAAA,WAAA,CAAA,CAAA,CAAA;AACA,UAAA,UAAA,EAAA;AACA,YAAA,CAAA,gCAAA,GAAA,sBAAA;AACA,WAAA;AACA,SAAA;AACA,QAAA,IAAA,sBAAA,EAAA;AACA,IAAA,IAAA,CAAA,IAAA,CAAA,IAAA,EAAA,OAAA,EAAA,CAAA,GAAA,IAAA,KAAA;AACA,MAAA,IAAA,CAAA,GAAA,EAAA;AACA,MAAA,QAAA,CAAA,GAAA,IAAA,CAAA;AACA,KAAA,CAAA;AACA,GAAA;AACA;;AAEA;AACA,SAAA,eAAA,CAAA,WAAA,EAAA;AACA,EAAA,MAAA,KAAA,GAAA,WAAA,CAAA,KAAA,CAAA,mCAAA,CAAA;AACA,EAAA,OAAA,KAAA,GAAA,CAAA,CAAA,IAAA,WAAA,CAAA,OAAA,CAAA,qBAAA,EAAA,EAAA,CAAA;AACA;;;;"}
1
+ {"version":3,"file":"google-cloud-http.js","sources":["../../../src/integrations/google-cloud-http.ts"],"sourcesContent":["import type * as common from '@google-cloud/common';\nimport type { Client, IntegrationFn } from '@sentry/core';\nimport {\n defineIntegration,\n fill,\n getClient,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n} from '@sentry/core';\nimport { startInactiveSpan } from '@sentry/node';\n\ntype RequestOptions = common.DecorateRequestOptions;\ntype ResponseCallback = common.BodyResponseCallback;\n// This interace could be replaced with just type alias once the `strictBindCallApply` mode is enabled.\ninterface RequestFunction extends CallableFunction {\n (reqOpts: RequestOptions, callback: ResponseCallback): void;\n}\n\nconst INTEGRATION_NAME = 'GoogleCloudHttp';\n\nconst SETUP_CLIENTS = new WeakMap<Client, boolean>();\n\nconst _googleCloudHttpIntegration = ((options: { optional?: boolean } = {}) => {\n const optional = options.optional || false;\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n try {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const commonModule = require('@google-cloud/common') as typeof common;\n fill(commonModule.Service.prototype, 'request', wrapRequestFunction);\n } catch (e) {\n if (!optional) {\n throw e;\n }\n }\n },\n setup(client) {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Google Cloud Platform service requests tracking for RESTful APIs.\n */\nexport const googleCloudHttpIntegration = defineIntegration(_googleCloudHttpIntegration);\n\n/** Returns a wrapped function that makes a request with tracing enabled */\nfunction wrapRequestFunction(orig: RequestFunction): RequestFunction {\n return function (this: common.Service, reqOpts: RequestOptions, callback: ResponseCallback): void {\n const httpMethod = reqOpts.method || 'GET';\n const span = SETUP_CLIENTS.has(getClient() as Client)\n ? startInactiveSpan({\n name: `${httpMethod} ${reqOpts.uri}`,\n onlyIfParent: true,\n op: `http.client.${identifyService(this.apiEndpoint)}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.serverless',\n },\n })\n : new SentryNonRecordingSpan();\n orig.call(this, reqOpts, (...args: Parameters<ResponseCallback>) => {\n span.end();\n callback(...args);\n });\n };\n}\n\n/** Identifies service by its base url */\nfunction identifyService(apiEndpoint: string): string {\n const match = apiEndpoint.match(/^https:\\/\\/(\\w+)\\.googleapis.com$/);\n return match?.[1] || apiEndpoint.replace(/^(http|https)?:\\/\\//, '');\n}\n"],"names":[],"mappings":";;;AAkBA,MAAM,gBAAA,GAAmB,iBAAiB;;AAE1C,MAAM,aAAA,GAAgB,IAAI,OAAO,EAAmB;;AAEpD,MAAM,2BAAA,IAA+B,CAAC,OAAO,GAA2B,EAAE,KAAK;AAC/E,EAAE,MAAM,QAAA,GAAW,OAAO,CAAC,QAAA,IAAY,KAAK;AAC5C,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,IAAI;AACV;AACA,QAAQ,MAAM,YAAA,GAAe,OAAO,CAAC,sBAAsB,CAAA;AAC3D,QAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,mBAAmB,CAAC;AAC5E,MAAM,CAAA,CAAE,OAAO,CAAC,EAAE;AAClB,QAAQ,IAAI,CAAC,QAAQ,EAAE;AACvB,UAAU,MAAM,CAAC;AACjB,QAAQ;AACR,MAAM;AACN,IAAI,CAAC;AACL,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC;AACrC,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;MACa,0BAAA,GAA6B,iBAAiB,CAAC,2BAA2B;;AAEvF;AACA,SAAS,mBAAmB,CAAC,IAAI,EAAoC;AACrE,EAAE,OAAO,WAAgC,OAAO,EAAkB,QAAQ,EAA0B;AACpG,IAAI,MAAM,UAAA,GAAa,OAAO,CAAC,MAAA,IAAU,KAAK;AAC9C,IAAI,MAAM,OAAO,aAAa,CAAC,GAAG,CAAC,SAAS,EAAC;AAC7C,QAAQ,iBAAiB,CAAC;AAC1B,UAAU,IAAI,EAAE,CAAC,EAAA,UAAA,CAAA,CAAA,EAAA,OAAA,CAAA,GAAA,CAAA,CAAA;AACA,UAAA,YAAA,EAAA,IAAA;AACA,UAAA,EAAA,EAAA,CAAA,YAAA,EAAA,eAAA,CAAA,IAAA,CAAA,WAAA,CAAA,CAAA,CAAA;AACA,UAAA,UAAA,EAAA;AACA,YAAA,CAAA,gCAAA,GAAA,sBAAA;AACA,WAAA;AACA,SAAA;AACA,QAAA,IAAA,sBAAA,EAAA;AACA,IAAA,IAAA,CAAA,IAAA,CAAA,IAAA,EAAA,OAAA,EAAA,CAAA,GAAA,IAAA,KAAA;AACA,MAAA,IAAA,CAAA,GAAA,EAAA;AACA,MAAA,QAAA,CAAA,GAAA,IAAA,CAAA;AACA,IAAA,CAAA,CAAA;AACA,EAAA,CAAA;AACA;;AAEA;AACA,SAAA,eAAA,CAAA,WAAA,EAAA;AACA,EAAA,MAAA,KAAA,GAAA,WAAA,CAAA,KAAA,CAAA,mCAAA,CAAA;AACA,EAAA,OAAA,KAAA,GAAA,CAAA,CAAA,IAAA,WAAA,CAAA,OAAA,CAAA,qBAAA,EAAA,EAAA,CAAA;AACA;;;;"}
@@ -1 +1 @@
1
- {"type":"module","version":"10.23.0","sideEffects":false}
1
+ {"type":"module","version":"10.25.0","sideEffects":false}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../src/utils.ts"],"sourcesContent":["import type { Scope } from '@sentry/core';\nimport { addExceptionMechanism, withIsolationScope } from '@sentry/core';\n\n/**\n * @param fn function to run\n * @returns function which runs in the newly created domain or in the existing one\n */\nexport function domainify<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R | void {\n return (...args) => withIsolationScope(() => fn(...args));\n}\n\n/**\n * @param source function to be wrapped\n * @param wrap wrapping function that takes source and returns a wrapper\n * @param overrides properties to override in the source\n * @returns wrapped function\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function proxyFunction<A extends any[], R, F extends (...args: A) => R>(\n source: F,\n wrap: (source: F) => F,\n overrides?: Record<PropertyKey, unknown>,\n): F {\n const wrapper = wrap(source);\n const handler: ProxyHandler<F> = {\n apply: <T>(_target: F, thisArg: T, args: A) => {\n return wrapper.apply(thisArg, args);\n },\n };\n\n if (overrides) {\n handler.get = (target, prop) => {\n if (Object.prototype.hasOwnProperty.call(overrides, prop)) {\n return overrides[prop as string];\n }\n return (target as Record<PropertyKey, unknown>)[prop as string];\n };\n }\n\n return new Proxy(source, handler);\n}\n\n/**\n * Marks an event as unhandled by adding a span processor to the passed scope.\n */\nexport function markEventUnhandled(scope: Scope, type: string): Scope {\n scope.addEventProcessor(event => {\n addExceptionMechanism(event, { handled: false, type });\n return event;\n });\n\n return scope;\n}\n"],"names":[],"mappings":";;AAGA;AACA;AACA;AACA;AACO,SAAS,SAAS,CAAyB,EAAE,EAA+C;AACnG,EAAE,OAAO,CAAC,GAAG,IAAI,KAAK,kBAAkB,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;AAC3D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa;AAC7B,EAAE,MAAM;AACR,EAAE,IAAI;AACN,EAAE,SAAS;AACX,EAAK;AACL,EAAE,MAAM,OAAA,GAAU,IAAI,CAAC,MAAM,CAAC;AAC9B,EAAE,MAAM,OAAO,GAAoB;AACnC,IAAI,KAAK,EAAE,CAAI,OAAO,EAAK,OAAO,EAAK,IAAI,KAAQ;AACnD,MAAM,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC;AACzC,KAAK;AACL,GAAG;;AAEH,EAAE,IAAI,SAAS,EAAE;AACjB,IAAI,OAAO,CAAC,GAAA,GAAM,CAAC,MAAM,EAAE,IAAI,KAAK;AACpC,MAAM,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,EAAE;AACjE,QAAQ,OAAO,SAAS,CAAC,IAAA,EAAe;AACxC;AACA,MAAM,OAAO,CAAC,MAAA,GAAwC,MAAe;AACrE,KAAK;AACL;;AAEA,EAAE,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC;AACnC;;AAEA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,KAAK,EAAS,IAAI,EAAiB;AACtE,EAAE,KAAK,CAAC,iBAAiB,CAAC,SAAS;AACnC,IAAI,qBAAqB,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,IAAA,EAAM,CAAC;AAC1D,IAAI,OAAO,KAAK;AAChB,GAAG,CAAC;;AAEJ,EAAE,OAAO,KAAK;AACd;;;;"}
1
+ {"version":3,"file":"utils.js","sources":["../../src/utils.ts"],"sourcesContent":["import type { Scope } from '@sentry/core';\nimport { addExceptionMechanism, withIsolationScope } from '@sentry/core';\n\n/**\n * @param fn function to run\n * @returns function which runs in the newly created domain or in the existing one\n */\nexport function domainify<A extends unknown[], R>(fn: (...args: A) => R): (...args: A) => R | void {\n return (...args) => withIsolationScope(() => fn(...args));\n}\n\n/**\n * @param source function to be wrapped\n * @param wrap wrapping function that takes source and returns a wrapper\n * @param overrides properties to override in the source\n * @returns wrapped function\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function proxyFunction<A extends any[], R, F extends (...args: A) => R>(\n source: F,\n wrap: (source: F) => F,\n overrides?: Record<PropertyKey, unknown>,\n): F {\n const wrapper = wrap(source);\n const handler: ProxyHandler<F> = {\n apply: <T>(_target: F, thisArg: T, args: A) => {\n return wrapper.apply(thisArg, args);\n },\n };\n\n if (overrides) {\n handler.get = (target, prop) => {\n if (Object.prototype.hasOwnProperty.call(overrides, prop)) {\n return overrides[prop as string];\n }\n return (target as Record<PropertyKey, unknown>)[prop as string];\n };\n }\n\n return new Proxy(source, handler);\n}\n\n/**\n * Marks an event as unhandled by adding a span processor to the passed scope.\n */\nexport function markEventUnhandled(scope: Scope, type: string): Scope {\n scope.addEventProcessor(event => {\n addExceptionMechanism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,OAAO,KAAK;AACd;;;;"}
@@ -1,4 +1,4 @@
1
- export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureCheckIn, captureFeedback, startSession, captureSession, endSession, withMonitor, createTransport, getClient, isInitialized, isEnabled, generateInstrumentOnce, getCurrentScope, getGlobalScope, getIsolationScope, getTraceData, getTraceMetaTags, setCurrentClient, Scope, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, makeNodeTransport, NodeClient, defaultStackParser, lastEventId, flush, close, getSentryRelease, createGetModuleFromFilename, createLangChainCallbackHandler, httpHeadersToSpanAttributes, winterCGHeadersToDict, anrIntegration, disableAnrDetectionForCallback, consoleIntegration, httpIntegration, httpServerIntegration, httpServerSpansIntegration, nativeNodeFetchIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, openAIIntegration, langChainIntegration, modulesIntegration, contextLinesIntegration, nodeContextIntegration, localVariablesIntegration, requestDataIntegration, fsIntegration, functionToStringIntegration, inboundFiltersIntegration, eventFiltersIntegration, linkedErrorsIntegration, setMeasurement, getActiveSpan, startSpan, startInactiveSpan, startSpanManual, startNewTrace, suppressTracing, withActiveSpan, getRootSpan, getSpanDescendants, continueTrace, getAutoPerformanceIntegrations, cron, parameterize, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, dataloaderIntegration, expressIntegration, expressErrorHandler, setupExpressErrorHandler, koaIntegration, setupKoaErrorHandler, connectIntegration, setupConnectErrorHandler, fastifyIntegration, firebaseIntegration, genericPoolIntegration, graphqlIntegration, knexIntegration, kafkaIntegration, lruMemoizerIntegration, mongoIntegration, mongooseIntegration, mysqlIntegration, mysql2Integration, redisIntegration, tediousIntegration, pinoIntegration, postgresIntegration, postgresJsIntegration, prismaIntegration, hapiIntegration, setupHapiErrorHandler, honoIntegration, setupHonoErrorHandler, spotlightIntegration, initOpenTelemetry, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, updateSpanName, supabaseIntegration, systemErrorIntegration, instrumentSupabaseClient, zodErrorsIntegration, profiler, amqplibIntegration, anthropicAIIntegration, googleGenAIIntegration, childProcessIntegration, createSentryWinstonTransport, vercelAIIntegration, logger, consoleLoggingIntegration, createConsolaReporter, wrapMcpServerWithSentry, NODE_VERSION, featureFlagsIntegration, type FeatureFlagsIntegration, launchDarklyIntegration, growthbookIntegration, buildLaunchDarklyFlagUsedHandler, openFeatureIntegration, OpenFeatureIntegrationHook, statsigIntegration, unleashIntegration, } from '@sentry/node';
1
+ export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureCheckIn, captureFeedback, startSession, captureSession, endSession, withMonitor, createTransport, getClient, isInitialized, isEnabled, generateInstrumentOnce, getCurrentScope, getGlobalScope, getIsolationScope, getTraceData, getTraceMetaTags, setCurrentClient, Scope, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, makeNodeTransport, NodeClient, defaultStackParser, lastEventId, flush, close, getSentryRelease, createGetModuleFromFilename, createLangChainCallbackHandler, httpHeadersToSpanAttributes, winterCGHeadersToDict, anrIntegration, disableAnrDetectionForCallback, consoleIntegration, httpIntegration, httpServerIntegration, httpServerSpansIntegration, nativeNodeFetchIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, openAIIntegration, langChainIntegration, modulesIntegration, contextLinesIntegration, nodeContextIntegration, localVariablesIntegration, requestDataIntegration, fsIntegration, functionToStringIntegration, inboundFiltersIntegration, eventFiltersIntegration, linkedErrorsIntegration, setMeasurement, getActiveSpan, startSpan, startInactiveSpan, startSpanManual, startNewTrace, suppressTracing, withActiveSpan, getRootSpan, getSpanDescendants, continueTrace, getAutoPerformanceIntegrations, cron, parameterize, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, dataloaderIntegration, expressIntegration, expressErrorHandler, setupExpressErrorHandler, koaIntegration, setupKoaErrorHandler, connectIntegration, setupConnectErrorHandler, fastifyIntegration, firebaseIntegration, genericPoolIntegration, graphqlIntegration, knexIntegration, kafkaIntegration, lruMemoizerIntegration, mongoIntegration, mongooseIntegration, mysqlIntegration, mysql2Integration, redisIntegration, tediousIntegration, pinoIntegration, postgresIntegration, postgresJsIntegration, prismaIntegration, hapiIntegration, setupHapiErrorHandler, honoIntegration, setupHonoErrorHandler, spotlightIntegration, initOpenTelemetry, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, updateSpanName, supabaseIntegration, systemErrorIntegration, instrumentSupabaseClient, zodErrorsIntegration, profiler, amqplibIntegration, anthropicAIIntegration, googleGenAIIntegration, childProcessIntegration, createSentryWinstonTransport, vercelAIIntegration, logger, consoleLoggingIntegration, createConsolaReporter, wrapMcpServerWithSentry, NODE_VERSION, featureFlagsIntegration, type FeatureFlagsIntegration, launchDarklyIntegration, growthbookIntegration, buildLaunchDarklyFlagUsedHandler, openFeatureIntegration, OpenFeatureIntegrationHook, statsigIntegration, unleashIntegration, metrics, } from '@sentry/node';
2
2
  export { captureConsoleIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration, } from '@sentry/core';
3
3
  export { getDefaultIntegrations, init } from './sdk';
4
4
  export { googleCloudHttpIntegration } from './integrations/google-cloud-http';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,YAAY,EACZ,cAAc,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B,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,QAAQ,EACR,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,4BAA4B,EAC5B,mBAAmB,EACnB,MAAM,EACN,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,YAAY,EACZ,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,gCAAgC,EAChC,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,EACf,YAAY,EACZ,cA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AAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,QAAQ,EACR,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,4BAA4B,EAC5B,mBAAmB,EACnB,MAAM,EACN,yBAAyB,EACzB,qBAAqB,EACrB,uBAAuB,EACvB,YAAY,EACZ,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,gCAAgC,EAChC,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,kBAAkB,EAClB,OAAO,GACR,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,yBAAyB,EACzB,iBAAiB,EACjB,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAE9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,4 +1,4 @@
1
- export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureCheckIn, captureFeedback, startSession, captureSession, endSession, withMonitor, createTransport, getClient, isInitialized, isEnabled, generateInstrumentOnce, getCurrentScope, getGlobalScope, getIsolationScope, getTraceData, getTraceMetaTags, setCurrentClient, Scope, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, makeNodeTransport, NodeClient, defaultStackParser, lastEventId, flush, close, getSentryRelease, createGetModuleFromFilename, createLangChainCallbackHandler, httpHeadersToSpanAttributes, winterCGHeadersToDict, anrIntegration, disableAnrDetectionForCallback, consoleIntegration, httpIntegration, httpServerIntegration, httpServerSpansIntegration, nativeNodeFetchIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, openAIIntegration, langChainIntegration, modulesIntegration, contextLinesIntegration, nodeContextIntegration, localVariablesIntegration, requestDataIntegration, fsIntegration, functionToStringIntegration, inboundFiltersIntegration, eventFiltersIntegration, linkedErrorsIntegration, setMeasurement, getActiveSpan, startSpan, startInactiveSpan, startSpanManual, startNewTrace, suppressTracing, withActiveSpan, getRootSpan, getSpanDescendants, continueTrace, getAutoPerformanceIntegrations, cron, parameterize, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, dataloaderIntegration, expressIntegration, expressErrorHandler, setupExpressErrorHandler, koaIntegration, setupKoaErrorHandler, connectIntegration, setupConnectErrorHandler, fastifyIntegration, firebaseIntegration, genericPoolIntegration, graphqlIntegration, knexIntegration, kafkaIntegration, lruMemoizerIntegration, mongoIntegration, mongooseIntegration, mysqlIntegration, mysql2Integration, redisIntegration, tediousIntegration, pinoIntegration, postgresIntegration, postgresJsIntegration, prismaIntegration, hapiIntegration, setupHapiErrorHandler, honoIntegration, setupHonoErrorHandler, spotlightIntegration, initOpenTelemetry, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, updateSpanName, supabaseIntegration, systemErrorIntegration, instrumentSupabaseClient, zodErrorsIntegration, profiler, amqplibIntegration, anthropicAIIntegration, googleGenAIIntegration, childProcessIntegration, createSentryWinstonTransport, vercelAIIntegration, logger, consoleLoggingIntegration, createConsolaReporter, wrapMcpServerWithSentry, NODE_VERSION, featureFlagsIntegration, FeatureFlagsIntegration, launchDarklyIntegration, growthbookIntegration, buildLaunchDarklyFlagUsedHandler, openFeatureIntegration, OpenFeatureIntegrationHook, statsigIntegration, unleashIntegration } from '@sentry/node';
1
+ export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureCheckIn, captureFeedback, startSession, captureSession, endSession, withMonitor, createTransport, getClient, isInitialized, isEnabled, generateInstrumentOnce, getCurrentScope, getGlobalScope, getIsolationScope, getTraceData, getTraceMetaTags, setCurrentClient, Scope, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, makeNodeTransport, NodeClient, defaultStackParser, lastEventId, flush, close, getSentryRelease, createGetModuleFromFilename, createLangChainCallbackHandler, httpHeadersToSpanAttributes, winterCGHeadersToDict, anrIntegration, disableAnrDetectionForCallback, consoleIntegration, httpIntegration, httpServerIntegration, httpServerSpansIntegration, nativeNodeFetchIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, openAIIntegration, langChainIntegration, modulesIntegration, contextLinesIntegration, nodeContextIntegration, localVariablesIntegration, requestDataIntegration, fsIntegration, functionToStringIntegration, inboundFiltersIntegration, eventFiltersIntegration, linkedErrorsIntegration, setMeasurement, getActiveSpan, startSpan, startInactiveSpan, startSpanManual, startNewTrace, suppressTracing, withActiveSpan, getRootSpan, getSpanDescendants, continueTrace, getAutoPerformanceIntegrations, cron, parameterize, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, dataloaderIntegration, expressIntegration, expressErrorHandler, setupExpressErrorHandler, koaIntegration, setupKoaErrorHandler, connectIntegration, setupConnectErrorHandler, fastifyIntegration, firebaseIntegration, genericPoolIntegration, graphqlIntegration, knexIntegration, kafkaIntegration, lruMemoizerIntegration, mongoIntegration, mongooseIntegration, mysqlIntegration, mysql2Integration, redisIntegration, tediousIntegration, pinoIntegration, postgresIntegration, postgresJsIntegration, prismaIntegration, hapiIntegration, setupHapiErrorHandler, honoIntegration, setupHonoErrorHandler, spotlightIntegration, initOpenTelemetry, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, updateSpanName, supabaseIntegration, systemErrorIntegration, instrumentSupabaseClient, zodErrorsIntegration, profiler, amqplibIntegration, anthropicAIIntegration, googleGenAIIntegration, childProcessIntegration, createSentryWinstonTransport, vercelAIIntegration, logger, consoleLoggingIntegration, createConsolaReporter, wrapMcpServerWithSentry, NODE_VERSION, featureFlagsIntegration, FeatureFlagsIntegration, launchDarklyIntegration, growthbookIntegration, buildLaunchDarklyFlagUsedHandler, openFeatureIntegration, OpenFeatureIntegrationHook, statsigIntegration, unleashIntegration, metrics } from '@sentry/node';
2
2
  export { captureConsoleIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration, } from '@sentry/core';
3
3
  export { getDefaultIntegrations, init } from './sdk';
4
4
  export { googleCloudHttpIntegration } from './integrations/google-cloud-http';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/google-cloud-serverless",
3
- "version": "10.23.0",
3
+ "version": "10.25.0",
4
4
  "description": "Official Sentry SDK for Google Cloud Functions",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/google-cloud-serverless",
@@ -48,8 +48,8 @@
48
48
  "access": "public"
49
49
  },
50
50
  "dependencies": {
51
- "@sentry/core": "10.23.0",
52
- "@sentry/node": "10.23.0",
51
+ "@sentry/core": "10.25.0",
52
+ "@sentry/node": "10.25.0",
53
53
  "@types/express": "^4.17.14"
54
54
  },
55
55
  "devDependencies": {