@sentry/google-cloud-serverless 9.13.0 → 9.15.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 { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, handleCallbackErrors } from '@sentry/core';\nimport { logger } from '@sentry/core';\nimport { captureException, flush, getCurrentScope, startSpanManual } from '@sentry/node';\n\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));\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 && logger.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));\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","logger","handleCallbackErrors"],"mappings":";;;;;;;AAUA;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,EAAE,0BAA0B;AACtC,QAAQ,UAAU,EAAE;AACpB,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AAC,EAAG,GAAuB,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 handleCallbackErrors,\n logger,\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));\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 && logger.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));\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","logger","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,I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;AACX;;AAEA,QAAQ,OAAO,OAAO,CAAC,OAAO;AAC9B,WAAW,IAAI,CAAC,MAAM,CAAC,EAAG,GAAuB,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 +1 @@
1
- {"version":3,"file":"events.js","sources":["../../../src/gcpfunction/events.ts"],"sourcesContent":["import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, handleCallbackErrors } from '@sentry/core';\nimport { logger } from '@sentry/core';\nimport { captureException, flush, getCurrentScope, startSpanManual } from '@sentry/node';\n\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));\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 && logger.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));\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","logger","handleCallbackErrors"],"mappings":";;;;;;;AAUA;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,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,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C,YAAY,MAAM,CAAC,EAAG,GAA8B,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC;AAC/E,YAAY,OAAO;AACnB,cAAcL,qBAAgB,CAAC,GAAG,EAAE,KAAA,IAASC,wBAAkB,CAAC,KAAK,CAAC,CAAC;AACvE,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 handleCallbackErrors,\n logger,\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));\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 && logger.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));\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","logger","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,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC;AAC9E;;AAEA;AACA,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I,UAAU,EAAE;AAClD,gBAAgB,QAAQ,CAAC,GAAG,IAAI,CAAC;AACjC;AACA,aAAa,CAAC;AACd,SAAS,CAAC;;AAEV,QAAQ,IAAI,EAAE,CAAC,MAAO,GAAE,CAAC,EAAE;AAC3B,UAAU,OAAOC,yBAAoB;AACrC,YAAY,MAAM,CAAC,EAAG,GAA8B,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC;AAC/E,YAAY,OAAO;AACnB,cAAcL,qBAAgB,CAAC,GAAG,EAAE,KAAA,IAASC,wBAAkB,CAAC,KAAK,CAAC,CAAC;AACvE,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 +1 @@
1
- {"version":3,"file":"http.js","sources":["../../../src/gcpfunction/http.ts"],"sourcesContent":["import {\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n handleCallbackErrors,\n httpRequestToRequestData,\n isString,\n logger,\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 && logger.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));\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","logger","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,EAAG,GAAsD,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,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,MAAO,IAAG,EAAE,EAAE,WAAW,EAAE;AACtD,IAAI,MAAM,MAAA,GAASC,6BAAwB,CAAC,GAAG,CAAC,WAAY,IAAG,GAAG,CAAC,GAAI,IAAG,EAAE,CAAC;;AAE7E,IAAI,MAAM,WAAY,GAAE,GAAG,CAAC,WAAWC,aAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAE,GAAE,GAAG,CAAC,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A;AACA,cAAAC,qBAAA,CAAA,GAAA,EAAA,KAAA,IAAAC,wBAAA,CAAA,KAAA,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 handleCallbackErrors,\n httpRequestToRequestData,\n isString,\n logger,\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 && logger.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));\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","logger","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,EA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C,qCAAA,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,YAAAC,kBAAA,CAAA,IAAA,EAAA,GAAA,CAAA,UAAA,CAAA;AACA,YAAA,IAAA,CAAA,GAAA,EAAA;;AAEA;AACA,YAAAC,UAAA,CAAA,YAAA;AACA,eAAA,IAAA,CAAA,IAAA,EAAA,CAAA,IAAA;AACA,gBAAAC,sBAAA,IAAAC,WAAA,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,CAAA,CAAA;AACA,aAAA;AACA,WAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA,GAAA;AACA;;;;"}
@@ -70,6 +70,7 @@ exports.hapiIntegration = node.hapiIntegration;
70
70
  exports.httpIntegration = node.httpIntegration;
71
71
  exports.inboundFiltersIntegration = node.inboundFiltersIntegration;
72
72
  exports.initOpenTelemetry = node.initOpenTelemetry;
73
+ exports.instrumentSupabaseClient = node.instrumentSupabaseClient;
73
74
  exports.isInitialized = node.isInitialized;
74
75
  exports.kafkaIntegration = node.kafkaIntegration;
75
76
  exports.knexIntegration = node.knexIntegration;
@@ -117,6 +118,7 @@ exports.startNewTrace = node.startNewTrace;
117
118
  exports.startSession = node.startSession;
118
119
  exports.startSpan = node.startSpan;
119
120
  exports.startSpanManual = node.startSpanManual;
121
+ exports.supabaseIntegration = node.supabaseIntegration;
120
122
  exports.suppressTracing = node.suppressTracing;
121
123
  exports.tediousIntegration = node.tediousIntegration;
122
124
  exports.trpcMiddleware = node.trpcMiddleware;
@@ -126,6 +128,7 @@ exports.withActiveSpan = node.withActiveSpan;
126
128
  exports.withIsolationScope = node.withIsolationScope;
127
129
  exports.withMonitor = node.withMonitor;
128
130
  exports.withScope = node.withScope;
131
+ exports.wrapMcpServerWithSentry = node.wrapMcpServerWithSentry;
129
132
  exports.zodErrorsIntegration = node.zodErrorsIntegration;
130
133
  exports.captureConsoleIntegration = core.captureConsoleIntegration;
131
134
  exports.dedupeIntegration = core.dedupeIntegration;
@@ -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 { EventEmitter } from 'events';\nimport type { Client, IntegrationFn } from '@sentry/core';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, defineIntegration, fill, getClient } from '@sentry/core';\nimport { startInactiveSpan } from '@sentry/node';\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,aAAc,GAAE,IAAI,OAAO,EAAmB;;AAEpD,MAAM,2BAAA,IAA+B,CAAC,OAAO,GAA2B,EAAE,KAAK;AAC/E,EAAE,MAAM,QAAS,GAAE,OAAO,CAAC,QAAA,IAAY,KAAK;AAC5C,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,IAAI;AACV;AACA,QAAQ,MAAM,SAAU,GAAE,OAAO,CAAC,YAAY,CAAC;AAC/C,QAAQA,SAAI;AACZ,UAAU,SAAS,CAAC,UAAU,CAAC,SAAS;AACxC,UAAU,YAAY;AACtB,UAAU,cAAc;AACxB,SAAS;AACT,OAAQ,CAAA,OAAO,CAAC,EAAE;AAClB,QAAQ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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,aAAc,GAAE,IAAI,OAAO,EAAmB;;AAEpD,MAAM,2BAAA,IAA+B,CAAC,OAAO,GAA2B,EAAE,KAAK;AAC/E,EAAE,MAAM,QAAS,GAAE,OAAO,CAAC,QAAA,IAAY,KAAK;AAC5C,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,G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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 SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n defineIntegration,\n fill,\n getClient,\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,aAAc,GAAE,IAAI,OAAO,EAAmB;;AAEpD,MAAM,2BAAA,IAA+B,CAAC,OAAO,GAA2B,EAAE,KAAK;AAC/E,EAAE,MAAM,QAAS,GAAE,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,CAAE;AAC7D,QAAQA,SAAI,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,mBAAmB,CAAC;AAC5E,OAAQ,CAAA,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,CAAE;;AAEH;AACA;AACA;MACa,0BAA2B,GAAEC,sBAAiB,CAAC,2BAA2B;;AAEvF;AACA,SAAS,mBAAmB,CAAC,IAAI,EAAoC;AACrE,EAAE,OAAO,WAAgC,OAAO,EAAkB,QAAQ,EAA0B;AACpG,IAAI,MAAM,UAAW,GAAE,OAAO,CAAC,MAAA,IAAU,KAAK;AAC9C,IAAI,MAAM,OAAO,aAAa,CAAC,GAAG,CAACC,cAAS,EAAG;AAC/C,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,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":["fill","defineIntegration","getClient","startInactiveSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SentryNonRecordingSpan"],"mappings":";;;;;AAkBA,MAAM,gBAAA,GAAmB,iBAAiB;;AAE1C,MAAM,aAAc,GAAE,IAAI,OAAO,EAAmB;;AAEpD,MAAM,2BAAA,IAA+B,CAAC,OAAO,GAA2B,EAAE,KAAK;AAC/E,EAAE,MAAM,QAAS,GAAE,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,CAAE;AAC7D,QAAQA,SAAI,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,mBAAmB,CAAC;AAC5E,OAAQ,CAAA,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,CAAE;;AAEH;AACA;AACA;MACa,0BAA2B,GAAEC,sBAAiB,CAAC,2BAA2B;;AAEvF;AACA,SAAS,mBAAmB,CAAC,IAAI,EAAoC;AACrE,EAAE,OAAO,WAAgC,OAAO,EAAkB,QAAQ,EAA0B;AACpG,IAAI,MAAM,UAAW,GAAE,OAAO,CAAC,MAAA,IAAU,KAAK;AAC9C,IAAI,MAAM,OAAO,aAAa,CAAC,GAAG,CAACC,cAAS,EAAG;AAC/C,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,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 +1 @@
1
- {"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import type { Integration, Options } from '@sentry/core';\nimport { applySdkMetadata } from '@sentry/core';\nimport type { NodeClient, NodeOptions } from '@sentry/node';\nimport { getDefaultIntegrationsWithoutPerformance, init as initNode } from '@sentry/node';\n\nimport { googleCloudGrpcIntegration } from './integrations/google-cloud-grpc';\nimport { googleCloudHttpIntegration } from './integrations/google-cloud-http';\n\nfunction isCjs(): boolean {\n return typeof require !== 'undefined';\n}\n\nfunction getCjsOnlyIntegrations(): Integration[] {\n return isCjs()\n ? [\n googleCloudHttpIntegration({ optional: true }), // We mark this integration optional since '@google-cloud/common' module could be missing.\n googleCloudGrpcIntegration({ optional: true }), // We mark this integration optional since 'google-gax' module could be missing.\n ]\n : [];\n}\n\n/** Get the default integrations for the GCP SDK. */\nexport function getDefaultIntegrations(_options: Options): Integration[] {\n return [...getDefaultIntegrationsWithoutPerformance(), ...getCjsOnlyIntegrations()];\n}\n\n/**\n * @see {@link Sentry.init}\n */\nexport function init(options: NodeOptions = {}): NodeClient | undefined {\n const opts = {\n defaultIntegrations: getDefaultIntegrations(options),\n ...options,\n };\n\n applySdkMetadata(opts, 'google-cloud-serverless');\n\n return initNode(opts);\n}\n"],"names":["googleCloudHttpIntegration","googleCloudGrpcIntegration","getDefaultIntegrationsWithoutPerformance","applySdkMetadata","initNode"],"mappings":";;;;;;;AAQA,SAAS,KAAK,GAAY;AAC1B,EAAE,OAAO,OAAO,OAAQ,KAAI,WAAW;AACvC;;AAEA,SAAS,sBAAsB,GAAkB;AACjD,EAAE,OAAO,KAAK;AACd,MAAM;AACN,QAAQA,0CAA0B,CAAC,EAAE,QAAQ,EAAE,IAAA,EAAM,CAAC;AACtD,QAAQC,0CAA0B,CAAC,EAAE,QAAQ,EAAE,IAAA,EAAM,CAAC;AACtD;AACA,MAAM,EAAE;AACR;;AAEA;AACO,SAAS,sBAAsB,CAAC,QAAQ,EAA0B;AACzE,EAAE,OAAO,CAAC,GAAGC,6CAAwC,EAAE,EAAE,GAAG,sBAAsB,EAAE,CAAC;AACrF;;AAEA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,GAAgB,EAAE,EAA0B;AACxE,EAAE,MAAM,OAAO;AACf,IAAI,mBAAmB,EAAE,sBAAsB,CAAQ,CAAC;AACxD,IAAI,GAAG,OAAO;AACd,GAAG;;AAEH,EAAEC,qBAAgB,CAAC,IAAI,EAAE,yBAAyB,CAAC;;AAEnD,EAAE,OAAOC,SAAQ,CAAC,IAAI,CAAC;AACvB;;;;;"}
1
+ {"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import type { Integration, Options } from '@sentry/core';\nimport { applySdkMetadata } from '@sentry/core';\nimport type { NodeClient, NodeOptions } from '@sentry/node';\nimport { getDefaultIntegrationsWithoutPerformance, init as initNode } from '@sentry/node';\nimport { googleCloudGrpcIntegration } from './integrations/google-cloud-grpc';\nimport { googleCloudHttpIntegration } from './integrations/google-cloud-http';\n\nfunction isCjs(): boolean {\n return typeof require !== 'undefined';\n}\n\nfunction getCjsOnlyIntegrations(): Integration[] {\n return isCjs()\n ? [\n googleCloudHttpIntegration({ optional: true }), // We mark this integration optional since '@google-cloud/common' module could be missing.\n googleCloudGrpcIntegration({ optional: true }), // We mark this integration optional since 'google-gax' module could be missing.\n ]\n : [];\n}\n\n/** Get the default integrations for the GCP SDK. */\nexport function getDefaultIntegrations(_options: Options): Integration[] {\n return [...getDefaultIntegrationsWithoutPerformance(), ...getCjsOnlyIntegrations()];\n}\n\n/**\n * @see {@link Sentry.init}\n */\nexport function init(options: NodeOptions = {}): NodeClient | undefined {\n const opts = {\n defaultIntegrations: getDefaultIntegrations(options),\n ...options,\n };\n\n applySdkMetadata(opts, 'google-cloud-serverless');\n\n return initNode(opts);\n}\n"],"names":["googleCloudHttpIntegration","googleCloudGrpcIntegration","getDefaultIntegrationsWithoutPerformance","applySdkMetadata","initNode"],"mappings":";;;;;;;AAOA,SAAS,KAAK,GAAY;AAC1B,EAAE,OAAO,OAAO,OAAQ,KAAI,WAAW;AACvC;;AAEA,SAAS,sBAAsB,GAAkB;AACjD,EAAE,OAAO,KAAK;AACd,MAAM;AACN,QAAQA,0CAA0B,CAAC,EAAE,QAAQ,EAAE,IAAA,EAAM,CAAC;AACtD,QAAQC,0CAA0B,CAAC,EAAE,QAAQ,EAAE,IAAA,EAAM,CAAC;AACtD;AACA,MAAM,EAAE;AACR;;AAEA;AACO,SAAS,sBAAsB,CAAC,QAAQ,EAA0B;AACzE,EAAE,OAAO,CAAC,GAAGC,6CAAwC,EAAE,EAAE,GAAG,sBAAsB,EAAE,CAAC;AACrF;;AAEA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,GAAgB,EAAE,EAA0B;AACxE,EAAE,MAAM,OAAO;AACf,IAAI,mBAAmB,EAAE,sBAAsB,CAAQ,CAAC;AACxD,IAAI,GAAG,OAAO;AACd,GAAG;;AAEH,EAAEC,qBAAgB,CAAC,IAAI,EAAE,yBAAyB,CAAC;;AAEnD,EAAE,OAAOC,SAAQ,CAAC,IAAI,CAAC;AACvB;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"cloud_events.js","sources":["../../../src/gcpfunction/cloud_events.ts"],"sourcesContent":["import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, handleCallbackErrors } from '@sentry/core';\nimport { logger } from '@sentry/core';\nimport { captureException, flush, getCurrentScope, startSpanManual } from '@sentry/node';\n\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));\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 && logger.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));\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":";;;;;AAUA;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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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 handleCallbackErrors,\n logger,\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));\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 && logger.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));\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,eAAe,EAAE;AACvC,QAAQ,KAAK,CAAC,UAAU,CAAC,sBAAsB,EAAE,EAAE,GAAG,OAAQ,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file":"events.js","sources":["../../../src/gcpfunction/events.ts"],"sourcesContent":["import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, handleCallbackErrors } from '@sentry/core';\nimport { logger } from '@sentry/core';\nimport { captureException, flush, getCurrentScope, startSpanManual } from '@sentry/node';\n\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));\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 && logger.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));\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":";;;;;AAUA;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,CAAE,GAAE,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,gCAAgC,GAAG,WAAW;AACzD,UAAU,CAAC,gCAAgC,GAAG,oCAAoC;AAClF,SAAS;AACT,OAAO;AACP,MAAM,QAAQ;AACd,QAAQ,MAAM,KAAA,GAAQ,eAAe,EAAE;AACvC,QAAQ,KAAK,CAAC,UAAU,CAAC,sBAAsB,EAAE,EAAE,GAA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;;;;"}
1
+ {"version":3,"file":"events.js","sources":["../../../src/gcpfunction/events.ts"],"sourcesContent":["import {\n handleCallbackErrors,\n logger,\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));\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 && logger.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));\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,CAAE,GAAE,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,gCAAgC,GAAG,WAAW;AACzD,UAAU,CAAC,gCAAgC,GAAG,oCAAoC;AAClF,SAAS;AACT,OAAO;AACP,MAAM,QAAQ;AACd,QAAQ,MAAM,KAAA,GAAQ,eAAe,EAAE;AACvC,QAAQ,KAAK,CAAC,UAAU,CAAC,sBAAsB,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;AACL,GAAG;AACH;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sources":["../../../src/gcpfunction/http.ts"],"sourcesContent":["import {\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n handleCallbackErrors,\n httpRequestToRequestData,\n isString,\n logger,\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 && logger.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));\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,EAAG,GAAsD,eAAe;AAChG,EAAE,IAAI,YAAY,EAAE;AACpB,IAAI,SAAA,GAAY,EAAE,eAAe,EAAE,aAAa,CAAC,YAAY,EAAE,IAAI,CAAA,EAAG;AACtE;AACA,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,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IAAA,EAAA,CAAA,IAAA;AACA,gBAAA,WAAA,IAAA,MAAA,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,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 handleCallbackErrors,\n httpRequestToRequestData,\n isString,\n logger,\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 && logger.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));\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,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CAAA;AACA,UAAA,EAAA,EAAA,mBAAA;AACA,UAAA,UAAA,EAAA;AACA,YAAA,CAAA,gCAAA,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,MAAA,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,CAAA,CAAA;AACA,aAAA;AACA,WAAA;AACA,SAAA;AACA,OAAA;AACA,KAAA,CAAA;AACA,GAAA;AACA;;;;"}
@@ -1,4 +1,4 @@
1
- export { NodeClient, 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, captureCheckIn, captureEvent, captureException, captureFeedback, captureMessage, captureSession, childProcessIntegration, close, connectIntegration, consoleIntegration, consoleLoggingIntegration, contextLinesIntegration, continueTrace, createGetModuleFromFilename, createSentryWinstonTransport, createTransport, cron, dataloaderIntegration, defaultStackParser, disableAnrDetectionForCallback, endSession, eventFiltersIntegration, expressErrorHandler, expressIntegration, fastifyIntegration, flush, fsIntegration, functionToStringIntegration, generateInstrumentOnce, genericPoolIntegration, getActiveSpan, getAutoPerformanceIntegrations, getClient, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSentryRelease, getSpanDescendants, getSpanStatusFromHttpCode, getTraceData, getTraceMetaTags, graphqlIntegration, hapiIntegration, httpIntegration, inboundFiltersIntegration, initOpenTelemetry, isInitialized, kafkaIntegration, knexIntegration, koaIntegration, lastEventId, linkedErrorsIntegration, localVariablesIntegration, logger, lruMemoizerIntegration, makeNodeTransport, modulesIntegration, mongoIntegration, mongooseIntegration, mysql2Integration, mysqlIntegration, nativeNodeFetchIntegration, nodeContextIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, parameterize, postgresIntegration, prismaIntegration, profiler, redisIntegration, requestDataIntegration, setContext, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, setupConnectErrorHandler, setupExpressErrorHandler, setupHapiErrorHandler, setupKoaErrorHandler, spanToBaggageHeader, spanToJSON, spanToTraceHeader, spotlightIntegration, startInactiveSpan, startNewTrace, startSession, startSpan, startSpanManual, suppressTracing, tediousIntegration, trpcMiddleware, updateSpanName, vercelAIIntegration, withActiveSpan, withIsolationScope, withMonitor, withScope, zodErrorsIntegration } from '@sentry/node';
1
+ export { NodeClient, 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, captureCheckIn, captureEvent, captureException, captureFeedback, captureMessage, captureSession, childProcessIntegration, close, connectIntegration, consoleIntegration, consoleLoggingIntegration, contextLinesIntegration, continueTrace, createGetModuleFromFilename, createSentryWinstonTransport, createTransport, cron, dataloaderIntegration, defaultStackParser, disableAnrDetectionForCallback, endSession, eventFiltersIntegration, expressErrorHandler, expressIntegration, fastifyIntegration, flush, fsIntegration, functionToStringIntegration, generateInstrumentOnce, genericPoolIntegration, getActiveSpan, getAutoPerformanceIntegrations, getClient, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSentryRelease, getSpanDescendants, getSpanStatusFromHttpCode, getTraceData, getTraceMetaTags, graphqlIntegration, hapiIntegration, httpIntegration, inboundFiltersIntegration, initOpenTelemetry, instrumentSupabaseClient, isInitialized, kafkaIntegration, knexIntegration, koaIntegration, lastEventId, linkedErrorsIntegration, localVariablesIntegration, logger, lruMemoizerIntegration, makeNodeTransport, modulesIntegration, mongoIntegration, mongooseIntegration, mysql2Integration, mysqlIntegration, nativeNodeFetchIntegration, nodeContextIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, parameterize, postgresIntegration, prismaIntegration, profiler, redisIntegration, requestDataIntegration, setContext, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, setupConnectErrorHandler, setupExpressErrorHandler, setupHapiErrorHandler, setupKoaErrorHandler, spanToBaggageHeader, spanToJSON, spanToTraceHeader, spotlightIntegration, startInactiveSpan, startNewTrace, startSession, startSpan, startSpanManual, supabaseIntegration, suppressTracing, tediousIntegration, trpcMiddleware, updateSpanName, vercelAIIntegration, 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 { EventEmitter } from 'events';\nimport type { Client, IntegrationFn } from '@sentry/core';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, defineIntegration, fill, getClient } from '@sentry/core';\nimport { startInactiveSpan } from '@sentry/node';\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,aAAc,GAAE,IAAI,OAAO,EAAmB;;AAEpD,MAAM,2BAAA,IAA+B,CAAC,OAAO,GAA2B,EAAE,KAAK;AAC/E,EAAE,MAAM,QAAS,GAAE,OAAO,CAAC,QAAA,IAAY,KAAK;AAC5C,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAA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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
+ {"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,aAAc,GAAE,IAAI,OAAO,EAAmB;;AAEpD,MAAM,2BAAA,IAA+B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,CAAA,EAAA,CAAA,QAAA,EAAA,MAAA;AACA,UAAA,IAAA,IAAA,EAAA;AACA,YAAA,IAAA,CAAA,GAAA,EAAA;AACA;AACA,SAAA,CAAA;AACA,QAAA,OAAA,GAAA;AACA,OAAA;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 SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n defineIntegration,\n fill,\n getClient,\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,aAAc,GAAE,IAAI,OAAO,EAAmB;;AAEpD,MAAM,2BAAA,IAA+B,CAAC,OAAO,GAA2B,EAAE,KAAK;AAC/E,EAAE,MAAM,QAAS,GAAE,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,CAAE;AAC7D,QAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,mBAAmB,CAAC;AAC5E,OAAQ,CAAA,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,CAAE;;AAEH;AACA;AACA;MACa,0BAA2B,GAAE,iBAAiB,CAAC,2BAA2B;;AAEvF;AACA,SAAS,mBAAmB,CAAC,IAAI,EAAoC;AACrE,EAAE,OAAO,WAAgC,OAAO,EAAkB,QAAQ,EAA0B;AACpG,IAAI,MAAM,UAAW,GAAE,OAAO,CAAC,MAAA,IAAU,KAAK;AAC9C,IAAI,MAAM,OAAO,aAAa,CAAC,GAAG,CAAC,SAAS,EAAG;AAC/C,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,aAAc,GAAE,IAAI,OAAO,EAAmB;;AAEpD,MAAM,2BAAA,IAA+B,CAAC,OAAO,GAA2B,EAAE,KAAK;AAC/E,EAAE,MAAM,QAAS,GAAE,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,CAAE;AAC7D,QAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,EAAE,mBAAmB,CAAC;AAC5E,OAAQ,CAAA,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,CAAE;;AAEH;AACA;AACA;MACa,0BAA2B,GAAE,iBAAiB,CAAC,2BAA2B;;AAEvF;AACA,SAAS,mBAAmB,CAAC,IAAI,EAAoC;AACrE,EAAE,OAAO,WAAgC,OAAO,EAAkB,QAAQ,EAA0B;AACpG,IAAI,MAAM,UAAW,GAAE,OAAO,CAAC,MAAA,IAAU,KAAK;AAC9C,IAAI,MAAM,OAAO,aAAa,CAAC,GAAG,CAAC,SAAS,EAAG;AAC/C,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 +1 @@
1
- {"type":"module","version":"9.13.0","sideEffects":false}
1
+ {"type":"module","version":"9.15.0","sideEffects":false}
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import type { Integration, Options } from '@sentry/core';\nimport { applySdkMetadata } from '@sentry/core';\nimport type { NodeClient, NodeOptions } from '@sentry/node';\nimport { getDefaultIntegrationsWithoutPerformance, init as initNode } from '@sentry/node';\n\nimport { googleCloudGrpcIntegration } from './integrations/google-cloud-grpc';\nimport { googleCloudHttpIntegration } from './integrations/google-cloud-http';\n\nfunction isCjs(): boolean {\n return typeof require !== 'undefined';\n}\n\nfunction getCjsOnlyIntegrations(): Integration[] {\n return isCjs()\n ? [\n googleCloudHttpIntegration({ optional: true }), // We mark this integration optional since '@google-cloud/common' module could be missing.\n googleCloudGrpcIntegration({ optional: true }), // We mark this integration optional since 'google-gax' module could be missing.\n ]\n : [];\n}\n\n/** Get the default integrations for the GCP SDK. */\nexport function getDefaultIntegrations(_options: Options): Integration[] {\n return [...getDefaultIntegrationsWithoutPerformance(), ...getCjsOnlyIntegrations()];\n}\n\n/**\n * @see {@link Sentry.init}\n */\nexport function init(options: NodeOptions = {}): NodeClient | undefined {\n const opts = {\n defaultIntegrations: getDefaultIntegrations(options),\n ...options,\n };\n\n applySdkMetadata(opts, 'google-cloud-serverless');\n\n return initNode(opts);\n}\n"],"names":["initNode"],"mappings":";;;;;AAQA,SAAS,KAAK,GAAY;AAC1B,EAAE,OAAO,OAAO,OAAQ,KAAI,WAAW;AACvC;;AAEA,SAAS,sBAAsB,GAAkB;AACjD,EAAE,OAAO,KAAK;AACd,MAAM;AACN,QAAQ,0BAA0B,CAAC,EAAE,QAAQ,EAAE,IAAA,EAAM,CAAC;AACtD,QAAQ,0BAA0B,CAAC,EAAE,QAAQ,EAAE,IAAA,EAAM,CAAC;AACtD;AACA,MAAM,EAAE;AACR;;AAEA;AACO,SAAS,sBAAsB,CAAC,QAAQ,EAA0B;AACzE,EAAE,OAAO,CAAC,GAAG,wCAAwC,EAAE,EAAE,GAAG,sBAAsB,EAAE,CAAC;AACrF;;AAEA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,GAAgB,EAAE,EAA0B;AACxE,EAAE,MAAM,OAAO;AACf,IAAI,mBAAmB,EAAE,sBAAsB,CAAQ,CAAC;AACxD,IAAI,GAAG,OAAO;AACd,GAAG;;AAEH,EAAE,gBAAgB,CAAC,IAAI,EAAE,yBAAyB,CAAC;;AAEnD,EAAE,OAAOA,MAAQ,CAAC,IAAI,CAAC;AACvB;;;;"}
1
+ {"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import type { Integration, Options } from '@sentry/core';\nimport { applySdkMetadata } from '@sentry/core';\nimport type { NodeClient, NodeOptions } from '@sentry/node';\nimport { getDefaultIntegrationsWithoutPerformance, init as initNode } from '@sentry/node';\nimport { googleCloudGrpcIntegration } from './integrations/google-cloud-grpc';\nimport { googleCloudHttpIntegration } from './integrations/google-cloud-http';\n\nfunction isCjs(): boolean {\n return typeof require !== 'undefined';\n}\n\nfunction getCjsOnlyIntegrations(): Integration[] {\n return isCjs()\n ? [\n googleCloudHttpIntegration({ optional: true }), // We mark this integration optional since '@google-cloud/common' module could be missing.\n googleCloudGrpcIntegration({ optional: true }), // We mark this integration optional since 'google-gax' module could be missing.\n ]\n : [];\n}\n\n/** Get the default integrations for the GCP SDK. */\nexport function getDefaultIntegrations(_options: Options): Integration[] {\n return [...getDefaultIntegrationsWithoutPerformance(), ...getCjsOnlyIntegrations()];\n}\n\n/**\n * @see {@link Sentry.init}\n */\nexport function init(options: NodeOptions = {}): NodeClient | undefined {\n const opts = {\n defaultIntegrations: getDefaultIntegrations(options),\n ...options,\n };\n\n applySdkMetadata(opts, 'google-cloud-serverless');\n\n return initNode(opts);\n}\n"],"names":["initNode"],"mappings":";;;;;AAOA,SAAS,KAAK,GAAY;AAC1B,EAAE,OAAO,OAAO,OAAQ,KAAI,WAAW;AACvC;;AAEA,SAAS,sBAAsB,GAAkB;AACjD,EAAE,OAAO,KAAK;AACd,MAAM;AACN,QAAQ,0BAA0B,CAAC,EAAE,QAAQ,EAAE,IAAA,EAAM,CAAC;AACtD,QAAQ,0BAA0B,CAAC,EAAE,QAAQ,EAAE,IAAA,EAAM,CAAC;AACtD;AACA,MAAM,EAAE;AACR;;AAEA;AACO,SAAS,sBAAsB,CAAC,QAAQ,EAA0B;AACzE,EAAE,OAAO,CAAC,GAAG,wCAAwC,EAAE,EAAE,GAAG,sBAAsB,EAAE,CAAC;AACrF;;AAEA;AACA;AACA;AACO,SAAS,IAAI,CAAC,OAAO,GAAgB,EAAE,EAA0B;AACxE,EAAE,MAAM,OAAO;AACf,IAAI,mBAAmB,EAAE,sBAAsB,CAAQ,CAAC;AACxD,IAAI,GAAG,OAAO;AACd,GAAG;;AAEH,EAAE,gBAAgB,CAAC,IAAI,EAAE,yBAAyB,CAAC;;AAEnD,EAAE,OAAOA,MAAQ,CAAC,IAAI,CAAC;AACvB;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"cloud_events.d.ts","sourceRoot":"","sources":["../../../src/gcpfunction/cloud_events.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,8BAA8B,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEpG,MAAM,MAAM,gCAAgC,GAAG,cAAc,CAAC;AAE9D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,EAAE,EAAE,kBAAkB,GAAG,8BAA8B,EACvD,WAAW,GAAE,OAAO,CAAC,gCAAgC,CAAM,GAC1D,8BAA8B,CAEhC"}
1
+ {"version":3,"file":"cloud_events.d.ts","sourceRoot":"","sources":["../../../src/gcpfunction/cloud_events.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,kBAAkB,EAAE,8BAA8B,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEpG,MAAM,MAAM,gCAAgC,GAAG,cAAc,CAAC;AAE9D;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,EAAE,EAAE,kBAAkB,GAAG,8BAA8B,EACvD,WAAW,GAAE,OAAO,CAAC,gCAAgC,CAAM,GAC1D,8BAA8B,CAEhC"}
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/gcpfunction/events.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE1F,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC;AAEzD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,aAAa,GAAG,yBAAyB,EAC7C,WAAW,GAAE,OAAO,CAAC,2BAA2B,CAAM,GACrD,yBAAyB,CAE3B"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/gcpfunction/events.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,aAAa,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE1F,MAAM,MAAM,2BAA2B,GAAG,cAAc,CAAC;AAEzD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,aAAa,GAAG,yBAAyB,EAC7C,WAAW,GAAE,OAAO,CAAC,2BAA2B,CAAM,GACrD,yBAAyB,CAE3B"}
@@ -1,4 +1,4 @@
1
- export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureCheckIn, captureFeedback, startSession, captureSession, endSession, withMonitor, createTransport, getClient, isInitialized, 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, anrIntegration, disableAnrDetectionForCallback, consoleIntegration, httpIntegration, nativeNodeFetchIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, 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, genericPoolIntegration, graphqlIntegration, knexIntegration, kafkaIntegration, lruMemoizerIntegration, mongoIntegration, mongooseIntegration, mysqlIntegration, mysql2Integration, redisIntegration, tediousIntegration, postgresIntegration, prismaIntegration, hapiIntegration, setupHapiErrorHandler, spotlightIntegration, initOpenTelemetry, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, updateSpanName, zodErrorsIntegration, profiler, amqplibIntegration, childProcessIntegration, createSentryWinstonTransport, vercelAIIntegration, logger, consoleLoggingIntegration, } from '@sentry/node';
1
+ export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureCheckIn, captureFeedback, startSession, captureSession, endSession, withMonitor, createTransport, getClient, isInitialized, 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, anrIntegration, disableAnrDetectionForCallback, consoleIntegration, httpIntegration, nativeNodeFetchIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, 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, genericPoolIntegration, graphqlIntegration, knexIntegration, kafkaIntegration, lruMemoizerIntegration, mongoIntegration, mongooseIntegration, mysqlIntegration, mysql2Integration, redisIntegration, tediousIntegration, postgresIntegration, prismaIntegration, hapiIntegration, setupHapiErrorHandler, spotlightIntegration, initOpenTelemetry, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, updateSpanName, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, profiler, amqplibIntegration, childProcessIntegration, createSentryWinstonTransport, vercelAIIntegration, logger, consoleLoggingIntegration, wrapMcpServerWithSentry, } 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,EACd,UAAU,EACV,WAAW,EACX,eAAe,EACf,SAAS,EACT,aAAa,EACb,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,EACL,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,yBAAyB,EACzB,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,KAAK,EACL,KAAK,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,cAAc,EACd,8BAA8B,EAC9B,kBAAkB,EAClB,eAAe,EACf,0BAA0B,EAC1B,8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AAE,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,cAAc,EACd,UAAU,EACV,WAAW,EACX,eAAe,EACf,SAAS,EACT,aAAa,EACb,sBAAsB,EACtB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,EACL,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,yBAAyB,EACzB,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,kBAAkB,EAClB,WAAW,EACX,KAAK,EACL,KAAK,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,cAAc,EACd,8BAA8B,EAC9B,kBAAkB,EAClB,eAAe,EACf,0BAA0B,EAC1B,8BAA8B,EAC9B,+BAA+B,EAC/B,kBAAkB,EAClB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EACb,2BAA2B,EAE3B,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,EACvB,cAAc,EACd,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,eAAe,EACf,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,8BAA8B,EAC9B,IAAI,EACJ,YAAY,EACZ,4BAA4B,EAC5B,gCAAgC,EAChC,gCAAgC,EAChC,qCAAqC,EACrC,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,QAAQ,EACR,kBAAkB,EAClB,uBAAuB,EACvB,4BAA4B,EAC5B,mBAAmB,EACnB,MAAM,EACN,yBAAyB,EACzB,uBAAuB,GACxB,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 +1 @@
1
- {"version":3,"file":"google-cloud-grpc.d.ts","sourceRoot":"","sources":["../../../src/integrations/google-cloud-grpc.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAK3C,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC;CACpC;AAED,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACtB;AAUD,MAAM,WAAW,IAAI;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAAC;CACnC;AAiCD;;GAEG;AACH,eAAO,MAAM,0BAA0B;;oDAAiD,CAAC;AAkBzF,0DAA0D;AAC1D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAyChG"}
1
+ {"version":3,"file":"google-cloud-grpc.d.ts","sourceRoot":"","sources":["../../../src/integrations/google-cloud-grpc.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE3C,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC;CACpC;AAED,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,aAAa,EAAE,OAAO,CAAC;IACvB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACtB;AAUD,MAAM,WAAW,IAAI;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAAC;CACnC;AAiCD;;GAEG;AACH,eAAO,MAAM,0BAA0B;;oDAAiD,CAAC;AAkBzF,0DAA0D;AAC1D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAyChG"}
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAmB5D,oDAAoD;AACpD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,WAAW,EAAE,CAEvE;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAgB,GAAG,UAAU,GAAG,SAAS,CAStE"}
1
+ {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAkB5D,oDAAoD;AACpD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,WAAW,EAAE,CAEvE;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAgB,GAAG,UAAU,GAAG,SAAS,CAStE"}
@@ -1,4 +1,4 @@
1
- export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureCheckIn, captureFeedback, startSession, captureSession, endSession, withMonitor, createTransport, getClient, isInitialized, 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, anrIntegration, disableAnrDetectionForCallback, consoleIntegration, httpIntegration, nativeNodeFetchIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, 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, genericPoolIntegration, graphqlIntegration, knexIntegration, kafkaIntegration, lruMemoizerIntegration, mongoIntegration, mongooseIntegration, mysqlIntegration, mysql2Integration, redisIntegration, tediousIntegration, postgresIntegration, prismaIntegration, hapiIntegration, setupHapiErrorHandler, spotlightIntegration, initOpenTelemetry, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, updateSpanName, zodErrorsIntegration, profiler, amqplibIntegration, childProcessIntegration, createSentryWinstonTransport, vercelAIIntegration, logger, consoleLoggingIntegration, } from '@sentry/node';
1
+ export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureCheckIn, captureFeedback, startSession, captureSession, endSession, withMonitor, createTransport, getClient, isInitialized, 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, anrIntegration, disableAnrDetectionForCallback, consoleIntegration, httpIntegration, nativeNodeFetchIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, 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, genericPoolIntegration, graphqlIntegration, knexIntegration, kafkaIntegration, lruMemoizerIntegration, mongoIntegration, mongooseIntegration, mysqlIntegration, mysql2Integration, redisIntegration, tediousIntegration, postgresIntegration, prismaIntegration, hapiIntegration, setupHapiErrorHandler, spotlightIntegration, initOpenTelemetry, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, updateSpanName, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, profiler, amqplibIntegration, childProcessIntegration, createSentryWinstonTransport, vercelAIIntegration, logger, consoleLoggingIntegration, wrapMcpServerWithSentry, } 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": "9.13.0",
3
+ "version": "9.15.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": "9.13.0",
52
- "@sentry/node": "9.13.0",
51
+ "@sentry/core": "9.15.0",
52
+ "@sentry/node": "9.15.0",
53
53
  "@types/express": "^4.17.14"
54
54
  },
55
55
  "devDependencies": {