@drawbridge/drawbridge-telemetry 0.0.4 → 0.0.6

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/dist/bullmq.cjs CHANGED
@@ -35,10 +35,9 @@ __export(bullmq_exports, {
35
35
  });
36
36
  module.exports = __toCommonJS(bullmq_exports);
37
37
  var import_crypto = require("crypto");
38
- var Sentry2 = __toESM(require("@sentry/core"), 1);
39
38
 
40
39
  // index.js
41
- var Sentry = __toESM(require("@sentry/core"), 1);
40
+ var Sentry = __toESM(require("@sentry/node"), 1);
42
41
  var withTraceScope = (traceId, fn) => Sentry.withScope((scope) => {
43
42
  if (traceId) scope.setTag("traceId", traceId);
44
43
  return fn(scope);
@@ -77,17 +76,17 @@ var enqueueFromWorker = async (queue, name, data, options = {}) => {
77
76
  options
78
77
  );
79
78
  };
80
- var attachQueueEventsLogger = (queueEvents, queueName, logger) => {
81
- if (!(logger == null ? void 0 : logger.event)) return;
79
+ var attachQueueEventsLogger = (queueEvents, queueName, logger2) => {
80
+ if (!(logger2 == null ? void 0 : logger2.event)) return;
82
81
  queueEvents.on("completed", ({ jobId, returnvalue, prev }) => {
83
- logger.event("job.completed", {
82
+ logger2.event("job.completed", {
84
83
  jobId,
85
84
  queue: queueName,
86
85
  prev
87
86
  });
88
87
  });
89
88
  queueEvents.on("failed", ({ jobId, failedReason, prev }) => {
90
- logger.event("job.failed", {
89
+ logger2.event("job.failed", {
91
90
  jobId,
92
91
  queue: queueName,
93
92
  failedReason,
@@ -95,7 +94,7 @@ var attachQueueEventsLogger = (queueEvents, queueName, logger) => {
95
94
  });
96
95
  });
97
96
  queueEvents.on("stalled", ({ jobId }) => {
98
- logger.event("job.stalled", {
97
+ logger2.event("job.stalled", {
99
98
  jobId,
100
99
  queue: queueName
101
100
  });
package/dist/bullmq.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { randomUUID } from 'crypto';
2
2
  import { currentTraceId, withTraceScope } from './index.cjs';
3
- import '@sentry/core';
3
+ import '@sentry/node';
4
4
 
5
5
  // Wrap a BullMQ worker handler so it runs inside a Sentry scope tagged
6
6
  // with the job's traceId, queue name, and job name. Matches BullMQ's
package/dist/bullmq.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { randomUUID } from 'crypto';
2
2
  import { currentTraceId, withTraceScope } from './index.js';
3
- import '@sentry/core';
3
+ import '@sentry/node';
4
4
 
5
5
  // Wrap a BullMQ worker handler so it runs inside a Sentry scope tagged
6
6
  // with the job's traceId, queue name, and job name. Matches BullMQ's
package/dist/bullmq.js CHANGED
@@ -1,11 +1,10 @@
1
1
  import {
2
2
  currentTraceId,
3
3
  withTraceScope
4
- } from "./chunk-SRV5HFQT.js";
4
+ } from "./chunk-O6EHU4U7.js";
5
5
 
6
6
  // bullmq.js
7
7
  import { randomUUID } from "crypto";
8
- import * as Sentry from "@sentry/core";
9
8
  var wrapWorkerHandler = (handler) => async (job) => {
10
9
  var _a;
11
10
  const traceId = ((_a = job == null ? void 0 : job.data) == null ? void 0 : _a.__traceId) || randomUUID();
@@ -1,5 +1,16 @@
1
1
  // index.js
2
- import * as Sentry from "@sentry/core";
2
+ import * as Sentry from "@sentry/node";
3
+ var init2 = (config = {}) => Sentry.init({
4
+ dsn: process.env.SENTRY_DSN,
5
+ enableLogs: true,
6
+ environment: process.env.SENTRY_ENVIRONMENT || "localhost",
7
+ tracesSampleRate: 0.1,
8
+ profilesSampleRate: 0.05,
9
+ ...config
10
+ });
11
+ var captureException2 = (error, options) => Sentry.captureException(error, options);
12
+ var captureMessage2 = (message, options) => Sentry.captureMessage(message, options);
13
+ var logger2 = Sentry.logger;
3
14
  var attached = false;
4
15
  var attachProcessHandlers = () => {
5
16
  if (attached) return;
@@ -44,6 +55,11 @@ var currentTraceId = () => {
44
55
  };
45
56
 
46
57
  export {
58
+ Sentry,
59
+ init2 as init,
60
+ captureException2 as captureException,
61
+ captureMessage2 as captureMessage,
62
+ logger2 as logger,
47
63
  attachProcessHandlers,
48
64
  withTraceScope,
49
65
  currentTraceId
package/dist/express.cjs CHANGED
@@ -33,7 +33,7 @@ __export(express_exports, {
33
33
  expressContextMiddleware: () => expressContextMiddleware
34
34
  });
35
35
  module.exports = __toCommonJS(express_exports);
36
- var Sentry = __toESM(require("@sentry/core"), 1);
36
+ var Sentry = __toESM(require("@sentry/node"), 1);
37
37
  var applyRequestContext = (req) => {
38
38
  if (req == null ? void 0 : req.id) {
39
39
  Sentry.setTag("traceId", req.id);
@@ -1,4 +1,4 @@
1
- import * as Sentry from '@sentry/core';
1
+ import * as Sentry from '@sentry/node';
2
2
 
3
3
  // Apply all available context tags from a request to the per-request
4
4
  // Sentry isolation scope. Idempotent — safe to call multiple times as
package/dist/express.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as Sentry from '@sentry/core';
1
+ import * as Sentry from '@sentry/node';
2
2
 
3
3
  // Apply all available context tags from a request to the per-request
4
4
  // Sentry isolation scope. Idempotent — safe to call multiple times as
package/dist/express.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // express.js
2
- import * as Sentry from "@sentry/core";
2
+ import * as Sentry from "@sentry/node";
3
3
  var applyRequestContext = (req) => {
4
4
  if (req == null ? void 0 : req.id) {
5
5
  Sentry.setTag("traceId", req.id);
package/dist/index.cjs CHANGED
@@ -29,12 +29,28 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // index.js
30
30
  var index_exports = {};
31
31
  __export(index_exports, {
32
+ Sentry: () => Sentry,
32
33
  attachProcessHandlers: () => attachProcessHandlers,
34
+ captureException: () => captureException2,
35
+ captureMessage: () => captureMessage2,
33
36
  currentTraceId: () => currentTraceId,
37
+ init: () => init2,
38
+ logger: () => logger2,
34
39
  withTraceScope: () => withTraceScope
35
40
  });
36
41
  module.exports = __toCommonJS(index_exports);
37
- var Sentry = __toESM(require("@sentry/core"), 1);
42
+ var Sentry = __toESM(require("@sentry/node"), 1);
43
+ var init2 = (config = {}) => Sentry.init({
44
+ dsn: process.env.SENTRY_DSN,
45
+ enableLogs: true,
46
+ environment: process.env.SENTRY_ENVIRONMENT || "localhost",
47
+ tracesSampleRate: 0.1,
48
+ profilesSampleRate: 0.05,
49
+ ...config
50
+ });
51
+ var captureException2 = (error, options) => Sentry.captureException(error, options);
52
+ var captureMessage2 = (message, options) => Sentry.captureMessage(message, options);
53
+ var logger2 = Sentry.logger;
38
54
  var attached = false;
39
55
  var attachProcessHandlers = () => {
40
56
  if (attached) return;
@@ -79,7 +95,12 @@ var currentTraceId = () => {
79
95
  };
80
96
  // Annotate the CommonJS export names for ESM import in node:
81
97
  0 && (module.exports = {
98
+ Sentry,
82
99
  attachProcessHandlers,
100
+ captureException,
101
+ captureMessage,
83
102
  currentTraceId,
103
+ init,
104
+ logger,
84
105
  withTraceScope
85
106
  });
package/dist/index.d.cts CHANGED
@@ -1,4 +1,33 @@
1
- import * as Sentry from '@sentry/core';
1
+ import * as Sentry from '@sentry/node';
2
+ export { Sentry };
3
+
4
+ // Project-standard Sentry.init wrapper. Sets the conventions used across
5
+ // drawbridge-api / -sync / -webhooks (enableLogs, tracesSampleRate,
6
+ // profilesSampleRate, environment) so each service's init call collapses
7
+ // to dsn + any overrides.
8
+ //
9
+ // Defaults are conservative. Override per service as needed.
10
+
11
+ const init = ( config = {} ) => Sentry.init({
12
+ dsn : process.env.SENTRY_DSN,
13
+ enableLogs : true,
14
+ environment : process.env.SENTRY_ENVIRONMENT || 'localhost',
15
+ tracesSampleRate : 0.1,
16
+ profilesSampleRate : 0.05,
17
+ ...config
18
+ });
19
+
20
+ // Named re-exports of the Sentry surface services actually use. Keep this
21
+ // list narrow — every export here is a service-API contract.
22
+
23
+ const captureException = ( error, options ) => Sentry.captureException( error, options );
24
+
25
+ const captureMessage = ( message, options ) => Sentry.captureMessage( message, options );
26
+
27
+ // Sentry.logger is the structured-logs surface (ships to Sentry Logs).
28
+ // Exposed as `logger` so callers do `logger.info(...)` / `logger.error(...)`.
29
+
30
+ const logger = Sentry.logger;
2
31
 
3
32
  // Diagnostic process-level handlers. Surfaces unhandled async errors to
4
33
  // Sentry (without these, modern Node defaults silently exit) and logs
@@ -90,4 +119,4 @@ const currentTraceId = () => {
90
119
 
91
120
  };
92
121
 
93
- export { attachProcessHandlers, currentTraceId, withTraceScope };
122
+ export { attachProcessHandlers, captureException, captureMessage, currentTraceId, init, logger, withTraceScope };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,33 @@
1
- import * as Sentry from '@sentry/core';
1
+ import * as Sentry from '@sentry/node';
2
+ export { Sentry };
3
+
4
+ // Project-standard Sentry.init wrapper. Sets the conventions used across
5
+ // drawbridge-api / -sync / -webhooks (enableLogs, tracesSampleRate,
6
+ // profilesSampleRate, environment) so each service's init call collapses
7
+ // to dsn + any overrides.
8
+ //
9
+ // Defaults are conservative. Override per service as needed.
10
+
11
+ const init = ( config = {} ) => Sentry.init({
12
+ dsn : process.env.SENTRY_DSN,
13
+ enableLogs : true,
14
+ environment : process.env.SENTRY_ENVIRONMENT || 'localhost',
15
+ tracesSampleRate : 0.1,
16
+ profilesSampleRate : 0.05,
17
+ ...config
18
+ });
19
+
20
+ // Named re-exports of the Sentry surface services actually use. Keep this
21
+ // list narrow — every export here is a service-API contract.
22
+
23
+ const captureException = ( error, options ) => Sentry.captureException( error, options );
24
+
25
+ const captureMessage = ( message, options ) => Sentry.captureMessage( message, options );
26
+
27
+ // Sentry.logger is the structured-logs surface (ships to Sentry Logs).
28
+ // Exposed as `logger` so callers do `logger.info(...)` / `logger.error(...)`.
29
+
30
+ const logger = Sentry.logger;
2
31
 
3
32
  // Diagnostic process-level handlers. Surfaces unhandled async errors to
4
33
  // Sentry (without these, modern Node defaults silently exit) and logs
@@ -90,4 +119,4 @@ const currentTraceId = () => {
90
119
 
91
120
  };
92
121
 
93
- export { attachProcessHandlers, currentTraceId, withTraceScope };
122
+ export { attachProcessHandlers, captureException, captureMessage, currentTraceId, init, logger, withTraceScope };
package/dist/index.js CHANGED
@@ -1,10 +1,20 @@
1
1
  import {
2
+ Sentry,
2
3
  attachProcessHandlers,
4
+ captureException,
5
+ captureMessage,
3
6
  currentTraceId,
7
+ init,
8
+ logger,
4
9
  withTraceScope
5
- } from "./chunk-SRV5HFQT.js";
10
+ } from "./chunk-O6EHU4U7.js";
6
11
  export {
12
+ Sentry,
7
13
  attachProcessHandlers,
14
+ captureException,
15
+ captureMessage,
8
16
  currentTraceId,
17
+ init,
18
+ logger,
9
19
  withTraceScope
10
20
  };
@@ -0,0 +1,63 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // nextjs.js
31
+ var nextjs_exports = {};
32
+ __export(nextjs_exports, {
33
+ Sentry: () => Sentry,
34
+ captureException: () => captureException2,
35
+ captureMessage: () => captureMessage2,
36
+ captureRequestError: () => captureRequestError2,
37
+ init: () => init2,
38
+ logger: () => logger2
39
+ });
40
+ module.exports = __toCommonJS(nextjs_exports);
41
+ var Sentry = __toESM(require("@sentry/nextjs"), 1);
42
+ __reExport(nextjs_exports, require("@sentry/nextjs"), module.exports);
43
+ var init2 = (config = {}) => Sentry.init({
44
+ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
45
+ enableLogs: true,
46
+ environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT || "localhost",
47
+ tracesSampleRate: 0.1,
48
+ ...config
49
+ });
50
+ var captureException2 = (error, options) => Sentry.captureException(error, options);
51
+ var captureMessage2 = (message, options) => Sentry.captureMessage(message, options);
52
+ var captureRequestError2 = Sentry.captureRequestError;
53
+ var logger2 = Sentry.logger;
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ Sentry,
57
+ captureException,
58
+ captureMessage,
59
+ captureRequestError,
60
+ init,
61
+ logger,
62
+ ...require("@sentry/nextjs")
63
+ });
@@ -0,0 +1,41 @@
1
+ import * as Sentry from '@sentry/nextjs';
2
+ export * from '@sentry/nextjs';
3
+ export { Sentry };
4
+
5
+ // @sentry/nextjs surface routed through drawbridge-telemetry so consumer
6
+ // apps (drawbridge-app-web, drawbridge-share) never import @sentry/nextjs
7
+ // directly. Same architectural reason as the /node default: one owner of
8
+ // the Sentry SDK, zero risk of duplicated module instances with separate
9
+ // scope state.
10
+ //
11
+ // @sentry/nextjs is an optional peer dep — only Next.js consumers need it
12
+ // installed. Node services that import the default export aren't forced
13
+ // to carry the Next.js SDK's weight.
14
+
15
+
16
+ // Project-standard Sentry.init wrapper for Next.js apps. Server, edge,
17
+ // and client configs each call init() with their own overrides; the
18
+ // shared defaults (environment from NEXT_PUBLIC_SENTRY_ENVIRONMENT,
19
+ // enableLogs, tracesSampleRate) live here.
20
+
21
+ const init = ( config = {} ) => Sentry.init({
22
+ dsn : process.env.NEXT_PUBLIC_SENTRY_DSN,
23
+ enableLogs : true,
24
+ environment : process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT || 'localhost',
25
+ tracesSampleRate : 0.1,
26
+ ...config
27
+ });
28
+
29
+ const captureException = ( error, options ) => Sentry.captureException( error, options );
30
+
31
+ const captureMessage = ( message, options ) => Sentry.captureMessage( message, options );
32
+
33
+ // Next.js instrumentation.js export — re-exposed so consumer
34
+ // instrumentation.js can wire `export const onRequestError =
35
+ // captureRequestError;` without touching @sentry/nextjs directly.
36
+
37
+ const captureRequestError = Sentry.captureRequestError;
38
+
39
+ const logger = Sentry.logger;
40
+
41
+ export { captureException, captureMessage, captureRequestError, init, logger };
@@ -0,0 +1,41 @@
1
+ import * as Sentry from '@sentry/nextjs';
2
+ export * from '@sentry/nextjs';
3
+ export { Sentry };
4
+
5
+ // @sentry/nextjs surface routed through drawbridge-telemetry so consumer
6
+ // apps (drawbridge-app-web, drawbridge-share) never import @sentry/nextjs
7
+ // directly. Same architectural reason as the /node default: one owner of
8
+ // the Sentry SDK, zero risk of duplicated module instances with separate
9
+ // scope state.
10
+ //
11
+ // @sentry/nextjs is an optional peer dep — only Next.js consumers need it
12
+ // installed. Node services that import the default export aren't forced
13
+ // to carry the Next.js SDK's weight.
14
+
15
+
16
+ // Project-standard Sentry.init wrapper for Next.js apps. Server, edge,
17
+ // and client configs each call init() with their own overrides; the
18
+ // shared defaults (environment from NEXT_PUBLIC_SENTRY_ENVIRONMENT,
19
+ // enableLogs, tracesSampleRate) live here.
20
+
21
+ const init = ( config = {} ) => Sentry.init({
22
+ dsn : process.env.NEXT_PUBLIC_SENTRY_DSN,
23
+ enableLogs : true,
24
+ environment : process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT || 'localhost',
25
+ tracesSampleRate : 0.1,
26
+ ...config
27
+ });
28
+
29
+ const captureException = ( error, options ) => Sentry.captureException( error, options );
30
+
31
+ const captureMessage = ( message, options ) => Sentry.captureMessage( message, options );
32
+
33
+ // Next.js instrumentation.js export — re-exposed so consumer
34
+ // instrumentation.js can wire `export const onRequestError =
35
+ // captureRequestError;` without touching @sentry/nextjs directly.
36
+
37
+ const captureRequestError = Sentry.captureRequestError;
38
+
39
+ const logger = Sentry.logger;
40
+
41
+ export { captureException, captureMessage, captureRequestError, init, logger };
package/dist/nextjs.js ADDED
@@ -0,0 +1,22 @@
1
+ // nextjs.js
2
+ import * as Sentry from "@sentry/nextjs";
3
+ export * from "@sentry/nextjs";
4
+ var init2 = (config = {}) => Sentry.init({
5
+ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
6
+ enableLogs: true,
7
+ environment: process.env.NEXT_PUBLIC_SENTRY_ENVIRONMENT || "localhost",
8
+ tracesSampleRate: 0.1,
9
+ ...config
10
+ });
11
+ var captureException2 = (error, options) => Sentry.captureException(error, options);
12
+ var captureMessage2 = (message, options) => Sentry.captureMessage(message, options);
13
+ var captureRequestError2 = Sentry.captureRequestError;
14
+ var logger2 = Sentry.logger;
15
+ export {
16
+ Sentry,
17
+ captureException2 as captureException,
18
+ captureMessage2 as captureMessage,
19
+ captureRequestError2 as captureRequestError,
20
+ init2 as init,
21
+ logger2 as logger
22
+ };
package/package.json CHANGED
@@ -1,15 +1,18 @@
1
1
  {
2
2
  "type": "module",
3
+ "dependencies": {
4
+ "@drawbridge/drawbridge-agents": "0.0.4",
5
+ "@sentry/node": "10.27.0"
6
+ },
3
7
  "peerDependencies": {
4
- "@sentry/core": ">=10"
8
+ "@sentry/nextjs": ">=10"
5
9
  },
6
10
  "peerDependenciesMeta": {
7
- "@sentry/core": {
8
- "optional": false
11
+ "@sentry/nextjs": {
12
+ "optional": true
9
13
  }
10
14
  },
11
15
  "devDependencies": {
12
- "@sentry/core": "10.27.0",
13
16
  "tsup": "8.5.1",
14
17
  "typescript": "5.9.3"
15
18
  },
@@ -33,6 +36,11 @@
33
36
  "types": "./dist/stream.d.ts",
34
37
  "import": "./dist/stream.js",
35
38
  "require": "./dist/stream.cjs"
39
+ },
40
+ "./nextjs": {
41
+ "types": "./dist/nextjs.d.ts",
42
+ "import": "./dist/nextjs.js",
43
+ "require": "./dist/nextjs.cjs"
36
44
  }
37
45
  },
38
46
  "files": [
@@ -50,8 +58,5 @@
50
58
  "build": "tsup && npm publish"
51
59
  },
52
60
  "types": "dist/index.d.ts",
53
- "version": "0.0.4",
54
- "dependencies": {
55
- "@drawbridge/drawbridge-agents": "0.0.4"
56
- }
61
+ "version": "0.0.6"
57
62
  }