@sentry/google-cloud-serverless 11.0.0-alpha.1 → 11.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/gcpfunction/cloud_events.js +2 -2
- package/build/cjs/gcpfunction/cloud_events.js.map +1 -1
- package/build/cjs/gcpfunction/events.js +2 -2
- package/build/cjs/gcpfunction/events.js.map +1 -1
- package/build/cjs/gcpfunction/http.js +2 -2
- package/build/cjs/gcpfunction/http.js.map +1 -1
- package/build/cjs/index.js +2 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/integrations/google-cloud-grpc.js +21 -25
- package/build/cjs/integrations/google-cloud-grpc.js.map +1 -1
- package/build/cjs/integrations/google-cloud-http.js +1 -1
- package/build/cjs/integrations/google-cloud-http.js.map +1 -1
- package/build/esm/gcpfunction/cloud_events.js +5 -5
- package/build/esm/gcpfunction/cloud_events.js.map +1 -1
- package/build/esm/gcpfunction/events.js +5 -5
- package/build/esm/gcpfunction/events.js.map +1 -1
- package/build/esm/gcpfunction/http.js +5 -5
- package/build/esm/gcpfunction/http.js.map +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/integrations/google-cloud-grpc.js +22 -26
- package/build/esm/integrations/google-cloud-grpc.js.map +1 -1
- package/build/esm/integrations/google-cloud-http.js +2 -2
- package/build/esm/integrations/google-cloud-http.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/types/gcpfunction/cloud_events.d.ts.map +1 -1
- package/build/types/gcpfunction/events.d.ts.map +1 -1
- package/build/types/gcpfunction/http.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integrations/google-cloud-grpc.d.ts.map +1 -1
- package/package.json +6 -5
|
@@ -20,9 +20,9 @@ function _wrapCloudEventFunction(fn, wrapOptions = {}) {
|
|
|
20
20
|
{
|
|
21
21
|
name: context.type || "<unknown>",
|
|
22
22
|
attributes: {
|
|
23
|
-
[attributes.SENTRY_OP]: op.
|
|
23
|
+
[attributes.SENTRY_OP]: op.FUNCTION_GCP,
|
|
24
24
|
[attributes.FAAS_TRIGGER]: "cloud_event",
|
|
25
|
-
[
|
|
25
|
+
[attributes.SENTRY_SEGMENT_NAME_SOURCE]: "component",
|
|
26
26
|
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.function.serverless.gcp_cloud_event"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud_events.js","sources":["../../../src/gcpfunction/cloud_events.ts"],"sourcesContent":["import { FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';\nimport {
|
|
1
|
+
{"version":3,"file":"cloud_events.js","sources":["../../../src/gcpfunction/cloud_events.ts"],"sourcesContent":["import { SENTRY_SEGMENT_NAME_SOURCE, FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';\nimport { FUNCTION_GCP } from '@sentry/conventions/op';\nimport { debug, handleCallbackErrors, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } 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 attributes: {\n [SENTRY_OP]: FUNCTION_GCP,\n [FAAS_TRIGGER]: 'cloud_event',\n [SENTRY_SEGMENT_NAME_SOURCE]: 'component',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_cloud_event',\n },\n },\n span => {\n const scope = getCurrentScope();\n scope.setContext('gcp.function.context', { ...context });\n\n const newCallback = domainify((...args: unknown[]) => {\n if (args[0] !== null && args[0] !== undefined) {\n captureException(args[0], scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_cloud_event'));\n }\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(options.flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n if (typeof callback === 'function') {\n callback(...args);\n }\n });\n });\n\n if (fn.length > 1) {\n return handleCallbackErrors(\n () => (fn as CloudEventFunctionWithCallback)(context, newCallback),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_cloud_event'));\n },\n );\n }\n\n return Promise.resolve()\n .then(() => (fn as CloudEventFunction)(context))\n .then(\n result => newCallback(null, result),\n err => newCallback(err, undefined),\n );\n },\n );\n };\n}\n"],"names":["proxyFunction","domainify","startSpanManual","SENTRY_OP","FUNCTION_GCP","FAAS_TRIGGER","SENTRY_SEGMENT_NAME_SOURCE","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","getCurrentScope","captureException","scope","markEventUnhandled","flush","DEBUG_BUILD","debug","handleCallbackErrors"],"mappings":";;;;;;;;;AAiBO,SAAS,sBAAA,CACd,EAAA,EACA,WAAA,GAAyD,EAAC,EAC1B;AAChC,EAAA,OAAOA,mBAAA,CAAc,IAAI,CAAA,CAAA,KAAKC,eAAA,CAAU,wBAAwB,CA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CAAS,GAAG,IAAI,CAAA;AAAA,YAClB;AAAA,UACF,CAAC,CAAA;AAAA,QACL,CAAC,CAAA;AAED,QAAA,IAAI,EAAA,CAAG,SAAS,CAAA,EAAG;AACjB,UAAA,OAAOC,yBAAA;AAAA,YACL,MAAO,EAAA,CAAsC,OAAA,EAAS,WAAW,CAAA;AAAA,YACjE,CAAA,GAAA,KAAO;AACL,cAAAN,qBAAA,CAAiB,KAAK,CAAAC,MAAAA,KAASC,wBAAA,CAAmBD,MAAAA,EAAO,0CAA0C,CAAC,CAAA;AAAA,YACtG;AAAA,WACF;AAAA,QACF;AAEA,QAAA,OAAO,OAAA,CAAQ,SAAQ,CACpB,IAAA,CAAK,MAAO,EAAA,CAA0B,OAAO,CAAC,CAAA,CAC9C,IAAA;AAAA,UACC,CAAA,MAAA,KAAU,WAAA,CAAY,IAAA,EAAM,MAAM,CAAA;AAAA,UAClC,CAAA,GAAA,KAAO,WAAA,CAAY,GAAA,EAAK,MAAS;AAAA,SACnC;AAAA,MACJ;AAAA,KACF;AAAA,EACF,CAAA;AACF;;;;"}
|
|
@@ -21,9 +21,9 @@ function _wrapEventFunction(fn, wrapOptions = {}) {
|
|
|
21
21
|
{
|
|
22
22
|
name: context.eventType,
|
|
23
23
|
attributes: {
|
|
24
|
-
[attributes.SENTRY_OP]: op.
|
|
24
|
+
[attributes.SENTRY_OP]: op.FUNCTION_GCP,
|
|
25
25
|
[attributes.FAAS_TRIGGER]: "event",
|
|
26
|
-
[
|
|
26
|
+
[attributes.SENTRY_SEGMENT_NAME_SOURCE]: "component",
|
|
27
27
|
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.function.serverless.gcp_event"
|
|
28
28
|
}
|
|
29
29
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sources":["../../../src/gcpfunction/events.ts"],"sourcesContent":["import { FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';\nimport {
|
|
1
|
+
{"version":3,"file":"events.js","sources":["../../../src/gcpfunction/events.ts"],"sourcesContent":["import { SENTRY_SEGMENT_NAME_SOURCE, FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';\nimport { FUNCTION_GCP } from '@sentry/conventions/op';\nimport { debug, handleCallbackErrors, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } 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 attributes: {\n [SENTRY_OP]: FUNCTION_GCP,\n [FAAS_TRIGGER]: 'event',\n [SENTRY_SEGMENT_NAME_SOURCE]: 'component',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_event',\n },\n },\n span => {\n const scope = getCurrentScope();\n scope.setContext('gcp.function.context', { ...context });\n\n const newCallback = domainify((...args: unknown[]) => {\n if (args[0] !== null && args[0] !== undefined) {\n captureException(args[0], scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_event'));\n }\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(options.flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n if (typeof callback === 'function') {\n callback(...args);\n }\n });\n });\n\n if (fn.length > 2) {\n return handleCallbackErrors(\n () => (fn as EventFunctionWithCallback)(data, context, newCallback),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_event'));\n },\n );\n }\n\n return Promise.resolve()\n .then(() => (fn as EventFunction)(data, context))\n .then(\n result => newCallback(null, result),\n err => newCallback(err, undefined),\n );\n },\n );\n };\n}\n"],"names":["proxyFunction","domainify","startSpanManual","SENTRY_OP","FUNCTION_GCP","FAAS_TRIGGER","SENTRY_SEGMENT_NAME_SOURCE","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","getCurrentScope","captureException","scope","markEventUnhandled","flush","DEBUG_BUILD","debug","handleCallbackErrors"],"mappings":";;;;;;;;;AAiBO,SAAS,iBAAA,CACd,EAAA,EACA,WAAA,GAAoD,EAAC,EAC1B;AAC3B,EAAA,OAAOA,mBAAA,CAAc,IAAI,CAAA,CAAA,KAAKC,eAAA,CAAU,mBAAmB,CAAA,EAAG,WAAW,CAAC,CAAC,CAAA;AAC7E;AAGA,SAAS,kBAAA,CACP,EAAA,EACA,WAAA,GAAoD,EAAC,EACM;AAC3D,EAAA,MAAM,OAAA,GAAuC;AAAA,IAC3C,YAAA,EAAc,GAAA;AAAA,IACd,GAAG;AAAA,GACL;AACA,EAAA,OAAO,IAAI,sBAAA,KAAyE;AAClF,IAAA,MAAM,CAAC,IAAA,EAAM,OAAA,EAAS,QAAQ,CAAA,GAAI,sBAAA;AAElC,IAAA,OAAOC,oBAAA;AAAA,MACL;AAAA,QACE,MAAM,OAAA,CAAQ,SAAA;AAAA,QACd,UAAA,EAAY;AAAA,UACV,CAACC,oBAAS,GAAGC,eAAA;AAAA,UACb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A,QAAA,OAAO,OAAA,CAAQ,SAAQ,CACpB,IAAA,CAAK,MAAO,EAAA,CAAqB,IAAA,EAAM,OAAO,CAAC,CAAA,CAC/C,IAAA;AAAA,UACC,CAAA,MAAA,KAAU,WAAA,CAAY,IAAA,EAAM,MAAM,CAAA;AAAA,UAClC,CAAA,GAAA,KAAO,WAAA,CAAY,GAAA,EAAK,MAAS;AAAA,SACnC;AAAA,MACJ;AAAA,KACF;AAAA,EACF,CAAA;AACF;;;;"}
|
|
@@ -30,9 +30,9 @@ function _wrapHttpFunction(fn, options) {
|
|
|
30
30
|
{
|
|
31
31
|
name: `${reqMethod} ${reqUrl}`,
|
|
32
32
|
attributes: {
|
|
33
|
-
[attributes.SENTRY_OP]: op.
|
|
33
|
+
[attributes.SENTRY_OP]: op.FUNCTION_GCP,
|
|
34
34
|
[attributes.FAAS_TRIGGER]: "http",
|
|
35
|
-
[
|
|
35
|
+
[attributes.SENTRY_SEGMENT_NAME_SOURCE]: "route",
|
|
36
36
|
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.function.serverless.gcp_http"
|
|
37
37
|
}
|
|
38
38
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sources":["../../../src/gcpfunction/http.ts"],"sourcesContent":["import { FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';\nimport {
|
|
1
|
+
{"version":3,"file":"http.js","sources":["../../../src/gcpfunction/http.ts"],"sourcesContent":["import { SENTRY_SEGMENT_NAME_SOURCE, FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';\nimport { FUNCTION_GCP } from '@sentry/conventions/op';\nimport {\n debug,\n handleCallbackErrors,\n httpRequestToRequestData,\n isString,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\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 attributes: {\n [SENTRY_OP]: FUNCTION_GCP,\n [FAAS_TRIGGER]: 'http',\n [SENTRY_SEGMENT_NAME_SOURCE]: 'route',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_http',\n },\n },\n span => {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const _end = res.end;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n res.end = function (chunk?: any | (() => void), encoding?: string | (() => void), cb?: () => void): any {\n setHttpStatus(span, res.statusCode);\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n _end.call(this, chunk, encoding, cb);\n });\n };\n\n return handleCallbackErrors(\n () => fn(req, res),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_http'));\n },\n );\n },\n );\n });\n };\n}\n"],"names":["domainify","proxyFunction","stripUrlQueryAndFragment","isString","continueTrace","httpRequestToRequestData","getCurrentScope","startSpanManual","SENTRY_OP","FUNCTION_GCP","FAAS_TRIGGER","SENTRY_SEGMENT_NAME_SOURCE","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","setHttpStatus","flush","DEBUG_BUILD","debug","handleCallbackErrors","captureException","markEventUnhandled"],"mappings":";;;;;;;;;AAuBO,SAAS,gBAAA,CAAiB,EAAA,EAAkB,WAAA,GAAuC,EAAC,EAAiB;AAC1G,EAAA,MAAM,OAAO,CAAC,CAAA,KAAkCA,gBAAU,iBAAA,CAAkB,CAAA,EAAG,WAAW,CAAC,CAAA;AAE3F,EAAA,IAAI,SAAA;AAIJ,EAAA,MAAM,eAAgB,EAAA,CAAyD,eAAA;AAC/E,EAAA,IAAI,YAAA,EAAc;AAChB,IAAA,SAAA,GAAY,EAAE,eAAA,EAAiBC,mBAAA,CAAc,YAAA,EAAc,IAAI,CAAA,EAAE;AAAA,EACnE;AACA,EAAA,OAAOA,mBAAA,CAAc,EAAA,EAAI,IAAA,EAAM,SAAS,CAAA;AAC1C;AAGA,SAAS,iBAAA,CAAkB,IAAkB,OAAA,EAAgD;AAC3F,EAAA,MAAM,YAAA,GAAe,QAAQ,YAAA,IAAgB,GAAA;AAC7C,EAAA,OAAO,CAAC,KAAK,GAAA,KAAQ;AACnB,IAAA,MAAM,SAAA,GAAA,CAAa,GAAA,CAAI,MAAA,IAAU,EAAA,EAAI,WAA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AAA,CACA,IAAA,CAAK,MAAM;AACV,cAAA,IAAA,CAAK,IAAA,CAAK,IAAA,EAAM,KAAA,EAAO,QAAA,EAAU,EAAE,CAAA;AAAA,YACrC,CAAC,CAAA;AAAA,UACL,CAAA;AAEA,UAAA,OAAOC,yBAAA;AAAA,YACL,MAAM,EAAA,CAAG,GAAA,EAAK,GAAG,CAAA;AAAA,YACjB,CAAA,GAAA,KAAO;AACL,cAAAC,qBAAA,CAAiB,GAAA,EAAK,CAAA,KAAA,KAASC,wBAAA,CAAmB,KAAA,EAAO,mCAAmC,CAAC,CAAA;AAAA,YAC/F;AAAA,WACF;AAAA,QACF;AAAA,OACF;AAAA,IACF,CAAC,CAAA;AAAA,EACH,CAAA;AACF;;;;"}
|
package/build/cjs/index.js
CHANGED
|
@@ -18,7 +18,7 @@ exports.SDK_VERSION = node.SDK_VERSION;
|
|
|
18
18
|
exports.SEMANTIC_ATTRIBUTE_SENTRY_OP = node.SEMANTIC_ATTRIBUTE_SENTRY_OP;
|
|
19
19
|
exports.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = node.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN;
|
|
20
20
|
exports.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = node.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE;
|
|
21
|
-
exports.
|
|
21
|
+
exports.SENTRY_SEGMENT_NAME_SOURCE = node.SENTRY_SEGMENT_NAME_SOURCE;
|
|
22
22
|
exports.Scope = node.Scope;
|
|
23
23
|
exports.addBreadcrumb = node.addBreadcrumb;
|
|
24
24
|
exports.addEventProcessor = node.addEventProcessor;
|
|
@@ -168,6 +168,7 @@ exports.withMonitor = node.withMonitor;
|
|
|
168
168
|
exports.withScope = node.withScope;
|
|
169
169
|
exports.withStaticSpan = node.withStaticSpan;
|
|
170
170
|
exports.withStreamedSpan = node.withStreamedSpan;
|
|
171
|
+
exports.workerThreadsIntegration = node.workerThreadsIntegration;
|
|
171
172
|
exports.wrapMcpServerWithSentry = node.wrapMcpServerWithSentry;
|
|
172
173
|
exports.zodErrorsIntegration = node.zodErrorsIntegration;
|
|
173
174
|
exports.captureConsoleIntegration = core.captureConsoleIntegration;
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -56,33 +56,29 @@ function fillGrpcFunction(stub, serviceIdentifier, methodName) {
|
|
|
56
56
|
if (callType != "unary call") {
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
core.fill(
|
|
60
|
-
stub,
|
|
61
|
-
|
|
62
|
-
(orig) => (...args) => {
|
|
63
|
-
const ret = orig.apply(stub, args);
|
|
64
|
-
if (typeof ret?.on !== "function" || !SETUP_CLIENTS.has(core.getClient())) {
|
|
65
|
-
return ret;
|
|
66
|
-
}
|
|
67
|
-
const span = node.startInactiveSpan({
|
|
68
|
-
name: `${callType} ${methodName}`,
|
|
69
|
-
onlyIfParent: true,
|
|
70
|
-
attributes: {
|
|
71
|
-
[attributes.SENTRY_OP]: op.FAAS_GRPC_SPAN_OP,
|
|
72
|
-
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.grpc.serverless",
|
|
73
|
-
[attributes.RPC_SYSTEM_NAME]: "grpc",
|
|
74
|
-
[attributes.RPC_SERVICE]: serviceIdentifier,
|
|
75
|
-
[attributes.RPC_METHOD]: methodName
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
ret.on("status", () => {
|
|
79
|
-
if (span) {
|
|
80
|
-
span.end();
|
|
81
|
-
}
|
|
82
|
-
});
|
|
59
|
+
core.fill(stub, methodName, (orig) => (...args) => {
|
|
60
|
+
const ret = orig.apply(stub, args);
|
|
61
|
+
if (typeof ret?.on !== "function" || !SETUP_CLIENTS.has(core.getClient())) {
|
|
83
62
|
return ret;
|
|
84
63
|
}
|
|
85
|
-
|
|
64
|
+
const span = node.startInactiveSpan({
|
|
65
|
+
name: `${callType} ${methodName}`,
|
|
66
|
+
onlyIfParent: true,
|
|
67
|
+
attributes: {
|
|
68
|
+
[attributes.SENTRY_OP]: op.GRPC,
|
|
69
|
+
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.grpc.serverless",
|
|
70
|
+
[attributes.RPC_SYSTEM_NAME]: "grpc",
|
|
71
|
+
[attributes.RPC_SERVICE]: serviceIdentifier,
|
|
72
|
+
[attributes.RPC_METHOD]: methodName
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
ret.on("status", () => {
|
|
76
|
+
if (span) {
|
|
77
|
+
span.end();
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
return ret;
|
|
81
|
+
});
|
|
86
82
|
}
|
|
87
83
|
function identifyService(servicePath) {
|
|
88
84
|
const match = servicePath.match(SERVICE_PATH_REGEX);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-cloud-grpc.js","sources":["../../../src/integrations/google-cloud-grpc.ts"],"sourcesContent":["import { RPC_METHOD, RPC_SERVICE, RPC_SYSTEM_NAME, SENTRY_OP } from '@sentry/conventions/attributes';\nimport {
|
|
1
|
+
{"version":3,"file":"google-cloud-grpc.js","sources":["../../../src/integrations/google-cloud-grpc.ts"],"sourcesContent":["import { RPC_METHOD, RPC_SERVICE, RPC_SYSTEM_NAME, SENTRY_OP } from '@sentry/conventions/attributes';\nimport { GRPC } from '@sentry/conventions/op';\nimport 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' as const;\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(stub, methodName, (orig: GrpcFunction): GrpcFunction => (...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 attributes: {\n [SENTRY_OP]: GRPC,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.grpc.serverless',\n [RPC_SYSTEM_NAME]: 'grpc',\n [RPC_SERVICE]: serviceIdentifier,\n [RPC_METHOD]: methodName,\n },\n });\n ret.on('status', () => {\n if (span) {\n span.end();\n }\n });\n return ret;\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","SENTRY_OP","GRPC","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","RPC_SYSTEM_NAME","RPC_SERVICE","RPC_METHOD"],"mappings":";;;;;;;AA6BA,MAAM,kBAAA,GAAqB,yBAAA;AAE3B,MAAM,gBAAA,GAAmB,iBAAA;AAEzB,MAAM,aAAA,uBAAoB,OAAA,EAAyB;AAEnD,MAAM,2BAAA,IAA+B,CAAC,OAAA,GAAkC,EAAC,KAAM;AAC7E,EAAA,MAAM,QAAA,GAAW,QAAQ,QAAA,IAAY,KAAA;AACrC,EAA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EACT,CAAC,CAAA;AACH;AAGA,SAAS,gBAAgB,WAAA,EAA6B;AACpD,EAAA,MAAM,KAAA,GAAQ,WAAA,CAAY,KAAA,CAAM,kBAAkB,CAAA;AAClD,EAAA,OAAO,KAAA,GAAQ,CAAC,CAAA,IAAK,WAAA;AACvB;;;;;"}
|
|
@@ -35,7 +35,7 @@ function wrapRequestFunction(orig) {
|
|
|
35
35
|
name: `${httpMethod} ${core.stripUrlQueryAndFragment(reqOpts.uri)}`,
|
|
36
36
|
onlyIfParent: true,
|
|
37
37
|
attributes: {
|
|
38
|
-
[attributes.SENTRY_OP]: op.
|
|
38
|
+
[attributes.SENTRY_OP]: op.HTTP_CLIENT,
|
|
39
39
|
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.serverless",
|
|
40
40
|
[attributes.HTTP_REQUEST_METHOD]: httpMethod,
|
|
41
41
|
[attributes.SERVER_ADDRESS]: getServerAddress(this.apiEndpoint),
|
|
@@ -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 { HTTP_REQUEST_METHOD, SENTRY_OP, SERVER_ADDRESS, URL_FULL } from '@sentry/conventions/attributes';\nimport {
|
|
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 { HTTP_REQUEST_METHOD, SENTRY_OP, SERVER_ADDRESS, URL_FULL } from '@sentry/conventions/attributes';\nimport { HTTP_CLIENT } from '@sentry/conventions/op';\nimport type { Client, IntegrationFn } from '@sentry/core';\nimport {\n defineIntegration,\n fill,\n getClient,\n isURLObjectRelative,\n parseStringToURLObject,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n filterCollectedUrl,\n stripUrlQueryAndFragment,\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' as const;\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 // Span names must not contain a query string, and callers can pass any URI they want.\n name: `${httpMethod} ${stripUrlQueryAndFragment(reqOpts.uri)}`,\n onlyIfParent: true,\n attributes: {\n [SENTRY_OP]: HTTP_CLIENT,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.serverless',\n [HTTP_REQUEST_METHOD]: httpMethod,\n [SERVER_ADDRESS]: getServerAddress(this.apiEndpoint),\n [URL_FULL]: filterCollectedUrl(reqOpts.uri),\n },\n })\n : new SentryNonRecordingSpan();\n orig.call(this, reqOpts, (...args: Parameters<ResponseCallback>) => {\n span.end();\n callback(...args);\n });\n };\n}\n\n/** Extracts the host of the API endpoint the request is sent to */\nfunction getServerAddress(apiEndpoint: string): string {\n const url = parseStringToURLObject(apiEndpoint);\n return url && !isURLObjectRelative(url) ? url.host : apiEndpoint;\n}\n"],"names":["fill","defineIntegration","getClient","startInactiveSpan","stripUrlQueryAndFragment","SENTRY_OP","HTTP_CLIENT","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","HTTP_REQUEST_METHOD","SERVER_ADDRESS","URL_FULL","filterCollectedUrl","SentryNonRecordingSpan","parseStringToURLObject","isURLObjectRelative"],"mappings":";;;;;;;AAwBA,MAAM,gBAAA,GAAmB,iBAAA;AAEzB,MAAM,aAAA,uBAAoB,OAAA,EAAyB;AAEnD,MAAM,2BAAA,IAA+B,CAAC,OAAA,GAAkC,EAAC,KAAM;AAC7E,EAAA,MAAM,QAAA,GAAW,QAAQ,QAAA,IAAY,KAAA;AACrC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,IAAI;AAEF,QAAA,MAAM,YAAA,GAAe,QAAQ,sBAAsB,CAAA;AACnD,QAAAA,SAAA,CAAK,YAAA,CAAa,OAAA,CAAQ,SAAA,EAAW,SAAA,EAAW,mBAAmB,CAAA;AAAA,MACrE,SAAS,CAAA,EAAG;AACV,QAAA,IAAI,CAAC,QAAA,EAAU;AACb,UAAA,MAAM,CAAA;AAAA,QACR;AAAA,MACF;AAAA,IACF,CAAA;AAAA,IACA,MAAM,MAAA,EAAQ;AACZ,MAAA,aAAA,CAAc,GAAA,CAAI,QAAQ,IAAI,CAAA;AAAA,IAChC;AAAA,GACF;AACF,CAAA,CAAA;AAKO,MAAM,0BAAA,GAA6BC,uBAAkB,2BAA2B;AAGvF,SAAS,oBAAoB,IAAA,EAAwC;AACnE,EAAA,OAAO,SAAgC,SAAyB,QAAA,EAAkC;AAChG,IAAA,MAAM,UAAA,GAAa,QAAQ,MAAA,IAAU,KAAA;AACrC,IAAA,MAAM,OAAO,aAAA,CAAc,GAAA,CAAIC,cAAA,EAAqB,IAChDC,sBAAA,CAAkB;AAAA;AAAA,MAEhB,MAAM,CAAA,EAAG,UAAU,IAAIC,6BAAA,CAAyB,OAAA,CAAQ,GAAG,CAAC,CAAA,CAAA;AAAA,MAC5D,YAAA,EAAc,IAAA;AAAA,MACd,UAAA,EAAY;AAAA,QACV,CAACC,oBAAS,GAAGC,cAAA;AAAA,QACb,CAACC,qCAAgC,GAAG,sBAAA;AAAA,QACpC,CAACC,8BAAmB,GAAG,UAAA;AAAA,QACvB,CAACC,yBAAc,GAAG,gBAAA,CAAiB,KAAK,WAAW,CAAA;AAAA,QACnD,CAACC,mBAAQ,GAAGC,uBAAA,CAAmB,QAAQ,GAAG;AAAA;AAC5C,KACD,CAAA,GACD,IAAIC,2BAAA,EAAuB;AAC/B,IAAA,IAAA,CAAK,IAAA,CAAK,IAAA,EAAM,OAAA,EAAS,CAAA,GAAI,IAAA,KAAuC;AAClE,MAAA,IAAA,CAAK,GAAA,EAAI;AACT,MAAA,QAAA,CAAS,GAAG,IAAI,CAAA;AAAA,IAClB,CAAC,CAAA;AAAA,EACH,CAAA;AACF;AAGA,SAAS,iBAAiB,WAAA,EAA6B;AACrD,EAAA,MAAM,GAAA,GAAMC,4BAAuB,WAAW,CAAA;AAC9C,EAAA,OAAO,OAAO,CAACC,wBAAA,CAAoB,GAAG,CAAA,GAAI,IAAI,IAAA,GAAO,WAAA;AACvD;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';
|
|
2
|
-
import {
|
|
3
|
-
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
|
|
1
|
+
import { SENTRY_SEGMENT_NAME_SOURCE, FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';
|
|
2
|
+
import { FUNCTION_GCP } from '@sentry/conventions/op';
|
|
3
|
+
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, handleCallbackErrors, debug } from '@sentry/core';
|
|
4
4
|
import { startSpanManual, getCurrentScope, captureException, flush } from '@sentry/node';
|
|
5
5
|
import { DEBUG_BUILD } from '../debug-build.js';
|
|
6
6
|
import { proxyFunction, domainify, markEventUnhandled } from '../utils.js';
|
|
@@ -18,9 +18,9 @@ function _wrapCloudEventFunction(fn, wrapOptions = {}) {
|
|
|
18
18
|
{
|
|
19
19
|
name: context.type || "<unknown>",
|
|
20
20
|
attributes: {
|
|
21
|
-
[SENTRY_OP]:
|
|
21
|
+
[SENTRY_OP]: FUNCTION_GCP,
|
|
22
22
|
[FAAS_TRIGGER]: "cloud_event",
|
|
23
|
-
[
|
|
23
|
+
[SENTRY_SEGMENT_NAME_SOURCE]: "component",
|
|
24
24
|
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.function.serverless.gcp_cloud_event"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud_events.js","sources":["../../../src/gcpfunction/cloud_events.ts"],"sourcesContent":["import { FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';\nimport {
|
|
1
|
+
{"version":3,"file":"cloud_events.js","sources":["../../../src/gcpfunction/cloud_events.ts"],"sourcesContent":["import { SENTRY_SEGMENT_NAME_SOURCE, FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';\nimport { FUNCTION_GCP } from '@sentry/conventions/op';\nimport { debug, handleCallbackErrors, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } 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 attributes: {\n [SENTRY_OP]: FUNCTION_GCP,\n [FAAS_TRIGGER]: 'cloud_event',\n [SENTRY_SEGMENT_NAME_SOURCE]: 'component',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_cloud_event',\n },\n },\n span => {\n const scope = getCurrentScope();\n scope.setContext('gcp.function.context', { ...context });\n\n const newCallback = domainify((...args: unknown[]) => {\n if (args[0] !== null && args[0] !== undefined) {\n captureException(args[0], scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_cloud_event'));\n }\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(options.flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n if (typeof callback === 'function') {\n callback(...args);\n }\n });\n });\n\n if (fn.length > 1) {\n return handleCallbackErrors(\n () => (fn as CloudEventFunctionWithCallback)(context, newCallback),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_cloud_event'));\n },\n );\n }\n\n return Promise.resolve()\n .then(() => (fn as CloudEventFunction)(context))\n .then(\n result => newCallback(null, result),\n err => newCallback(err, undefined),\n );\n },\n );\n };\n}\n"],"names":["scope"],"mappings":";;;;;;;AAiBO,SAAS,sBAAA,CACd,EAAA,EACA,WAAA,GAAyD,EAA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CAAK,MAAM;AACV,YAAA,IAAI,OAAO,aAAa,UAAA,EAAY;AAClC,cAAA,QAAA,CAAS,GAAG,IAAI,CAAA;AAAA,YAClB;AAAA,UACF,CAAC,CAAA;AAAA,QACL,CAAC,CAAA;AAED,QAAA,IAAI,EAAA,CAAG,SAAS,CAAA,EAAG;AACjB,UAAA,OAAO,oBAAA;AAAA,YACL,MAAO,EAAA,CAAsC,OAAA,EAAS,WAAW,CAAA;AAAA,YACjE,CAAA,GAAA,KAAO;AACL,cAAA,gBAAA,CAAiB,KAAK,CAAAA,MAAAA,KAAS,kBAAA,CAAmBA,MAAAA,EAAO,0CAA0C,CAAC,CAAA;AAAA,YACtG;AAAA,WACF;AAAA,QACF;AAEA,QAAA,OAAO,OAAA,CAAQ,SAAQ,CACpB,IAAA,CAAK,MAAO,EAAA,CAA0B,OAAO,CAAC,CAAA,CAC9C,IAAA;AAAA,UACC,CAAA,MAAA,KAAU,WAAA,CAAY,IAAA,EAAM,MAAM,CAAA;AAAA,UAClC,CAAA,GAAA,KAAO,WAAA,CAAY,GAAA,EAAK,MAAS;AAAA,SACnC;AAAA,MACJ;AAAA,KACF;AAAA,EACF,CAAA;AACF;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';
|
|
2
|
-
import {
|
|
3
|
-
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
|
|
1
|
+
import { SENTRY_SEGMENT_NAME_SOURCE, FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';
|
|
2
|
+
import { FUNCTION_GCP } from '@sentry/conventions/op';
|
|
3
|
+
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, handleCallbackErrors, debug } from '@sentry/core';
|
|
4
4
|
import { startSpanManual, getCurrentScope, captureException, flush } from '@sentry/node';
|
|
5
5
|
import { DEBUG_BUILD } from '../debug-build.js';
|
|
6
6
|
import { proxyFunction, domainify, markEventUnhandled } from '../utils.js';
|
|
@@ -19,9 +19,9 @@ function _wrapEventFunction(fn, wrapOptions = {}) {
|
|
|
19
19
|
{
|
|
20
20
|
name: context.eventType,
|
|
21
21
|
attributes: {
|
|
22
|
-
[SENTRY_OP]:
|
|
22
|
+
[SENTRY_OP]: FUNCTION_GCP,
|
|
23
23
|
[FAAS_TRIGGER]: "event",
|
|
24
|
-
[
|
|
24
|
+
[SENTRY_SEGMENT_NAME_SOURCE]: "component",
|
|
25
25
|
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.function.serverless.gcp_event"
|
|
26
26
|
}
|
|
27
27
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sources":["../../../src/gcpfunction/events.ts"],"sourcesContent":["import { FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';\nimport {
|
|
1
|
+
{"version":3,"file":"events.js","sources":["../../../src/gcpfunction/events.ts"],"sourcesContent":["import { SENTRY_SEGMENT_NAME_SOURCE, FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';\nimport { FUNCTION_GCP } from '@sentry/conventions/op';\nimport { debug, handleCallbackErrors, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } 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 attributes: {\n [SENTRY_OP]: FUNCTION_GCP,\n [FAAS_TRIGGER]: 'event',\n [SENTRY_SEGMENT_NAME_SOURCE]: 'component',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_event',\n },\n },\n span => {\n const scope = getCurrentScope();\n scope.setContext('gcp.function.context', { ...context });\n\n const newCallback = domainify((...args: unknown[]) => {\n if (args[0] !== null && args[0] !== undefined) {\n captureException(args[0], scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_event'));\n }\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(options.flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n if (typeof callback === 'function') {\n callback(...args);\n }\n });\n });\n\n if (fn.length > 2) {\n return handleCallbackErrors(\n () => (fn as EventFunctionWithCallback)(data, context, newCallback),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_event'));\n },\n );\n }\n\n return Promise.resolve()\n .then(() => (fn as EventFunction)(data, context))\n .then(\n result => newCallback(null, result),\n err => newCallback(err, undefined),\n );\n },\n );\n };\n}\n"],"names":["scope"],"mappings":";;;;;;;AAiBO,SAAS,iBAAA,CACd,EAAA,EACA,WAAA,GAAoD,EAAC,EAC1B;AAC3B,EAAA,OAAO,aAAA,CAAc,IAAI,CAAA,CAAA,KAAK,SAAA,CAAU,mBAAmB,CAAA,EAAG,WAAW,CAAC,CAAC,CAAA;AAC7E;AAGA,SAAS,kBAAA,CACP,EAAA,EACA,WAAA,GAA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,CAAC,CAAA;AAAA,QACL,CAAC,CAAA;AAED,QAAA,IAAI,EAAA,CAAG,SAAS,CAAA,EAAG;AACjB,UAAA,OAAO,oBAAA;AAAA,YACL,MAAO,EAAA,CAAiC,IAAA,EAAM,OAAA,EAAS,WAAW,CAAA;AAAA,YAClE,CAAA,GAAA,KAAO;AACL,cAAA,gBAAA,CAAiB,KAAK,CAAAA,MAAAA,KAAS,kBAAA,CAAmBA,MAAAA,EAAO,oCAAoC,CAAC,CAAA;AAAA,YAChG;AAAA,WACF;AAAA,QACF;AAEA,QAAA,OAAO,OAAA,CAAQ,SAAQ,CACpB,IAAA,CAAK,MAAO,EAAA,CAAqB,IAAA,EAAM,OAAO,CAAC,CAAA,CAC/C,IAAA;AAAA,UACC,CAAA,MAAA,KAAU,WAAA,CAAY,IAAA,EAAM,MAAM,CAAA;AAAA,UAClC,CAAA,GAAA,KAAO,WAAA,CAAY,GAAA,EAAK,MAAS;AAAA,SACnC;AAAA,MACJ;AAAA,KACF;AAAA,EACF,CAAA;AACF;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';
|
|
2
|
-
import {
|
|
3
|
-
import { stripUrlQueryAndFragment, isString, httpRequestToRequestData, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
|
|
1
|
+
import { SENTRY_SEGMENT_NAME_SOURCE, FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';
|
|
2
|
+
import { FUNCTION_GCP } from '@sentry/conventions/op';
|
|
3
|
+
import { stripUrlQueryAndFragment, isString, httpRequestToRequestData, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, setHttpStatus, debug, handleCallbackErrors } from '@sentry/core';
|
|
4
4
|
import { continueTrace, getCurrentScope, startSpanManual, flush, captureException } from '@sentry/node';
|
|
5
5
|
import { DEBUG_BUILD } from '../debug-build.js';
|
|
6
6
|
import { proxyFunction, domainify, markEventUnhandled } from '../utils.js';
|
|
@@ -28,9 +28,9 @@ function _wrapHttpFunction(fn, options) {
|
|
|
28
28
|
{
|
|
29
29
|
name: `${reqMethod} ${reqUrl}`,
|
|
30
30
|
attributes: {
|
|
31
|
-
[SENTRY_OP]:
|
|
31
|
+
[SENTRY_OP]: FUNCTION_GCP,
|
|
32
32
|
[FAAS_TRIGGER]: "http",
|
|
33
|
-
[
|
|
33
|
+
[SENTRY_SEGMENT_NAME_SOURCE]: "route",
|
|
34
34
|
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.function.serverless.gcp_http"
|
|
35
35
|
}
|
|
36
36
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sources":["../../../src/gcpfunction/http.ts"],"sourcesContent":["import { FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';\nimport {
|
|
1
|
+
{"version":3,"file":"http.js","sources":["../../../src/gcpfunction/http.ts"],"sourcesContent":["import { SENTRY_SEGMENT_NAME_SOURCE, FAAS_TRIGGER, SENTRY_OP } from '@sentry/conventions/attributes';\nimport { FUNCTION_GCP } from '@sentry/conventions/op';\nimport {\n debug,\n handleCallbackErrors,\n httpRequestToRequestData,\n isString,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\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 attributes: {\n [SENTRY_OP]: FUNCTION_GCP,\n [FAAS_TRIGGER]: 'http',\n [SENTRY_SEGMENT_NAME_SOURCE]: 'route',\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.serverless.gcp_http',\n },\n },\n span => {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const _end = res.end;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n res.end = function (chunk?: any | (() => void), encoding?: string | (() => void), cb?: () => void): any {\n setHttpStatus(span, res.statusCode);\n span.end();\n\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n flush(flushTimeout)\n .then(null, e => {\n DEBUG_BUILD && debug.error(e);\n })\n .then(() => {\n _end.call(this, chunk, encoding, cb);\n });\n };\n\n return handleCallbackErrors(\n () => fn(req, res),\n err => {\n captureException(err, scope => markEventUnhandled(scope, 'auto.function.serverless.gcp_http'));\n },\n );\n },\n );\n });\n };\n}\n"],"names":[],"mappings":";;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E_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
|
|
1
|
+
export { NODE_VERSION, NodeClient, OpenFeatureIntegrationHook, SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SENTRY_SEGMENT_NAME_SOURCE, Scope, addBreadcrumb, addEventProcessor, addIntegration, amqplibIntegration, anrIntegration, anthropicAIIntegration, bindScopeToEmitter, buildLaunchDarklyFlagUsedHandler, captureCheckIn, captureEvent, captureException, captureFeedback, captureMessage, captureSession, childProcessIntegration, close, consoleIntegration, consoleLoggingIntegration, contextLinesIntegration, continueTrace, createConsolaReporter, createGetModuleFromFilename, createLangChainCallbackHandler, createSentryWinstonTransport, createTransport, cron, dataloaderIntegration, defaultStackParser, disableAnrDetectionForCallback, endSession, eventFiltersIntegration, expressErrorHandler, expressIntegration, fastifyIntegration, featureFlagsIntegration, firebaseIntegration, flush, fsIntegration, functionToStringIntegration, genericPoolIntegration, getActiveSpan, getAutoPerformanceIntegrations, getClient, getCurrentScope, getGlobalScope, getIsolationScope, getOtlpTracesEndpoint, getRootSpan, getSentryRelease, getSpanDescendants, getSpanStatusFromHttpCode, getTraceData, getTraceMetaTags, googleGenAIIntegration, graphqlIntegration, growthbookIntegration, hapiIntegration, httpHeadersToSpanAttributes, httpIntegration, httpServerIntegration, httpServerSpansIntegration, initOpenTelemetry, instrumentAnthropicAiClient, instrumentGoogleGenAIClient, instrumentLangChainEmbeddings, instrumentOpenAiClient, instrumentStateGraph, instrumentStateGraphCompile, instrumentSupabaseClient, isEnabled, isInitialized, kafkaIntegration, knexIntegration, koaIntegration, langChainIntegration, langGraphIntegration, lastEventId, launchDarklyIntegration, linkedErrorsIntegration, localVariablesIntegration, logger, lruMemoizerIntegration, makeNodeTransport, metrics, modulesIntegration, mongoIntegration, mongooseIntegration, mysql2Integration, mysqlIntegration, nativeNodeFetchIntegration, nodeContextIntegration, nodeRuntimeMetricsIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, openAIIntegration, openFeatureIntegration, otlpIntegration, parameterize, pinoIntegration, postgresIntegration, postgresJsIntegration, prismaIntegration, processSessionIntegration, profiler, redisIntegration, requestDataIntegration, setAttribute, setAttributes, setContext, setConversationId, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, setupExpressErrorHandler, setupHapiErrorHandler, setupKoaErrorHandler, spanStreamingIntegration, spanToBaggageHeader, spanToJSON, spanToStaticSpanJSON, spanToTraceHeader, spotlightIntegration, startInactiveSpan, startNewTrace, startSession, startSpan, startSpanManual, statsigIntegration, supabaseIntegration, suppressTracing, systemErrorIntegration, tediousIntegration, trpcMiddleware, unleashIntegration, updateSpanName, vercelAIIntegration, winterCGHeadersToDict, withActiveSpan, withIsolationScope, withMonitor, withScope, withStaticSpan, withStreamedSpan, workerThreadsIntegration, 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,5 +1,5 @@
|
|
|
1
1
|
import { RPC_METHOD, RPC_SERVICE, RPC_SYSTEM_NAME, SENTRY_OP } from '@sentry/conventions/attributes';
|
|
2
|
-
import {
|
|
2
|
+
import { GRPC } from '@sentry/conventions/op';
|
|
3
3
|
import { defineIntegration, fill, getClient, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
|
|
4
4
|
import { startInactiveSpan } from '@sentry/node';
|
|
5
5
|
|
|
@@ -54,33 +54,29 @@ function fillGrpcFunction(stub, serviceIdentifier, methodName) {
|
|
|
54
54
|
if (callType != "unary call") {
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
fill(
|
|
58
|
-
stub,
|
|
59
|
-
|
|
60
|
-
(orig) => (...args) => {
|
|
61
|
-
const ret = orig.apply(stub, args);
|
|
62
|
-
if (typeof ret?.on !== "function" || !SETUP_CLIENTS.has(getClient())) {
|
|
63
|
-
return ret;
|
|
64
|
-
}
|
|
65
|
-
const span = startInactiveSpan({
|
|
66
|
-
name: `${callType} ${methodName}`,
|
|
67
|
-
onlyIfParent: true,
|
|
68
|
-
attributes: {
|
|
69
|
-
[SENTRY_OP]: FAAS_GRPC_SPAN_OP,
|
|
70
|
-
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.grpc.serverless",
|
|
71
|
-
[RPC_SYSTEM_NAME]: "grpc",
|
|
72
|
-
[RPC_SERVICE]: serviceIdentifier,
|
|
73
|
-
[RPC_METHOD]: methodName
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
ret.on("status", () => {
|
|
77
|
-
if (span) {
|
|
78
|
-
span.end();
|
|
79
|
-
}
|
|
80
|
-
});
|
|
57
|
+
fill(stub, methodName, (orig) => (...args) => {
|
|
58
|
+
const ret = orig.apply(stub, args);
|
|
59
|
+
if (typeof ret?.on !== "function" || !SETUP_CLIENTS.has(getClient())) {
|
|
81
60
|
return ret;
|
|
82
61
|
}
|
|
83
|
-
|
|
62
|
+
const span = startInactiveSpan({
|
|
63
|
+
name: `${callType} ${methodName}`,
|
|
64
|
+
onlyIfParent: true,
|
|
65
|
+
attributes: {
|
|
66
|
+
[SENTRY_OP]: GRPC,
|
|
67
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.grpc.serverless",
|
|
68
|
+
[RPC_SYSTEM_NAME]: "grpc",
|
|
69
|
+
[RPC_SERVICE]: serviceIdentifier,
|
|
70
|
+
[RPC_METHOD]: methodName
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
ret.on("status", () => {
|
|
74
|
+
if (span) {
|
|
75
|
+
span.end();
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return ret;
|
|
79
|
+
});
|
|
84
80
|
}
|
|
85
81
|
function identifyService(servicePath) {
|
|
86
82
|
const match = servicePath.match(SERVICE_PATH_REGEX);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-cloud-grpc.js","sources":["../../../src/integrations/google-cloud-grpc.ts"],"sourcesContent":["import { RPC_METHOD, RPC_SERVICE, RPC_SYSTEM_NAME, SENTRY_OP } from '@sentry/conventions/attributes';\nimport {
|
|
1
|
+
{"version":3,"file":"google-cloud-grpc.js","sources":["../../../src/integrations/google-cloud-grpc.ts"],"sourcesContent":["import { RPC_METHOD, RPC_SERVICE, RPC_SYSTEM_NAME, SENTRY_OP } from '@sentry/conventions/attributes';\nimport { GRPC } from '@sentry/conventions/op';\nimport 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' as const;\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(stub, methodName, (orig: GrpcFunction): GrpcFunction => (...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 attributes: {\n [SENTRY_OP]: GRPC,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.grpc.serverless',\n [RPC_SYSTEM_NAME]: 'grpc',\n [RPC_SERVICE]: serviceIdentifier,\n [RPC_METHOD]: methodName,\n },\n });\n ret.on('status', () => {\n if (span) {\n span.end();\n }\n });\n return ret;\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":";;;;;AA6BA,MAAM,kBAAA,GAAqB,yBAAA;AAE3B,MAAM,gBAAA,GAAmB,iBAAA;AAEzB,MAAM,aAAA,uBAAoB,OAAA,EAAyB;AAEnD,MAAM,2BAAA,IAA+B,CAAC,OAAA,GAAkC,EAAC,KAAM;AAC7E,EAAA,MAAM,QAAA,GAAW,QAAQ,QAAA,IAAY,KAAA;AACrC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,IAAI;AAEF,QAAA,MAAM,SAAA,GAAY,QAAQ,YAAY,CAAA;AACtC,QAAA,IAAA;AAAA,UACE,UAAU,UAAA,CAAW,SAAA;AAAA;AAAA,UACrB,YAAA;AAAA,UACA;AAAA,SACF;AAAA,MACF,SAAS,CAAA,EAAG;AACV,QAAA,IAAI,CAAC,QAAA,EAAU;AACb,UAAA,MAAM,CAAA;AAAA,QACR;AAAA,MACF;AAAA,IACF,CAAA;AAAA,IACA,MAAM,MAAA,EAAQ;AACZ,MAAA,aAAA,CAAc,GAAA,CAAI,QAAQ,IAAI,CAAA;AAAA,IAChC;AAAA,GACF;AACF,CAAA,CAAA;AAKO,MAAM,0BAAA,GAA6B,kBAAkB,2BAA2B;AAGvF,SAAS,eAAe,UAAA,EAA4C;AAClE,EAAA,OAAO,kBAAkC,IAAA,EAAkC;AACzE,IAAA,MAAM,WAAA,GAAc,IAAA,CAAK,CAAC,CAAA,EAAG,WAAA;AAC7B,IAAA,IAAI,WAAA,IAAe,IAAA,IAAQ,WAAA,IAAe,MAAA,EAAW;AACnD,MAAA,OAAO,UAAA,CAAW,KAAA,CAAM,IAAA,EAAM,IAAI,CAAA;AAAA,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MAC/B,YAAA,EAAc,IAAA;AAAA,MACd,UAAA,EAAY;AAAA,QACV,CAAC,SAAS,GAAG,IAAA;AAAA,QACb,CAAC,gCAAgC,GAAG,sBAAA;AAAA,QACpC,CAAC,eAAe,GAAG,MAAA;AAAA,QACnB,CAAC,WAAW,GAAG,iBAAA;AAAA,QACf,CAAC,UAAU,GAAG;AAAA;AAChB,KACD,CAAA;AACD,IAAA,GAAA,CAAI,EAAA,CAAG,UAAU,MAAM;AACrB,MAAA,IAAI,IAAA,EAAM;AACR,QAAA,IAAA,CAAK,GAAA,EAAI;AAAA,MACX;AAAA,IACF,CAAC,CAAA;AACD,IAAA,OAAO,GAAA;AAAA,EACT,CAAC,CAAA;AACH;AAGA,SAAS,gBAAgB,WAAA,EAA6B;AACpD,EAAA,MAAM,KAAA,GAAQ,WAAA,CAAY,KAAA,CAAM,kBAAkB,CAAA;AAClD,EAAA,OAAO,KAAA,GAAQ,CAAC,CAAA,IAAK,WAAA;AACvB;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { URL_FULL, SERVER_ADDRESS, HTTP_REQUEST_METHOD, SENTRY_OP } from '@sentry/conventions/attributes';
|
|
2
|
-
import {
|
|
2
|
+
import { HTTP_CLIENT } from '@sentry/conventions/op';
|
|
3
3
|
import { defineIntegration, fill, getClient, filterCollectedUrl, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, stripUrlQueryAndFragment, SentryNonRecordingSpan, parseStringToURLObject, isURLObjectRelative } from '@sentry/core';
|
|
4
4
|
import { startInactiveSpan } from '@sentry/node';
|
|
5
5
|
|
|
@@ -33,7 +33,7 @@ function wrapRequestFunction(orig) {
|
|
|
33
33
|
name: `${httpMethod} ${stripUrlQueryAndFragment(reqOpts.uri)}`,
|
|
34
34
|
onlyIfParent: true,
|
|
35
35
|
attributes: {
|
|
36
|
-
[SENTRY_OP]:
|
|
36
|
+
[SENTRY_OP]: HTTP_CLIENT,
|
|
37
37
|
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.serverless",
|
|
38
38
|
[HTTP_REQUEST_METHOD]: httpMethod,
|
|
39
39
|
[SERVER_ADDRESS]: getServerAddress(this.apiEndpoint),
|
|
@@ -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 { HTTP_REQUEST_METHOD, SENTRY_OP, SERVER_ADDRESS, URL_FULL } from '@sentry/conventions/attributes';\nimport {
|
|
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 { HTTP_REQUEST_METHOD, SENTRY_OP, SERVER_ADDRESS, URL_FULL } from '@sentry/conventions/attributes';\nimport { HTTP_CLIENT } from '@sentry/conventions/op';\nimport type { Client, IntegrationFn } from '@sentry/core';\nimport {\n defineIntegration,\n fill,\n getClient,\n isURLObjectRelative,\n parseStringToURLObject,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SentryNonRecordingSpan,\n filterCollectedUrl,\n stripUrlQueryAndFragment,\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' as const;\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 // Span names must not contain a query string, and callers can pass any URI they want.\n name: `${httpMethod} ${stripUrlQueryAndFragment(reqOpts.uri)}`,\n onlyIfParent: true,\n attributes: {\n [SENTRY_OP]: HTTP_CLIENT,\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.http.serverless',\n [HTTP_REQUEST_METHOD]: httpMethod,\n [SERVER_ADDRESS]: getServerAddress(this.apiEndpoint),\n [URL_FULL]: filterCollectedUrl(reqOpts.uri),\n },\n })\n : new SentryNonRecordingSpan();\n orig.call(this, reqOpts, (...args: Parameters<ResponseCallback>) => {\n span.end();\n callback(...args);\n });\n };\n}\n\n/** Extracts the host of the API endpoint the request is sent to */\nfunction getServerAddress(apiEndpoint: string): string {\n const url = parseStringToURLObject(apiEndpoint);\n return url && !isURLObjectRelative(url) ? url.host : apiEndpoint;\n}\n"],"names":[],"mappings":";;;;;AAwBA,MAAM,gBAAA,GAAmB,iBAAA;AAEzB,MAAM,aAAA,uBAAoB,OAAA,EAAyB;AAEnD,MAAM,2BAAA,IAA+B,CAAC,OAAA,GAAkC,EAAC,KAAM;AAC7E,EAAA,MAAM,QAAA,GAAW,QAAQ,QAAA,IAAY,KAAA;AACrC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,IAAI;AAEF,QAAA,MAAM,YAAA,GAAe,QAAQ,sBAAsB,CA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AA,EACH,CAAA;AACF;AAGA,SAAS,iBAAiB,WAAA,EAA6B;AACrD,EAAA,MAAM,GAAA,GAAM,uBAAuB,WAAW,CAAA;AAC9C,EAAA,OAAO,OAAO,CAAC,mBAAA,CAAoB,GAAG,CAAA,GAAI,IAAI,IAAA,GAAO,WAAA;AACvD;;;;"}
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"11.0.0-alpha.
|
|
1
|
+
{"type":"module","version":"11.0.0-alpha.2","sideEffects":false}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud_events.d.ts","sourceRoot":"","sources":["../../../src/gcpfunction/cloud_events.ts"],"names":[],"mappings":"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/gcpfunction/events.ts"],"names":[],"mappings":"
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/gcpfunction/http.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/gcpfunction/http.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE9D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,YAAY,EAAE,WAAW,GAAE,OAAO,CAAC,cAAc,CAAM,GAAG,YAAY,CAY1G"}
|
package/build/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureCheckIn, captureFeedback, startSession, captureSession, endSession, withMonitor, createTransport, getClient, isInitialized, isEnabled, getCurrentScope, getGlobalScope, getIsolationScope, getTraceData, getTraceMetaTags, setCurrentClient, Scope, SDK_VERSION, setContext, setConversationId, setExtra, setExtras, setTag, setTags, setAttribute, setAttributes, setUser, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, makeNodeTransport, NodeClient, defaultStackParser, lastEventId, flush, close, getSentryRelease, createGetModuleFromFilename, createLangChainCallbackHandler, instrumentLangChainEmbeddings, httpHeadersToSpanAttributes, winterCGHeadersToDict, anrIntegration, disableAnrDetectionForCallback, consoleIntegration, httpIntegration, httpServerIntegration, httpServerSpansIntegration, nativeNodeFetchIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, openAIIntegration, langChainIntegration, langGraphIntegration, modulesIntegration, nodeRuntimeMetricsIntegration, type NodeRuntimeMetricsOptions, contextLinesIntegration, nodeContextIntegration, localVariablesIntegration, requestDataIntegration, fsIntegration, functionToStringIntegration, eventFiltersIntegration, linkedErrorsIntegration, setMeasurement, getActiveSpan, startSpan, startInactiveSpan, startSpanManual, startNewTrace, bindScopeToEmitter, suppressTracing, withActiveSpan, getRootSpan, getSpanDescendants, continueTrace, getAutoPerformanceIntegrations, cron, parameterize, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
|
|
1
|
+
export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureCheckIn, captureFeedback, startSession, captureSession, endSession, withMonitor, createTransport, getClient, isInitialized, isEnabled, getCurrentScope, getGlobalScope, getIsolationScope, getTraceData, getTraceMetaTags, setCurrentClient, Scope, SDK_VERSION, setContext, setConversationId, setExtra, setExtras, setTag, setTags, setAttribute, setAttributes, setUser, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, makeNodeTransport, NodeClient, defaultStackParser, lastEventId, flush, close, getSentryRelease, createGetModuleFromFilename, createLangChainCallbackHandler, instrumentLangChainEmbeddings, httpHeadersToSpanAttributes, winterCGHeadersToDict, anrIntegration, disableAnrDetectionForCallback, consoleIntegration, httpIntegration, httpServerIntegration, httpServerSpansIntegration, nativeNodeFetchIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, openAIIntegration, langChainIntegration, langGraphIntegration, modulesIntegration, nodeRuntimeMetricsIntegration, type NodeRuntimeMetricsOptions, contextLinesIntegration, nodeContextIntegration, localVariablesIntegration, requestDataIntegration, fsIntegration, functionToStringIntegration, eventFiltersIntegration, linkedErrorsIntegration, setMeasurement, getActiveSpan, startSpan, startInactiveSpan, startSpanManual, startNewTrace, bindScopeToEmitter, suppressTracing, withActiveSpan, getRootSpan, getSpanDescendants, continueTrace, getAutoPerformanceIntegrations, cron, parameterize, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SENTRY_SEGMENT_NAME_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, dataloaderIntegration, expressIntegration, expressErrorHandler, setupExpressErrorHandler, koaIntegration, setupKoaErrorHandler, fastifyIntegration, firebaseIntegration, genericPoolIntegration, graphqlIntegration, knexIntegration, kafkaIntegration, lruMemoizerIntegration, mongoIntegration, mongooseIntegration, mysqlIntegration, mysql2Integration, redisIntegration, tediousIntegration, pinoIntegration, postgresIntegration, postgresJsIntegration, prismaIntegration, otlpIntegration, getOtlpTracesEndpoint, processSessionIntegration, hapiIntegration, setupHapiErrorHandler, spotlightIntegration, initOpenTelemetry, spanToStaticSpanJSON, spanToJSON, spanToTraceHeader, spanToBaggageHeader, trpcMiddleware, updateSpanName, supabaseIntegration, systemErrorIntegration, instrumentSupabaseClient, instrumentOpenAiClient, instrumentAnthropicAiClient, instrumentGoogleGenAIClient, instrumentStateGraph, instrumentStateGraphCompile, zodErrorsIntegration, profiler, amqplibIntegration, anthropicAIIntegration, googleGenAIIntegration, childProcessIntegration, workerThreadsIntegration, createSentryWinstonTransport, vercelAIIntegration, logger, consoleLoggingIntegration, createConsolaReporter, wrapMcpServerWithSentry, NODE_VERSION, featureFlagsIntegration, type FeatureFlagsIntegration, launchDarklyIntegration, growthbookIntegration, buildLaunchDarklyFlagUsedHandler, openFeatureIntegration, OpenFeatureIntegrationHook, statsigIntegration, unleashIntegration, metrics, spanStreamingIntegration, withStaticSpan, withStreamedSpan, } 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,SAAS,EACT,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,EACL,WAAW,EACX,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,YAAY,EACZ,aAAa,EACb,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,8BAA8B,EAC9B,6BAA6B,EAC7B,2BAA2B,EAC3B,qBAAqB,EAErB,cAAc,EAEd,8BAA8B,EAC9B,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,0BAA0B,EAC1B,0BAA0B,EAC1B,8BAA8B,EAC9B,+BAA+B,EAC/B,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,6BAA6B,EAC7B,KAAK,yBAAyB,EAC9B,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,aAAa,EACb,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,cAAc,EACd,aAAa,EACb,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,8BAA8B,EAC9B,IAAI,EACJ,YAAY,EACZ,4BAA4B,EAC5B,gCAAgC,EAChC,
|
|
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,WAA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E,MAAM,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-cloud-grpc.d.ts","sourceRoot":"","sources":["../../../src/integrations/google-cloud-grpc.ts"],"names":[],"mappings":"AAKA,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;eA5BqB,OAAO;;;CA4BqB,CAAC;AAkBzF,0DAA0D;AAC1D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"google-cloud-grpc.d.ts","sourceRoot":"","sources":["../../../src/integrations/google-cloud-grpc.ts"],"names":[],"mappings":"AAKA,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;eA5BqB,OAAO;;;CA4BqB,CAAC;AAkBzF,0DAA0D;AAC1D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAuChG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/google-cloud-serverless",
|
|
3
|
-
"version": "11.0.0-alpha.
|
|
3
|
+
"version": "11.0.0-alpha.2",
|
|
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",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@sentry/conventions": "^0.
|
|
40
|
-
"@sentry/core": "11.0.0-alpha.
|
|
41
|
-
"@sentry/node": "11.0.0-alpha.
|
|
42
|
-
"@sentry/server-utils": "11.0.0-alpha.
|
|
39
|
+
"@sentry/conventions": "^0.20.0",
|
|
40
|
+
"@sentry/core": "11.0.0-alpha.2",
|
|
41
|
+
"@sentry/node": "11.0.0-alpha.2",
|
|
42
|
+
"@sentry/server-utils": "11.0.0-alpha.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@google-cloud/bigquery": "^5.3.0",
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"clean": "rimraf build coverage sentry-google-cloud-*.tgz",
|
|
70
70
|
"lint:fix": "oxlint . --fix --type-aware",
|
|
71
71
|
"lint": "oxlint . --type-aware",
|
|
72
|
+
"lint:types": "oxlint src --type-aware --type-check",
|
|
72
73
|
"lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module",
|
|
73
74
|
"test": "vitest run",
|
|
74
75
|
"test:watch": "vitest --watch",
|