@sentry/node 8.0.0-alpha.1 → 8.0.0-alpha.3
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/README.md +14 -93
- package/cjs/index.js +3665 -77
- package/cjs/index.js.map +1 -1
- package/esm/index.js +3614 -31
- package/esm/index.js.map +1 -1
- package/esm/integrations/anr/worker-script.js +2 -2
- package/esm/package.json +1 -0
- package/package.json +21 -6
- package/types/index.d.ts +6 -5
- package/types/index.d.ts.map +1 -1
- package/types/integrations/anr/index.d.ts.map +1 -1
- package/types/integrations/anr/worker-script.d.ts +1 -1
- package/types/integrations/anr/worker-script.d.ts.map +1 -1
- package/types/integrations/http.d.ts +4 -0
- package/types/integrations/http.d.ts.map +1 -1
- package/types/integrations/local-variables/common.d.ts +1 -0
- package/types/integrations/local-variables/common.d.ts.map +1 -1
- package/types/integrations/local-variables/local-variables-sync.d.ts +1 -0
- package/types/integrations/local-variables/local-variables-sync.d.ts.map +1 -1
- package/types/integrations/tracing/fastify.d.ts +9 -0
- package/types/integrations/tracing/fastify.d.ts.map +1 -1
- package/types/integrations/tracing/hapi/index.d.ts.map +1 -1
- package/types/integrations/tracing/prisma.d.ts.map +1 -1
- package/types/proxy/helpers.d.ts +2 -2
- package/types/proxy/helpers.d.ts.map +1 -1
- package/types/proxy/index.d.ts.map +1 -1
- package/types/sdk/hub.d.ts.map +1 -1
- package/types/sdk/init.d.ts.map +1 -1
- package/types/transports/http-module.d.ts +2 -2
- package/types/transports/http-module.d.ts.map +1 -1
- package/types/types.d.ts +12 -4
- package/types/types.d.ts.map +1 -1
- package/types-ts3.8/index.d.ts +6 -5
- package/types-ts3.8/integrations/anr/worker-script.d.ts +1 -1
- package/types-ts3.8/integrations/http.d.ts +4 -0
- package/types-ts3.8/integrations/local-variables/common.d.ts +1 -0
- package/types-ts3.8/integrations/local-variables/local-variables-sync.d.ts +1 -0
- package/types-ts3.8/integrations/tracing/fastify.d.ts +9 -0
- package/types-ts3.8/proxy/helpers.d.ts +2 -2
- package/types-ts3.8/transports/http-module.d.ts +2 -2
- package/types-ts3.8/types.d.ts +12 -4
- package/cjs/cron/common.js +0 -56
- package/cjs/cron/common.js.map +0 -1
- package/cjs/cron/cron.js +0 -102
- package/cjs/cron/cron.js.map +0 -1
- package/cjs/cron/index.js +0 -15
- package/cjs/cron/index.js.map +0 -1
- package/cjs/cron/node-cron.js +0 -61
- package/cjs/cron/node-cron.js.map +0 -1
- package/cjs/cron/node-schedule.js +0 -57
- package/cjs/cron/node-schedule.js.map +0 -1
- package/cjs/debug-build.js +0 -11
- package/cjs/debug-build.js.map +0 -1
- package/cjs/integrations/anr/index.js +0 -145
- package/cjs/integrations/anr/index.js.map +0 -1
- package/cjs/integrations/anr/worker-script.js +0 -2
- package/cjs/integrations/anr/worker-script.js.map +0 -1
- package/cjs/integrations/console.js +0 -40
- package/cjs/integrations/console.js.map +0 -1
- package/cjs/integrations/context.js +0 -435
- package/cjs/integrations/context.js.map +0 -1
- package/cjs/integrations/contextlines.js +0 -137
- package/cjs/integrations/contextlines.js.map +0 -1
- package/cjs/integrations/http.js +0 -137
- package/cjs/integrations/http.js.map +0 -1
- package/cjs/integrations/local-variables/common.js +0 -87
- package/cjs/integrations/local-variables/common.js.map +0 -1
- package/cjs/integrations/local-variables/index.js +0 -8
- package/cjs/integrations/local-variables/index.js.map +0 -1
- package/cjs/integrations/local-variables/local-variables-sync.js +0 -400
- package/cjs/integrations/local-variables/local-variables-sync.js.map +0 -1
- package/cjs/integrations/modules.js +0 -99
- package/cjs/integrations/modules.js.map +0 -1
- package/cjs/integrations/node-fetch.js +0 -82
- package/cjs/integrations/node-fetch.js.map +0 -1
- package/cjs/integrations/onuncaughtexception.js +0 -137
- package/cjs/integrations/onuncaughtexception.js.map +0 -1
- package/cjs/integrations/onunhandledrejection.js +0 -90
- package/cjs/integrations/onunhandledrejection.js.map +0 -1
- package/cjs/integrations/spotlight.js +0 -109
- package/cjs/integrations/spotlight.js.map +0 -1
- package/cjs/integrations/tracing/express.js +0 -103
- package/cjs/integrations/tracing/express.js.map +0 -1
- package/cjs/integrations/tracing/fastify.js +0 -33
- package/cjs/integrations/tracing/fastify.js.map +0 -1
- package/cjs/integrations/tracing/graphql.js +0 -34
- package/cjs/integrations/tracing/graphql.js.map +0 -1
- package/cjs/integrations/tracing/hapi/index.js +0 -81
- package/cjs/integrations/tracing/hapi/index.js.map +0 -1
- package/cjs/integrations/tracing/index.js +0 -37
- package/cjs/integrations/tracing/index.js.map +0 -1
- package/cjs/integrations/tracing/koa.js +0 -21
- package/cjs/integrations/tracing/koa.js.map +0 -1
- package/cjs/integrations/tracing/mongo.js +0 -33
- package/cjs/integrations/tracing/mongo.js.map +0 -1
- package/cjs/integrations/tracing/mongoose.js +0 -33
- package/cjs/integrations/tracing/mongoose.js.map +0 -1
- package/cjs/integrations/tracing/mysql.js +0 -26
- package/cjs/integrations/tracing/mysql.js.map +0 -1
- package/cjs/integrations/tracing/mysql2.js +0 -33
- package/cjs/integrations/tracing/mysql2.js.map +0 -1
- package/cjs/integrations/tracing/nest.js +0 -26
- package/cjs/integrations/tracing/nest.js.map +0 -1
- package/cjs/integrations/tracing/postgres.js +0 -34
- package/cjs/integrations/tracing/postgres.js.map +0 -1
- package/cjs/integrations/tracing/prisma.js +0 -33
- package/cjs/integrations/tracing/prisma.js.map +0 -1
- package/cjs/nodeVersion.js +0 -12
- package/cjs/nodeVersion.js.map +0 -1
- package/cjs/otel/contextManager.js +0 -16
- package/cjs/otel/contextManager.js.map +0 -1
- package/cjs/proxy/base.js +0 -126
- package/cjs/proxy/base.js.map +0 -1
- package/cjs/proxy/index.js +0 -209
- package/cjs/proxy/index.js.map +0 -1
- package/cjs/proxy/parse-proxy-response.js +0 -104
- package/cjs/proxy/parse-proxy-response.js.map +0 -1
- package/cjs/sdk/api.js +0 -74
- package/cjs/sdk/api.js.map +0 -1
- package/cjs/sdk/client.js +0 -57
- package/cjs/sdk/client.js.map +0 -1
- package/cjs/sdk/hub.js +0 -104
- package/cjs/sdk/hub.js.map +0 -1
- package/cjs/sdk/init.js +0 -224
- package/cjs/sdk/init.js.map +0 -1
- package/cjs/sdk/initOtel.js +0 -70
- package/cjs/sdk/initOtel.js.map +0 -1
- package/cjs/sdk/scope.js +0 -18
- package/cjs/sdk/scope.js.map +0 -1
- package/cjs/transports/http.js +0 -160
- package/cjs/transports/http.js.map +0 -1
- package/cjs/utils/addOriginToSpan.js +0 -11
- package/cjs/utils/addOriginToSpan.js.map +0 -1
- package/cjs/utils/errorhandling.js +0 -44
- package/cjs/utils/errorhandling.js.map +0 -1
- package/cjs/utils/getRequestUrl.js +0 -18
- package/cjs/utils/getRequestUrl.js.map +0 -1
- package/cjs/utils/module.js +0 -62
- package/cjs/utils/module.js.map +0 -1
- package/esm/cron/common.js +0 -54
- package/esm/cron/common.js.map +0 -1
- package/esm/cron/cron.js +0 -100
- package/esm/cron/cron.js.map +0 -1
- package/esm/cron/index.js +0 -13
- package/esm/cron/index.js.map +0 -1
- package/esm/cron/node-cron.js +0 -56
- package/esm/cron/node-cron.js.map +0 -1
- package/esm/cron/node-schedule.js +0 -55
- package/esm/cron/node-schedule.js.map +0 -1
- package/esm/debug-build.js +0 -9
- package/esm/debug-build.js.map +0 -1
- package/esm/integrations/anr/index.js +0 -139
- package/esm/integrations/anr/index.js.map +0 -1
- package/esm/integrations/anr/worker-script.js.map +0 -1
- package/esm/integrations/console.js +0 -38
- package/esm/integrations/console.js.map +0 -1
- package/esm/integrations/context.js +0 -427
- package/esm/integrations/context.js.map +0 -1
- package/esm/integrations/contextlines.js +0 -131
- package/esm/integrations/contextlines.js.map +0 -1
- package/esm/integrations/http.js +0 -132
- package/esm/integrations/http.js.map +0 -1
- package/esm/integrations/local-variables/common.js +0 -81
- package/esm/integrations/local-variables/common.js.map +0 -1
- package/esm/integrations/local-variables/index.js +0 -6
- package/esm/integrations/local-variables/index.js.map +0 -1
- package/esm/integrations/local-variables/local-variables-sync.js +0 -394
- package/esm/integrations/local-variables/local-variables-sync.js.map +0 -1
- package/esm/integrations/modules.js +0 -97
- package/esm/integrations/modules.js.map +0 -1
- package/esm/integrations/node-fetch.js +0 -80
- package/esm/integrations/node-fetch.js.map +0 -1
- package/esm/integrations/onuncaughtexception.js +0 -134
- package/esm/integrations/onuncaughtexception.js.map +0 -1
- package/esm/integrations/onunhandledrejection.js +0 -87
- package/esm/integrations/onunhandledrejection.js.map +0 -1
- package/esm/integrations/spotlight.js +0 -106
- package/esm/integrations/spotlight.js.map +0 -1
- package/esm/integrations/tracing/express.js +0 -96
- package/esm/integrations/tracing/express.js.map +0 -1
- package/esm/integrations/tracing/fastify.js +0 -31
- package/esm/integrations/tracing/fastify.js.map +0 -1
- package/esm/integrations/tracing/graphql.js +0 -32
- package/esm/integrations/tracing/graphql.js.map +0 -1
- package/esm/integrations/tracing/hapi/index.js +0 -77
- package/esm/integrations/tracing/hapi/index.js.map +0 -1
- package/esm/integrations/tracing/index.js +0 -35
- package/esm/integrations/tracing/index.js.map +0 -1
- package/esm/integrations/tracing/koa.js +0 -19
- package/esm/integrations/tracing/koa.js.map +0 -1
- package/esm/integrations/tracing/mongo.js +0 -31
- package/esm/integrations/tracing/mongo.js.map +0 -1
- package/esm/integrations/tracing/mongoose.js +0 -31
- package/esm/integrations/tracing/mongoose.js.map +0 -1
- package/esm/integrations/tracing/mysql.js +0 -24
- package/esm/integrations/tracing/mysql.js.map +0 -1
- package/esm/integrations/tracing/mysql2.js +0 -31
- package/esm/integrations/tracing/mysql2.js.map +0 -1
- package/esm/integrations/tracing/nest.js +0 -24
- package/esm/integrations/tracing/nest.js.map +0 -1
- package/esm/integrations/tracing/postgres.js +0 -32
- package/esm/integrations/tracing/postgres.js.map +0 -1
- package/esm/integrations/tracing/prisma.js +0 -31
- package/esm/integrations/tracing/prisma.js.map +0 -1
- package/esm/nodeVersion.js +0 -9
- package/esm/nodeVersion.js.map +0 -1
- package/esm/otel/contextManager.js +0 -14
- package/esm/otel/contextManager.js.map +0 -1
- package/esm/proxy/base.js +0 -121
- package/esm/proxy/base.js.map +0 -1
- package/esm/proxy/index.js +0 -203
- package/esm/proxy/index.js.map +0 -1
- package/esm/proxy/parse-proxy-response.js +0 -102
- package/esm/proxy/parse-proxy-response.js.map +0 -1
- package/esm/sdk/api.js +0 -69
- package/esm/sdk/api.js.map +0 -1
- package/esm/sdk/client.js +0 -52
- package/esm/sdk/client.js.map +0 -1
- package/esm/sdk/hub.js +0 -102
- package/esm/sdk/hub.js.map +0 -1
- package/esm/sdk/init.js +0 -221
- package/esm/sdk/init.js.map +0 -1
- package/esm/sdk/initOtel.js +0 -67
- package/esm/sdk/initOtel.js.map +0 -1
- package/esm/sdk/scope.js +0 -16
- package/esm/sdk/scope.js.map +0 -1
- package/esm/transports/http.js +0 -155
- package/esm/transports/http.js.map +0 -1
- package/esm/utils/addOriginToSpan.js +0 -9
- package/esm/utils/addOriginToSpan.js.map +0 -1
- package/esm/utils/errorhandling.js +0 -42
- package/esm/utils/errorhandling.js.map +0 -1
- package/esm/utils/getRequestUrl.js +0 -16
- package/esm/utils/getRequestUrl.js.map +0 -1
- package/esm/utils/module.js +0 -60
- package/esm/utils/module.js.map +0 -1
- package/types/integrations/local-variables/local-variables-async.d.ts +0 -14
- package/types/integrations/local-variables/local-variables-async.d.ts.map +0 -1
- package/types-ts3.8/integrations/local-variables/local-variables-async.d.ts +0 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/prisma.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/prisma.ts"],"names":[],"mappings":"AAoBA;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,mDAAwC,CAAC"}
|
package/types/proxy/helpers.d.ts
CHANGED
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
/// <reference types="node" />
|
|
31
31
|
/// <reference types="node" />
|
|
32
32
|
/// <reference types="node" />
|
|
33
|
-
import * as http from 'http';
|
|
34
|
-
import * as https from 'https';
|
|
33
|
+
import * as http from 'node:http';
|
|
34
|
+
import * as https from 'node:https';
|
|
35
35
|
import type { Readable } from 'stream';
|
|
36
36
|
export type ThenableRequest = http.ClientRequest & {
|
|
37
37
|
then: Promise<http.IncomingMessage>['then'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/proxy/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;;AAGH,OAAO,KAAK,IAAI,MAAM,
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/proxy/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;;AAGH,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,GAAG;IACjD,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;CAC7C,CAAC;AAEF,wBAAsB,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAQhE;AAGD,wBAAsB,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAUzD;AAED,wBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,GAAE,KAAK,CAAC,cAAmB,GAAG,eAAe,CAQvF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/proxy/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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,CAAE,SAAQ,KAAK;IAC5D,MAAM,CAAC,SAAS,6BAA8B;IAE9C,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC;IACpB,YAAY,EAAE,mBAAmB,GAAG,CAAC,MAAM,mBAAmB,CAAC,CAAC;IAChE,WAAW,EAAE,GAAG,CAAC,iBAAiB,GAAG,GAAG,CAAC,iBAAiB,CAAC;gBAE/C,KAAK,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,sBAAsB,CAAC,GAAG,CAAC;IAmBhE;;;OAGG;IACG,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;CAiGpF"}
|
package/types/sdk/hub.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hub.d.ts","sourceRoot":"","sources":["../../../src/sdk/hub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"hub.d.ts","sourceRoot":"","sources":["../../../src/sdk/hub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,GAAG,EAAuD,MAAM,eAAe,CAAC;AAmBjH;;;GAGG;AACH,wBAAgB,aAAa,IAAI,GAAG,CAkEnC"}
|
package/types/sdk/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/sdk/init.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAU,WAAW,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAsBlE,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/sdk/init.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAU,WAAW,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAsBlE,OAAO,KAAK,EAAqB,WAAW,EAAE,MAAM,UAAU,CAAC;AAS/D,kEAAkE;AAClE,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,EAAE,CAsBtE;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,GAAE,WAAW,GAAG,SAAc,GAAG,IAAI,CAuDhE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
/// <reference types="node" />
|
|
4
|
-
import type { ClientRequest, IncomingHttpHeaders, RequestOptions as HTTPRequestOptions } from 'http';
|
|
5
|
-
import type { RequestOptions as HTTPSRequestOptions } from 'https';
|
|
4
|
+
import type { ClientRequest, IncomingHttpHeaders, RequestOptions as HTTPRequestOptions } from 'node:http';
|
|
5
|
+
import type { RequestOptions as HTTPSRequestOptions } from 'node:https';
|
|
6
6
|
export type HTTPModuleRequestOptions = HTTPRequestOptions | HTTPSRequestOptions | string | URL;
|
|
7
7
|
/**
|
|
8
8
|
* Cut version of http.IncomingMessage.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-module.d.ts","sourceRoot":"","sources":["../../../src/transports/http-module.ts"],"names":[],"mappings":";;;AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"http-module.d.ts","sourceRoot":"","sources":["../../../src/transports/http-module.ts"],"names":[],"mappings":";;;AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAC1G,OAAO,KAAK,EAAE,cAAc,IAAI,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAExE,MAAM,MAAM,wBAAwB,GAAG,kBAAkB,GAAG,mBAAmB,GAAG,MAAM,GAAG,GAAG,CAAC;AAE/F;;;GAGG;AACH,MAAM,WAAW,gCAAgC;IAC/C,OAAO,EAAE,mBAAmB,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACtD,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,OAAO,CAAC,OAAO,EAAE,wBAAwB,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,gCAAgC,KAAK,IAAI,GAAG,aAAa,CAAC;CACvH"}
|
package/types/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Span as WriteableSpan } from '@opentelemetry/api';
|
|
2
|
-
import type { ReadableSpan
|
|
3
|
-
import type { ClientOptions, Options, SamplingContext, Scope, TracePropagationTargets } from '@sentry/types';
|
|
2
|
+
import type { ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
3
|
+
import type { ClientOptions, Options, SamplingContext, Scope, Span, TracePropagationTargets } from '@sentry/types';
|
|
4
4
|
import type { NodeTransportOptions } from './transports';
|
|
5
5
|
export interface BaseNodeOptions {
|
|
6
6
|
/**
|
|
@@ -56,6 +56,15 @@ export interface BaseNodeOptions {
|
|
|
56
56
|
* IMPORTANT: Only set this option to `true` while developing, not in production!
|
|
57
57
|
*/
|
|
58
58
|
spotlight?: boolean | string;
|
|
59
|
+
/**
|
|
60
|
+
* If this is set to true, the SDK will not set up OpenTelemetry automatically.
|
|
61
|
+
* In this case, you _have_ to ensure to set it up correctly yourself, including:
|
|
62
|
+
* * The `SentrySpanProcessor`
|
|
63
|
+
* * The `SentryPropagator`
|
|
64
|
+
* * The `SentryContextManager`
|
|
65
|
+
* * The `SentrySampler`
|
|
66
|
+
*/
|
|
67
|
+
skipOpenTelemetrySetup?: boolean;
|
|
59
68
|
/** Callback that is executed when a fatal global error occurs. */
|
|
60
69
|
onFatalError?(this: void, error: Error): void;
|
|
61
70
|
}
|
|
@@ -84,6 +93,5 @@ export interface CurrentScopes {
|
|
|
84
93
|
* Note that technically, the `Span` exported from `@opentelemwetry/sdk-trace-base` matches this,
|
|
85
94
|
* but we cannot be 100% sure that we are actually getting such a span, so this type is more defensive.
|
|
86
95
|
*/
|
|
87
|
-
export type AbstractSpan = WriteableSpan | ReadableSpan;
|
|
88
|
-
export type { Span };
|
|
96
|
+
export type AbstractSpan = WriteableSpan | ReadableSpan | Span;
|
|
89
97
|
//# sourceMappingURL=types.d.ts.map
|
package/types/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAEnH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEzD,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;;;;;;;OAeG;IACH,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;IAElD;;OAEG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,EAAE,CAAC,eAAe,EAAE,eAAe,KAAK,MAAM,GAAG,OAAO,CAAC;IAEzE,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;;;;OASG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAE7B;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAEjC,kEAAkE;IAClE,YAAY,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,OAAO,CAAC,oBAAoB,CAAC,EAAE,eAAe;CAAG;AAEtF;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,aAAa,CAAC,oBAAoB,CAAC,EAAE,eAAe;CAAG;AAElG,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,KAAK,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,YAAY,GAAG,IAAI,CAAC"}
|
package/types-ts3.8/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { onUncaughtExceptionIntegration } from './integrations/onuncaughtexcepti
|
|
|
9
9
|
export { onUnhandledRejectionIntegration } from './integrations/onunhandledrejection';
|
|
10
10
|
export { anrIntegration } from './integrations/anr';
|
|
11
11
|
export { expressIntegration, expressErrorHandler, setupExpressErrorHandler } from './integrations/tracing/express';
|
|
12
|
-
export { fastifyIntegration } from './integrations/tracing/fastify';
|
|
12
|
+
export { fastifyIntegration, setupFastifyErrorHandler } from './integrations/tracing/fastify';
|
|
13
13
|
export { graphqlIntegration } from './integrations/tracing/graphql';
|
|
14
14
|
export { mongoIntegration } from './integrations/tracing/mongo';
|
|
15
15
|
export { mongooseIntegration } from './integrations/tracing/mongoose';
|
|
@@ -19,6 +19,7 @@ export { nestIntegration } from './integrations/tracing/nest';
|
|
|
19
19
|
export { postgresIntegration } from './integrations/tracing/postgres';
|
|
20
20
|
export { prismaIntegration } from './integrations/tracing/prisma';
|
|
21
21
|
export { hapiIntegration, setupHapiErrorHandler } from './integrations/tracing/hapi';
|
|
22
|
+
export { spotlightIntegration } from './integrations/spotlight';
|
|
22
23
|
export { init, getDefaultIntegrations } from './sdk/init';
|
|
23
24
|
export { getAutoPerformanceIntegrations } from './integrations/tracing';
|
|
24
25
|
export { getClient, getSentryRelease, defaultStackParser, makeMain, } from './sdk/api';
|
|
@@ -27,9 +28,9 @@ export { makeNodeTransport } from './transports';
|
|
|
27
28
|
export { NodeClient } from './sdk/client';
|
|
28
29
|
export { getCurrentHub } from './sdk/hub';
|
|
29
30
|
export { cron } from './cron';
|
|
30
|
-
export {
|
|
31
|
-
export { startSpan, startSpanManual, startInactiveSpan, getActiveSpan, withActiveSpan, } from '@sentry/opentelemetry';
|
|
31
|
+
export { NodeOptions } from './types';
|
|
32
32
|
export { addRequestDataToEvent, DEFAULT_USER_INCLUDES, extractRequestData, } from '@sentry/utils';
|
|
33
|
-
export {
|
|
34
|
-
export {
|
|
33
|
+
export { continueTrace } from '@sentry/opentelemetry';
|
|
34
|
+
export { addBreadcrumb, isInitialized, getGlobalScope, close, createTransport, flush, Hub, SDK_VERSION, getSpanStatusFromHttpCode, setHttpStatus, captureCheckIn, withMonitor, requestDataIntegration, functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, addEventProcessor, setContext, setExtra, setExtras, setTag, setTags, setUser, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, setCurrentClient, Scope, setMeasurement, getSpanDescendants, parameterize, getCurrentScope, getIsolationScope, withScope, withIsolationScope, captureException, captureEvent, captureMessage, captureConsoleIntegration, debugIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration, sessionTimingIntegration, metricsDefault as metrics, startSession, captureSession, endSession, addIntegration, startSpan, startSpanManual, startInactiveSpan, getActiveSpan, withActiveSpan, getRootSpan, } from '@sentry/core';
|
|
35
|
+
export { Breadcrumb, BreadcrumbHint, PolymorphicRequest, Request, SdkInfo, Event, EventHint, Exception, Session, SeverityLevel, StackFrame, Stacktrace, Thread, Transaction, User, Span, } from '@sentry/types';
|
|
35
36
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const base64WorkerScript = "";
|
|
1
|
+
export declare const base64WorkerScript = "###base64WorkerScript###";
|
|
2
2
|
//# sourceMappingURL=worker-script.d.ts.map
|
|
@@ -15,6 +15,10 @@ interface HttpOptions {
|
|
|
15
15
|
*/
|
|
16
16
|
ignoreIncomingRequests?: (url: string) => boolean;
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* The http integration instruments Node's internal http and https modules.
|
|
20
|
+
* It creates breadcrumbs and spans for outgoing HTTP requests which will be attached to the currently active span.
|
|
21
|
+
*/
|
|
18
22
|
export declare const httpIntegration: (options?: HttpOptions | undefined) => import("@sentry/types").IntegrationFnResult;
|
|
19
23
|
export {};
|
|
20
24
|
//# sourceMappingURL=http.d.ts.map
|
|
@@ -4,4 +4,13 @@
|
|
|
4
4
|
* Capture tracing data for fastify.
|
|
5
5
|
*/
|
|
6
6
|
export declare const fastifyIntegration: () => import("@sentry/types").IntegrationFnResult;
|
|
7
|
+
interface Fastify {
|
|
8
|
+
register: (plugin: unknown) => void;
|
|
9
|
+
addHook: (hook: string, handler: (request: unknown, reply: unknown, error: Error) => void) => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Setup an error handler for Fastify.
|
|
13
|
+
*/
|
|
14
|
+
export declare function setupFastifyErrorHandler(fastify: Fastify): void;
|
|
15
|
+
export {};
|
|
7
16
|
//# sourceMappingURL=fastify.d.ts.map
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
27
27
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
28
28
|
*/
|
|
29
|
-
import * as http from 'http';
|
|
30
|
-
import * as https from 'https';
|
|
29
|
+
import * as http from 'node:http';
|
|
30
|
+
import * as https from 'node:https';
|
|
31
31
|
import { Readable } from 'stream';
|
|
32
32
|
export type ThenableRequest = http.ClientRequest & {
|
|
33
33
|
then: Promise<http.IncomingMessage>['then'];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { ClientRequest, IncomingHttpHeaders, RequestOptions as HTTPRequestOptions } from 'http';
|
|
3
|
-
import { RequestOptions as HTTPSRequestOptions } from 'https';
|
|
2
|
+
import { ClientRequest, IncomingHttpHeaders, RequestOptions as HTTPRequestOptions } from 'node:http';
|
|
3
|
+
import { RequestOptions as HTTPSRequestOptions } from 'node:https';
|
|
4
4
|
export type HTTPModuleRequestOptions = HTTPRequestOptions | HTTPSRequestOptions | string | URL;
|
|
5
5
|
/**
|
|
6
6
|
* Cut version of http.IncomingMessage.
|
package/types-ts3.8/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Span as WriteableSpan } from '@opentelemetry/api';
|
|
2
|
-
import { ReadableSpan
|
|
3
|
-
import { ClientOptions, Options, SamplingContext, Scope, TracePropagationTargets } from '@sentry/types';
|
|
2
|
+
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
3
|
+
import { ClientOptions, Options, SamplingContext, Scope, Span, TracePropagationTargets } from '@sentry/types';
|
|
4
4
|
import { NodeTransportOptions } from './transports';
|
|
5
5
|
export interface BaseNodeOptions {
|
|
6
6
|
/**
|
|
@@ -56,6 +56,15 @@ export interface BaseNodeOptions {
|
|
|
56
56
|
* IMPORTANT: Only set this option to `true` while developing, not in production!
|
|
57
57
|
*/
|
|
58
58
|
spotlight?: boolean | string;
|
|
59
|
+
/**
|
|
60
|
+
* If this is set to true, the SDK will not set up OpenTelemetry automatically.
|
|
61
|
+
* In this case, you _have_ to ensure to set it up correctly yourself, including:
|
|
62
|
+
* * The `SentrySpanProcessor`
|
|
63
|
+
* * The `SentryPropagator`
|
|
64
|
+
* * The `SentryContextManager`
|
|
65
|
+
* * The `SentrySampler`
|
|
66
|
+
*/
|
|
67
|
+
skipOpenTelemetrySetup?: boolean;
|
|
59
68
|
/** Callback that is executed when a fatal global error occurs. */
|
|
60
69
|
onFatalError?(this: void, error: Error): void;
|
|
61
70
|
}
|
|
@@ -84,6 +93,5 @@ export interface CurrentScopes {
|
|
|
84
93
|
* Note that technically, the `Span` exported from `@opentelemwetry/sdk-trace-base` matches this,
|
|
85
94
|
* but we cannot be 100% sure that we are actually getting such a span, so this type is more defensive.
|
|
86
95
|
*/
|
|
87
|
-
export type AbstractSpan = WriteableSpan | ReadableSpan;
|
|
88
|
-
export { Span };
|
|
96
|
+
export type AbstractSpan = WriteableSpan | ReadableSpan | Span;
|
|
89
97
|
//# sourceMappingURL=types.d.ts.map
|
package/cjs/cron/common.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
|
|
3
|
-
const replacements = [
|
|
4
|
-
['january', '1'],
|
|
5
|
-
['february', '2'],
|
|
6
|
-
['march', '3'],
|
|
7
|
-
['april', '4'],
|
|
8
|
-
['may', '5'],
|
|
9
|
-
['june', '6'],
|
|
10
|
-
['july', '7'],
|
|
11
|
-
['august', '8'],
|
|
12
|
-
['september', '9'],
|
|
13
|
-
['october', '10'],
|
|
14
|
-
['november', '11'],
|
|
15
|
-
['december', '12'],
|
|
16
|
-
['jan', '1'],
|
|
17
|
-
['feb', '2'],
|
|
18
|
-
['mar', '3'],
|
|
19
|
-
['apr', '4'],
|
|
20
|
-
['may', '5'],
|
|
21
|
-
['jun', '6'],
|
|
22
|
-
['jul', '7'],
|
|
23
|
-
['aug', '8'],
|
|
24
|
-
['sep', '9'],
|
|
25
|
-
['oct', '10'],
|
|
26
|
-
['nov', '11'],
|
|
27
|
-
['dec', '12'],
|
|
28
|
-
['sunday', '0'],
|
|
29
|
-
['monday', '1'],
|
|
30
|
-
['tuesday', '2'],
|
|
31
|
-
['wednesday', '3'],
|
|
32
|
-
['thursday', '4'],
|
|
33
|
-
['friday', '5'],
|
|
34
|
-
['saturday', '6'],
|
|
35
|
-
['sun', '0'],
|
|
36
|
-
['mon', '1'],
|
|
37
|
-
['tue', '2'],
|
|
38
|
-
['wed', '3'],
|
|
39
|
-
['thu', '4'],
|
|
40
|
-
['fri', '5'],
|
|
41
|
-
['sat', '6'],
|
|
42
|
-
];
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Replaces names in cron expressions
|
|
46
|
-
*/
|
|
47
|
-
function replaceCronNames(cronExpression) {
|
|
48
|
-
return replacements.reduce(
|
|
49
|
-
// eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor
|
|
50
|
-
(acc, [name, replacement]) => acc.replace(new RegExp(name, 'gi'), replacement),
|
|
51
|
-
cronExpression,
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
exports.replaceCronNames = replaceCronNames;
|
|
56
|
-
//# sourceMappingURL=common.js.map
|
package/cjs/cron/common.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sources":["../../../src/cron/common.ts"],"sourcesContent":["const replacements: [string, string][] = [\n ['january', '1'],\n ['february', '2'],\n ['march', '3'],\n ['april', '4'],\n ['may', '5'],\n ['june', '6'],\n ['july', '7'],\n ['august', '8'],\n ['september', '9'],\n ['october', '10'],\n ['november', '11'],\n ['december', '12'],\n ['jan', '1'],\n ['feb', '2'],\n ['mar', '3'],\n ['apr', '4'],\n ['may', '5'],\n ['jun', '6'],\n ['jul', '7'],\n ['aug', '8'],\n ['sep', '9'],\n ['oct', '10'],\n ['nov', '11'],\n ['dec', '12'],\n ['sunday', '0'],\n ['monday', '1'],\n ['tuesday', '2'],\n ['wednesday', '3'],\n ['thursday', '4'],\n ['friday', '5'],\n ['saturday', '6'],\n ['sun', '0'],\n ['mon', '1'],\n ['tue', '2'],\n ['wed', '3'],\n ['thu', '4'],\n ['fri', '5'],\n ['sat', '6'],\n];\n\n/**\n * Replaces names in cron expressions\n */\nexport function replaceCronNames(cronExpression: string): string {\n return replacements.reduce(\n // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\n (acc, [name, replacement]) => acc.replace(new RegExp(name, 'gi'), replacement),\n cronExpression,\n );\n}\n"],"names":[],"mappings":";;AAAA,MAAM,YAAY,GAAuB;AACzC,EAAE,CAAC,SAAS,EAAE,GAAG,CAAC;AAClB,EAAE,CAAC,UAAU,EAAE,GAAG,CAAC;AACnB,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC;AAChB,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC;AAChB,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC;AACf,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC;AACf,EAAE,CAAC,QAAQ,EAAE,GAAG,CAAC;AACjB,EAAE,CAAC,WAAW,EAAE,GAAG,CAAC;AACpB,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;AACnB,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC;AACpB,EAAE,CAAC,UAAU,EAAE,IAAI,CAAC;AACpB,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;AACf,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;AACf,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;AACf,EAAE,CAAC,QAAQ,EAAE,GAAG,CAAC;AACjB,EAAE,CAAC,QAAQ,EAAE,GAAG,CAAC;AACjB,EAAE,CAAC,SAAS,EAAE,GAAG,CAAC;AAClB,EAAE,CAAC,WAAW,EAAE,GAAG,CAAC;AACpB,EAAE,CAAC,UAAU,EAAE,GAAG,CAAC;AACnB,EAAE,CAAC,QAAQ,EAAE,GAAG,CAAC;AACjB,EAAE,CAAC,UAAU,EAAE,GAAG,CAAC;AACnB,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,EAAE,CAAC,KAAK,EAAE,GAAG,CAAC;AACd,CAAC,CAAA;AACD;AACA;AACA;AACA;AACO,SAAS,gBAAgB,CAAC,cAAc,EAAkB;AACjE,EAAE,OAAO,YAAY,CAAC,MAAM;AAC5B;AACA,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,WAAW,CAAC,KAAK,GAAG,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,WAAW,CAAC;AAClF,IAAI,cAAc;AAClB,GAAG,CAAA;AACH;;;;"}
|
package/cjs/cron/cron.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
|
|
3
|
-
const core = require('@sentry/core');
|
|
4
|
-
const common = require('./common.js');
|
|
5
|
-
|
|
6
|
-
const ERROR_TEXT = 'Automatic instrumentation of CronJob only supports crontab string';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Instruments the `cron` library to send a check-in event to Sentry for each job execution.
|
|
10
|
-
*
|
|
11
|
-
* ```ts
|
|
12
|
-
* import * as Sentry from '@sentry/node';
|
|
13
|
-
* import { CronJob } from 'cron';
|
|
14
|
-
*
|
|
15
|
-
* const CronJobWithCheckIn = Sentry.cron.instrumentCron(CronJob, 'my-cron-job');
|
|
16
|
-
*
|
|
17
|
-
* // use the constructor
|
|
18
|
-
* const job = new CronJobWithCheckIn('* * * * *', () => {
|
|
19
|
-
* console.log('You will see this message every minute');
|
|
20
|
-
* });
|
|
21
|
-
*
|
|
22
|
-
* // or from
|
|
23
|
-
* const job = CronJobWithCheckIn.from({ cronTime: '* * * * *', onTick: () => {
|
|
24
|
-
* console.log('You will see this message every minute');
|
|
25
|
-
* });
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
function instrumentCron(lib, monitorSlug) {
|
|
29
|
-
let jobScheduled = false;
|
|
30
|
-
|
|
31
|
-
return new Proxy(lib, {
|
|
32
|
-
construct(target, args) {
|
|
33
|
-
const [cronTime, onTick, onComplete, start, timeZone, ...rest] = args;
|
|
34
|
-
|
|
35
|
-
if (typeof cronTime !== 'string') {
|
|
36
|
-
throw new Error(ERROR_TEXT);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (jobScheduled) {
|
|
40
|
-
throw new Error(`A job named '${monitorSlug}' has already been scheduled`);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
jobScheduled = true;
|
|
44
|
-
|
|
45
|
-
const cronString = common.replaceCronNames(cronTime);
|
|
46
|
-
|
|
47
|
-
function monitoredTick(context, onComplete) {
|
|
48
|
-
return core.withMonitor(
|
|
49
|
-
monitorSlug,
|
|
50
|
-
() => {
|
|
51
|
-
return onTick(context, onComplete);
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
schedule: { type: 'crontab', value: cronString },
|
|
55
|
-
...(timeZone ? { timeZone } : {}),
|
|
56
|
-
},
|
|
57
|
-
);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return new target(cronTime, monitoredTick, onComplete, start, timeZone, ...rest);
|
|
61
|
-
},
|
|
62
|
-
get(target, prop) {
|
|
63
|
-
if (prop === 'from') {
|
|
64
|
-
return (param) => {
|
|
65
|
-
const { cronTime, onTick, timeZone } = param;
|
|
66
|
-
|
|
67
|
-
if (typeof cronTime !== 'string') {
|
|
68
|
-
throw new Error(ERROR_TEXT);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (jobScheduled) {
|
|
72
|
-
throw new Error(`A job named '${monitorSlug}' has already been scheduled`);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
jobScheduled = true;
|
|
76
|
-
|
|
77
|
-
const cronString = common.replaceCronNames(cronTime);
|
|
78
|
-
|
|
79
|
-
param.onTick = (context, onComplete) => {
|
|
80
|
-
return core.withMonitor(
|
|
81
|
-
monitorSlug,
|
|
82
|
-
() => {
|
|
83
|
-
return onTick(context, onComplete);
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
schedule: { type: 'crontab', value: cronString },
|
|
87
|
-
...(timeZone ? { timeZone } : {}),
|
|
88
|
-
},
|
|
89
|
-
);
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
return target.from(param);
|
|
93
|
-
};
|
|
94
|
-
} else {
|
|
95
|
-
return target[prop];
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
exports.instrumentCron = instrumentCron;
|
|
102
|
-
//# sourceMappingURL=cron.js.map
|
package/cjs/cron/cron.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cron.js","sources":["../../../src/cron/cron.ts"],"sourcesContent":["import { withMonitor } from '@sentry/core';\nimport { replaceCronNames } from './common';\n\nexport type CronJobParams = {\n cronTime: string | Date;\n onTick: (context: unknown, onComplete?: unknown) => void | Promise<void>;\n onComplete?: () => void | Promise<void>;\n start?: boolean | null;\n context?: unknown;\n runOnInit?: boolean | null;\n unrefTimeout?: boolean | null;\n} & (\n | {\n timeZone?: string | null;\n utcOffset?: never;\n }\n | {\n timeZone?: never;\n utcOffset?: number | null;\n }\n);\n\nexport type CronJob = {\n //\n};\n\nexport type CronJobConstructor = {\n from: (param: CronJobParams) => CronJob;\n\n new (\n cronTime: CronJobParams['cronTime'],\n onTick: CronJobParams['onTick'],\n onComplete?: CronJobParams['onComplete'],\n start?: CronJobParams['start'],\n timeZone?: CronJobParams['timeZone'],\n context?: CronJobParams['context'],\n runOnInit?: CronJobParams['runOnInit'],\n utcOffset?: null,\n unrefTimeout?: CronJobParams['unrefTimeout'],\n ): CronJob;\n new (\n cronTime: CronJobParams['cronTime'],\n onTick: CronJobParams['onTick'],\n onComplete?: CronJobParams['onComplete'],\n start?: CronJobParams['start'],\n timeZone?: null,\n context?: CronJobParams['context'],\n runOnInit?: CronJobParams['runOnInit'],\n utcOffset?: CronJobParams['utcOffset'],\n unrefTimeout?: CronJobParams['unrefTimeout'],\n ): CronJob;\n};\n\nconst ERROR_TEXT = 'Automatic instrumentation of CronJob only supports crontab string';\n\n/**\n * Instruments the `cron` library to send a check-in event to Sentry for each job execution.\n *\n * ```ts\n * import * as Sentry from '@sentry/node';\n * import { CronJob } from 'cron';\n *\n * const CronJobWithCheckIn = Sentry.cron.instrumentCron(CronJob, 'my-cron-job');\n *\n * // use the constructor\n * const job = new CronJobWithCheckIn('* * * * *', () => {\n * console.log('You will see this message every minute');\n * });\n *\n * // or from\n * const job = CronJobWithCheckIn.from({ cronTime: '* * * * *', onTick: () => {\n * console.log('You will see this message every minute');\n * });\n * ```\n */\nexport function instrumentCron<T>(lib: T & CronJobConstructor, monitorSlug: string): T {\n let jobScheduled = false;\n\n return new Proxy(lib, {\n construct(target, args: ConstructorParameters<CronJobConstructor>) {\n const [cronTime, onTick, onComplete, start, timeZone, ...rest] = args;\n\n if (typeof cronTime !== 'string') {\n throw new Error(ERROR_TEXT);\n }\n\n if (jobScheduled) {\n throw new Error(`A job named '${monitorSlug}' has already been scheduled`);\n }\n\n jobScheduled = true;\n\n const cronString = replaceCronNames(cronTime);\n\n function monitoredTick(context: unknown, onComplete?: unknown): void | Promise<void> {\n return withMonitor(\n monitorSlug,\n () => {\n return onTick(context, onComplete);\n },\n {\n schedule: { type: 'crontab', value: cronString },\n ...(timeZone ? { timeZone } : {}),\n },\n );\n }\n\n return new target(cronTime, monitoredTick, onComplete, start, timeZone, ...rest);\n },\n get(target, prop: keyof CronJobConstructor) {\n if (prop === 'from') {\n return (param: CronJobParams) => {\n const { cronTime, onTick, timeZone } = param;\n\n if (typeof cronTime !== 'string') {\n throw new Error(ERROR_TEXT);\n }\n\n if (jobScheduled) {\n throw new Error(`A job named '${monitorSlug}' has already been scheduled`);\n }\n\n jobScheduled = true;\n\n const cronString = replaceCronNames(cronTime);\n\n param.onTick = (context: unknown, onComplete?: unknown) => {\n return withMonitor(\n monitorSlug,\n () => {\n return onTick(context, onComplete);\n },\n {\n schedule: { type: 'crontab', value: cronString },\n ...(timeZone ? { timeZone } : {}),\n },\n );\n };\n\n return target.from(param);\n };\n } else {\n return target[prop];\n }\n },\n });\n}\n"],"names":["replaceCronNames","withMonitor"],"mappings":";;;;;AAqDA,MAAM,UAAA,GAAa,mEAAmE,CAAA;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAI,GAAG,EAA0B,WAAW,EAAa;AACvF,EAAE,IAAI,YAAa,GAAE,KAAK,CAAA;AAC1B;AACA,EAAE,OAAO,IAAI,KAAK,CAAC,GAAG,EAAE;AACxB,IAAI,SAAS,CAAC,MAAM,EAAE,IAAI,EAA6C;AACvE,MAAM,MAAM,CAAC,QAAQ,EAAE,M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AI,QAAQ,EAAE;AAC5C,YAAY,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,CAAA;AACvC,WAAU;AACV;AACA,UAAU,IAAI,YAAY,EAAE;AAC5B,YAAY,MAAM,IAAI,KAAK,CAAC,CAAC,aAAa,EAAE,WAAW,CAAC,4BAA4B,CAAC,CAAC,CAAA;AACtF,WAAU;AACV;AACA,UAAU,YAAA,GAAe,IAAI,CAAA;AAC7B;AACA,UAAU,MAAM,UAAW,GAAED,uBAAgB,CAAC,QAAQ,CAAC,CAAA;AACvD;AACA,UAAU,KAAK,CAAC,MAAO,GAAE,CAAC,OAAO,EAAW,UAAU,KAAe;AACrE,YAAY,OAAOC,gBAAW;AAC9B,cAAc,WAAW;AACzB,cAAc,MAAM;AACpB,gBAAgB,OAAO,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;AAClD,eAAe;AACf,cAAc;AACd,gBAAgB,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,UAAA,EAAY;AAChE,gBAAgB,IAAI,QAAA,GAAW,EAAE,UAAW,GAAE,EAAE,CAAC;AACjD,eAAe;AACf,aAAa,CAAA;AACb,WAAW,CAAA;AACX;AACA,UAAU,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACnC,SAAS,CAAA;AACT,aAAa;AACb,QAAQ,OAAO,MAAM,CAAC,IAAI,CAAC,CAAA;AAC3B,OAAM;AACN,KAAK;AACL,GAAG,CAAC,CAAA;AACJ;;;;"}
|
package/cjs/cron/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
|
|
3
|
-
const cron$1 = require('./cron.js');
|
|
4
|
-
const nodeCron = require('./node-cron.js');
|
|
5
|
-
const nodeSchedule = require('./node-schedule.js');
|
|
6
|
-
|
|
7
|
-
/** Methods to instrument cron libraries for Sentry check-ins */
|
|
8
|
-
const cron = {
|
|
9
|
-
instrumentCron: cron$1.instrumentCron,
|
|
10
|
-
instrumentNodeCron: nodeCron.instrumentNodeCron,
|
|
11
|
-
instrumentNodeSchedule: nodeSchedule.instrumentNodeSchedule,
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
exports.cron = cron;
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
package/cjs/cron/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/cron/index.ts"],"sourcesContent":["import { instrumentCron } from './cron';\nimport { instrumentNodeCron } from './node-cron';\nimport { instrumentNodeSchedule } from './node-schedule';\n\n/** Methods to instrument cron libraries for Sentry check-ins */\nexport const cron = {\n instrumentCron,\n instrumentNodeCron,\n instrumentNodeSchedule,\n};\n"],"names":["instrumentCron","instrumentNodeCron","instrumentNodeSchedule"],"mappings":";;;;;;AAIA;AACO,MAAM,OAAO;AACpB,kBAAEA,qBAAc;AAChB,sBAAEC,2BAAkB;AACpB,0BAAEC,mCAAsB;AACxB;;;;"}
|
package/cjs/cron/node-cron.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
var {
|
|
2
|
-
_optionalChain
|
|
3
|
-
} = require('@sentry/utils');
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
6
|
-
|
|
7
|
-
const core = require('@sentry/core');
|
|
8
|
-
const common = require('./common.js');
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Wraps the `node-cron` library with check-in monitoring.
|
|
12
|
-
*
|
|
13
|
-
* ```ts
|
|
14
|
-
* import * as Sentry from "@sentry/node";
|
|
15
|
-
* import cron from "node-cron";
|
|
16
|
-
*
|
|
17
|
-
* const cronWithCheckIn = Sentry.cron.instrumentNodeCron(cron);
|
|
18
|
-
*
|
|
19
|
-
* cronWithCheckIn.schedule(
|
|
20
|
-
* "* * * * *",
|
|
21
|
-
* () => {
|
|
22
|
-
* console.log("running a task every minute");
|
|
23
|
-
* },
|
|
24
|
-
* { name: "my-cron-job" },
|
|
25
|
-
* );
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
function instrumentNodeCron(lib) {
|
|
29
|
-
return new Proxy(lib, {
|
|
30
|
-
get(target, prop) {
|
|
31
|
-
if (prop === 'schedule' && target.schedule) {
|
|
32
|
-
// When 'get' is called for schedule, return a proxied version of the schedule function
|
|
33
|
-
return new Proxy(target.schedule, {
|
|
34
|
-
apply(target, thisArg, argArray) {
|
|
35
|
-
const [expression, , options] = argArray;
|
|
36
|
-
|
|
37
|
-
if (!_optionalChain([options, 'optionalAccess', _ => _.name])) {
|
|
38
|
-
throw new Error('Missing "name" for scheduled job. A name is required for Sentry check-in monitoring.');
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return core.withMonitor(
|
|
42
|
-
options.name,
|
|
43
|
-
() => {
|
|
44
|
-
return target.apply(thisArg, argArray);
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
schedule: { type: 'crontab', value: common.replaceCronNames(expression) },
|
|
48
|
-
timezone: _optionalChain([options, 'optionalAccess', _2 => _2.timezone]),
|
|
49
|
-
},
|
|
50
|
-
);
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
} else {
|
|
54
|
-
return target[prop];
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
exports.instrumentNodeCron = instrumentNodeCron;
|
|
61
|
-
//# sourceMappingURL=node-cron.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-cron.js","sources":["../../../src/cron/node-cron.ts"],"sourcesContent":["import { withMonitor } from '@sentry/core';\nimport { replaceCronNames } from './common';\n\nexport interface NodeCronOptions {\n name: string;\n timezone?: string;\n}\n\nexport interface NodeCron {\n schedule: (cronExpression: string, callback: () => void, options: NodeCronOptions) => unknown;\n}\n\n/**\n * Wraps the `node-cron` library with check-in monitoring.\n *\n * ```ts\n * import * as Sentry from \"@sentry/node\";\n * import cron from \"node-cron\";\n *\n * const cronWithCheckIn = Sentry.cron.instrumentNodeCron(cron);\n *\n * cronWithCheckIn.schedule(\n * \"* * * * *\",\n * () => {\n * console.log(\"running a task every minute\");\n * },\n * { name: \"my-cron-job\" },\n * );\n * ```\n */\nexport function instrumentNodeCron<T>(lib: Partial<NodeCron> & T): T {\n return new Proxy(lib, {\n get(target, prop: keyof NodeCron) {\n if (prop === 'schedule' && target.schedule) {\n // When 'get' is called for schedule, return a proxied version of the schedule function\n return new Proxy(target.schedule, {\n apply(target, thisArg, argArray: Parameters<NodeCron['schedule']>) {\n const [expression, , options] = argArray;\n\n if (!options?.name) {\n throw new Error('Missing \"name\" for scheduled job. A name is required for Sentry check-in monitoring.');\n }\n\n return withMonitor(\n options.name,\n () => {\n return target.apply(thisArg, argArray);\n },\n {\n schedule: { type: 'crontab', value: replaceCronNames(expression) },\n timezone: options?.timezone,\n },\n );\n },\n });\n } else {\n return target[prop];\n }\n },\n });\n}\n"],"names":["withMonitor","replaceCronNames"],"mappings":";;;;;;;;;AAYA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;CACA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA;CACA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA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.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
|
|
3
|
-
const core = require('@sentry/core');
|
|
4
|
-
const common = require('./common.js');
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Instruments the `node-schedule` library to send a check-in event to Sentry for each job execution.
|
|
8
|
-
*
|
|
9
|
-
* ```ts
|
|
10
|
-
* import * as Sentry from '@sentry/node';
|
|
11
|
-
* import * as schedule from 'node-schedule';
|
|
12
|
-
*
|
|
13
|
-
* const scheduleWithCheckIn = Sentry.cron.instrumentNodeSchedule(schedule);
|
|
14
|
-
*
|
|
15
|
-
* const job = scheduleWithCheckIn.scheduleJob('my-cron-job', '* * * * *', () => {
|
|
16
|
-
* console.log('You will see this message every minute');
|
|
17
|
-
* });
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
function instrumentNodeSchedule(lib) {
|
|
21
|
-
return new Proxy(lib, {
|
|
22
|
-
get(target, prop) {
|
|
23
|
-
if (prop === 'scheduleJob') {
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
25
|
-
return new Proxy(target.scheduleJob, {
|
|
26
|
-
apply(target, thisArg, argArray) {
|
|
27
|
-
const [nameOrExpression, expressionOrCallback] = argArray;
|
|
28
|
-
|
|
29
|
-
if (typeof nameOrExpression !== 'string' || typeof expressionOrCallback !== 'string') {
|
|
30
|
-
throw new Error(
|
|
31
|
-
"Automatic instrumentation of 'node-schedule' requires the first parameter of 'scheduleJob' to be a job name string and the second parameter to be a crontab string",
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const monitorSlug = nameOrExpression;
|
|
36
|
-
const expression = expressionOrCallback;
|
|
37
|
-
|
|
38
|
-
return core.withMonitor(
|
|
39
|
-
monitorSlug,
|
|
40
|
-
() => {
|
|
41
|
-
return target.apply(thisArg, argArray);
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
schedule: { type: 'crontab', value: common.replaceCronNames(expression) },
|
|
45
|
-
},
|
|
46
|
-
);
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return target[prop];
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
exports.instrumentNodeSchedule = instrumentNodeSchedule;
|
|
57
|
-
//# sourceMappingURL=node-schedule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-schedule.js","sources":["../../../src/cron/node-schedule.ts"],"sourcesContent":["import { withMonitor } from '@sentry/core';\nimport { replaceCronNames } from './common';\n\nexport interface NodeSchedule {\n scheduleJob(\n nameOrExpression: string | Date | object,\n expressionOrCallback: string | Date | object | (() => void),\n callback?: () => void,\n ): unknown;\n}\n\n/**\n * Instruments the `node-schedule` library to send a check-in event to Sentry for each job execution.\n *\n * ```ts\n * import * as Sentry from '@sentry/node';\n * import * as schedule from 'node-schedule';\n *\n * const scheduleWithCheckIn = Sentry.cron.instrumentNodeSchedule(schedule);\n *\n * const job = scheduleWithCheckIn.scheduleJob('my-cron-job', '* * * * *', () => {\n * console.log('You will see this message every minute');\n * });\n * ```\n */\nexport function instrumentNodeSchedule<T>(lib: T & NodeSchedule): T {\n return new Proxy(lib, {\n get(target, prop: keyof NodeSchedule) {\n if (prop === 'scheduleJob') {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n return new Proxy(target.scheduleJob, {\n apply(target, thisArg, argArray: Parameters<NodeSchedule['scheduleJob']>) {\n const [nameOrExpression, expressionOrCallback] = argArray;\n\n if (typeof nameOrExpression !== 'string' || typeof expressionOrCallback !== 'string') {\n throw new Error(\n \"Automatic instrumentation of 'node-schedule' requires the first parameter of 'scheduleJob' to be a job name string and the second parameter to be a crontab string\",\n );\n }\n\n const monitorSlug = nameOrExpression;\n const expression = expressionOrCallback;\n\n return withMonitor(\n monitorSlug,\n () => {\n return target.apply(thisArg, argArray);\n },\n {\n schedule: { type: 'crontab', value: replaceCronNames(expression) },\n },\n );\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s/debug-build.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
|
|
5
|
-
*
|
|
6
|
-
* ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
|
|
7
|
-
*/
|
|
8
|
-
const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);
|
|
9
|
-
|
|
10
|
-
exports.DEBUG_BUILD = DEBUG_BUILD;
|
|
11
|
-
//# sourceMappingURL=debug-build.js.map
|
package/cjs/debug-build.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debug-build.js","sources":["../../src/debug-build.ts"],"sourcesContent":["declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,WAAY,IAAE,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;;;;"}
|