@sentry/node 9.12.0 → 9.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/build/cjs/index.js +7 -4
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/anr/index.js +3 -3
  4. package/build/cjs/integrations/anr/index.js.map +1 -1
  5. package/build/cjs/integrations/context.js +3 -3
  6. package/build/cjs/integrations/context.js.map +1 -1
  7. package/build/cjs/integrations/http/SentryHttpInstrumentation.js +37 -36
  8. package/build/cjs/integrations/http/SentryHttpInstrumentation.js.map +1 -1
  9. package/build/cjs/integrations/local-variables/local-variables-async.js +1 -1
  10. package/build/cjs/integrations/node-fetch/index.js +11 -7
  11. package/build/cjs/integrations/node-fetch/index.js.map +1 -1
  12. package/build/cjs/integrations/tracing/graphql.js +31 -3
  13. package/build/cjs/integrations/tracing/graphql.js.map +1 -1
  14. package/build/cjs/integrations/winston.js +151 -0
  15. package/build/cjs/integrations/winston.js.map +1 -0
  16. package/build/cjs/logs/capture.js +29 -0
  17. package/build/cjs/logs/capture.js.map +1 -0
  18. package/build/cjs/{log.js → logs/exports.js} +8 -30
  19. package/build/cjs/logs/exports.js.map +1 -0
  20. package/build/cjs/otel/instrument.js +50 -2
  21. package/build/cjs/otel/instrument.js.map +1 -1
  22. package/build/cjs/sdk/index.js +1 -2
  23. package/build/cjs/sdk/index.js.map +1 -1
  24. package/build/esm/index.js +4 -4
  25. package/build/esm/integrations/anr/index.js +1 -1
  26. package/build/esm/integrations/anr/worker-script.js +2 -2
  27. package/build/esm/integrations/http/SentryHttpInstrumentation.js +37 -36
  28. package/build/esm/integrations/http/SentryHttpInstrumentation.js.map +1 -1
  29. package/build/esm/integrations/local-variables/local-variables-async.js +1 -1
  30. package/build/esm/integrations/local-variables/worker-script.js +2 -2
  31. package/build/esm/integrations/node-fetch/index.js +11 -7
  32. package/build/esm/integrations/node-fetch/index.js.map +1 -1
  33. package/build/esm/integrations/tracing/express.js +1 -1
  34. package/build/esm/integrations/tracing/fastify.js +1 -1
  35. package/build/esm/integrations/tracing/graphql.js +32 -4
  36. package/build/esm/integrations/tracing/graphql.js.map +1 -1
  37. package/build/esm/integrations/tracing/koa.js +1 -1
  38. package/build/esm/integrations/winston.js +149 -0
  39. package/build/esm/integrations/winston.js.map +1 -0
  40. package/build/esm/logs/capture.js +27 -0
  41. package/build/esm/logs/capture.js.map +1 -0
  42. package/build/esm/{log.js → logs/exports.js} +2 -25
  43. package/build/esm/logs/exports.js.map +1 -0
  44. package/build/esm/otel/instrument.js +50 -2
  45. package/build/esm/otel/instrument.js.map +1 -1
  46. package/build/esm/package.json +1 -1
  47. package/build/esm/sdk/index.js +1 -2
  48. package/build/esm/sdk/index.js.map +1 -1
  49. package/build/types/index.d.ts +3 -3
  50. package/build/types/index.d.ts.map +1 -1
  51. package/build/types/integrations/http/SentryHttpInstrumentation.d.ts.map +1 -1
  52. package/build/types/integrations/node-fetch/index.d.ts.map +1 -1
  53. package/build/types/integrations/tracing/graphql.d.ts +2 -1
  54. package/build/types/integrations/tracing/graphql.d.ts.map +1 -1
  55. package/build/types/integrations/winston.d.ts +44 -0
  56. package/build/types/integrations/winston.d.ts.map +1 -0
  57. package/build/types/logs/capture.d.ts +11 -0
  58. package/build/types/logs/capture.d.ts.map +1 -0
  59. package/build/{types-ts3.8/log.d.ts → types/logs/exports.d.ts} +150 -158
  60. package/build/types/logs/exports.d.ts.map +1 -0
  61. package/build/types/otel/instrument.d.ts +3 -4
  62. package/build/types/otel/instrument.d.ts.map +1 -1
  63. package/build/types-ts3.8/index.d.ts +3 -3
  64. package/build/types-ts3.8/integrations/tracing/graphql.d.ts +2 -1
  65. package/build/types-ts3.8/integrations/winston.d.ts +44 -0
  66. package/build/types-ts3.8/logs/capture.d.ts +18 -0
  67. package/build/{types/log.d.ts → types-ts3.8/logs/exports.d.ts} +150 -151
  68. package/build/types-ts3.8/otel/instrument.d.ts +3 -4
  69. package/package.json +4 -4
  70. package/build/cjs/integrations/console.js +0 -37
  71. package/build/cjs/integrations/console.js.map +0 -1
  72. package/build/cjs/log.js.map +0 -1
  73. package/build/esm/integrations/console.js +0 -35
  74. package/build/esm/integrations/console.js.map +0 -1
  75. package/build/esm/log.js.map +0 -1
  76. package/build/types/integrations/console.d.ts +0 -5
  77. package/build/types/integrations/console.d.ts.map +0 -1
  78. package/build/types/log.d.ts.map +0 -1
  79. package/build/types-ts3.8/integrations/console.d.ts +0 -5
@@ -1,151 +1,150 @@
1
- import type { Log, ParameterizedString } from '@sentry/core';
2
- type CaptureLogArgs = [message: ParameterizedString, attributes?: Log['attributes']] | [messageTemplate: string, messageParams: Array<unknown>, attributes?: Log['attributes']];
3
- /**
4
- * @summary Capture a log with the `trace` level. Requires `_experiments.enableLogs` to be enabled.
5
- *
6
- * You can either pass a message and attributes or a message template, params and attributes.
7
- *
8
- * @example
9
- *
10
- * ```
11
- * Sentry.logger.trace('Starting database connection', {
12
- * database: 'users',
13
- * connectionId: 'conn_123'
14
- * });
15
- * ```
16
- *
17
- * @example With template strings
18
- *
19
- * ```
20
- * Sentry.logger.trace('Database connection %s established for %s',
21
- * ['successful', 'users'],
22
- * { connectionId: 'conn_123' }
23
- * );
24
- * ```
25
- */
26
- export declare function trace(...args: CaptureLogArgs): void;
27
- /**
28
- * @summary Capture a log with the `debug` level. Requires `_experiments.enableLogs` to be enabled.
29
- *
30
- * You can either pass a message and attributes or a message template, params and attributes.
31
- *
32
- * @example
33
- *
34
- * ```
35
- * Sentry.logger.debug('Cache miss for user profile', {
36
- * userId: 'user_123',
37
- * cacheKey: 'profile:user_123'
38
- * });
39
- * ```
40
- *
41
- * @example With template strings
42
- *
43
- * ```
44
- * Sentry.logger.debug('Cache %s for %s: %s',
45
- * ['miss', 'user profile', 'key not found'],
46
- * { userId: 'user_123' }
47
- * );
48
- * ```
49
- */
50
- export declare function debug(...args: CaptureLogArgs): void;
51
- /**
52
- * @summary Capture a log with the `info` level. Requires `_experiments.enableLogs` to be enabled.
53
- *
54
- * You can either pass a message and attributes or a message template, params and attributes.
55
- *
56
- * @example
57
- *
58
- * ```
59
- * Sentry.logger.info('User profile updated', {
60
- * userId: 'user_123',
61
- * updatedFields: ['email', 'preferences']
62
- * });
63
- * ```
64
- *
65
- * @example With template strings
66
- *
67
- * ```
68
- * Sentry.logger.info('User %s updated their %s',
69
- * ['John Doe', 'profile settings'],
70
- * { userId: 'user_123' }
71
- * );
72
- * ```
73
- */
74
- export declare function info(...args: CaptureLogArgs): void;
75
- /**
76
- * @summary Capture a log with the `warn` level. Requires `_experiments.enableLogs` to be enabled.
77
- *
78
- * You can either pass a message and attributes or a message template, params and attributes.
79
- *
80
- * @example
81
- *
82
- * ```
83
- * Sentry.logger.warn('Rate limit approaching', {
84
- * endpoint: '/api/users',
85
- * currentRate: '95/100',
86
- * resetTime: '2024-03-20T10:00:00Z'
87
- * });
88
- * ```
89
- *
90
- * @example With template strings
91
- *
92
- * ```
93
- * Sentry.logger.warn('Rate limit %s for %s: %s',
94
- * ['approaching', '/api/users', '95/100 requests'],
95
- * { resetTime: '2024-03-20T10:00:00Z' }
96
- * );
97
- * ```
98
- */
99
- export declare function warn(...args: CaptureLogArgs): void;
100
- /**
101
- * @summary Capture a log with the `error` level. Requires `_experiments.enableLogs` to be enabled.
102
- *
103
- * You can either pass a message and attributes or a message template, params and attributes.
104
- *
105
- * @example
106
- *
107
- * ```
108
- * Sentry.logger.error('Failed to process payment', {
109
- * orderId: 'order_123',
110
- * errorCode: 'PAYMENT_FAILED',
111
- * amount: 99.99
112
- * });
113
- * ```
114
- *
115
- * @example With template strings
116
- *
117
- * ```
118
- * Sentry.logger.error('Payment processing failed for order %s: %s',
119
- * ['order_123', 'insufficient funds'],
120
- * { amount: 99.99 }
121
- * );
122
- * ```
123
- */
124
- export declare function error(...args: CaptureLogArgs): void;
125
- /**
126
- * @summary Capture a log with the `fatal` level. Requires `_experiments.enableLogs` to be enabled.
127
- *
128
- * You can either pass a message and attributes or a message template, params and attributes.
129
- *
130
- * @example
131
- *
132
- * ```
133
- * Sentry.logger.fatal('Database connection pool exhausted', {
134
- * database: 'users',
135
- * activeConnections: 100,
136
- * maxConnections: 100
137
- * });
138
- * ```
139
- *
140
- * @example With template strings
141
- *
142
- * ```
143
- * Sentry.logger.fatal('Database %s: %s connections active',
144
- * ['connection pool exhausted', '100/100'],
145
- * { database: 'users' }
146
- * );
147
- * ```
148
- */
149
- export declare function fatal(...args: CaptureLogArgs): void;
150
- export { fmt } from '@sentry/core';
151
- //# sourceMappingURL=log.d.ts.map
1
+ import { CaptureLogArgs } from './capture';
2
+ /**
3
+ * @summary Capture a log with the `trace` level. Requires `_experiments.enableLogs` to be enabled.
4
+ *
5
+ * You can either pass a message and attributes or a message template, params and attributes.
6
+ *
7
+ * @example
8
+ *
9
+ * ```
10
+ * Sentry.logger.trace('Starting database connection', {
11
+ * database: 'users',
12
+ * connectionId: 'conn_123'
13
+ * });
14
+ * ```
15
+ *
16
+ * @example With template strings
17
+ *
18
+ * ```
19
+ * Sentry.logger.trace('Database connection %s established for %s',
20
+ * ['successful', 'users'],
21
+ * { connectionId: 'conn_123' }
22
+ * );
23
+ * ```
24
+ */
25
+ export declare function trace(...args: CaptureLogArgs): void;
26
+ /**
27
+ * @summary Capture a log with the `debug` level. Requires `_experiments.enableLogs` to be enabled.
28
+ *
29
+ * You can either pass a message and attributes or a message template, params and attributes.
30
+ *
31
+ * @example
32
+ *
33
+ * ```
34
+ * Sentry.logger.debug('Cache miss for user profile', {
35
+ * userId: 'user_123',
36
+ * cacheKey: 'profile:user_123'
37
+ * });
38
+ * ```
39
+ *
40
+ * @example With template strings
41
+ *
42
+ * ```
43
+ * Sentry.logger.debug('Cache %s for %s: %s',
44
+ * ['miss', 'user profile', 'key not found'],
45
+ * { userId: 'user_123' }
46
+ * );
47
+ * ```
48
+ */
49
+ export declare function debug(...args: CaptureLogArgs): void;
50
+ /**
51
+ * @summary Capture a log with the `info` level. Requires `_experiments.enableLogs` to be enabled.
52
+ *
53
+ * You can either pass a message and attributes or a message template, params and attributes.
54
+ *
55
+ * @example
56
+ *
57
+ * ```
58
+ * Sentry.logger.info('User profile updated', {
59
+ * userId: 'user_123',
60
+ * updatedFields: ['email', 'preferences']
61
+ * });
62
+ * ```
63
+ *
64
+ * @example With template strings
65
+ *
66
+ * ```
67
+ * Sentry.logger.info('User %s updated their %s',
68
+ * ['John Doe', 'profile settings'],
69
+ * { userId: 'user_123' }
70
+ * );
71
+ * ```
72
+ */
73
+ export declare function info(...args: CaptureLogArgs): void;
74
+ /**
75
+ * @summary Capture a log with the `warn` level. Requires `_experiments.enableLogs` to be enabled.
76
+ *
77
+ * You can either pass a message and attributes or a message template, params and attributes.
78
+ *
79
+ * @example
80
+ *
81
+ * ```
82
+ * Sentry.logger.warn('Rate limit approaching', {
83
+ * endpoint: '/api/users',
84
+ * currentRate: '95/100',
85
+ * resetTime: '2024-03-20T10:00:00Z'
86
+ * });
87
+ * ```
88
+ *
89
+ * @example With template strings
90
+ *
91
+ * ```
92
+ * Sentry.logger.warn('Rate limit %s for %s: %s',
93
+ * ['approaching', '/api/users', '95/100 requests'],
94
+ * { resetTime: '2024-03-20T10:00:00Z' }
95
+ * );
96
+ * ```
97
+ */
98
+ export declare function warn(...args: CaptureLogArgs): void;
99
+ /**
100
+ * @summary Capture a log with the `error` level. Requires `_experiments.enableLogs` to be enabled.
101
+ *
102
+ * You can either pass a message and attributes or a message template, params and attributes.
103
+ *
104
+ * @example
105
+ *
106
+ * ```
107
+ * Sentry.logger.error('Failed to process payment', {
108
+ * orderId: 'order_123',
109
+ * errorCode: 'PAYMENT_FAILED',
110
+ * amount: 99.99
111
+ * });
112
+ * ```
113
+ *
114
+ * @example With template strings
115
+ *
116
+ * ```
117
+ * Sentry.logger.error('Payment processing failed for order %s: %s',
118
+ * ['order_123', 'insufficient funds'],
119
+ * { amount: 99.99 }
120
+ * );
121
+ * ```
122
+ */
123
+ export declare function error(...args: CaptureLogArgs): void;
124
+ /**
125
+ * @summary Capture a log with the `fatal` level. Requires `_experiments.enableLogs` to be enabled.
126
+ *
127
+ * You can either pass a message and attributes or a message template, params and attributes.
128
+ *
129
+ * @example
130
+ *
131
+ * ```
132
+ * Sentry.logger.fatal('Database connection pool exhausted', {
133
+ * database: 'users',
134
+ * activeConnections: 100,
135
+ * maxConnections: 100
136
+ * });
137
+ * ```
138
+ *
139
+ * @example With template strings
140
+ *
141
+ * ```
142
+ * Sentry.logger.fatal('Database %s: %s connections active',
143
+ * ['connection pool exhausted', '100/100'],
144
+ * { database: 'users' }
145
+ * );
146
+ * ```
147
+ */
148
+ export declare function fatal(...args: CaptureLogArgs): void;
149
+ export { fmt } from '@sentry/core';
150
+ //# sourceMappingURL=exports.d.ts.map
@@ -1,10 +1,9 @@
1
1
  import { Instrumentation } from '@opentelemetry/instrumentation';
2
2
  /** Exported only for tests. */
3
3
  export declare const INSTRUMENTED: Record<string, Instrumentation>;
4
- /**
5
- * Instrument an OpenTelemetry instrumentation once.
6
- * This will skip running instrumentation again if it was already instrumented.
7
- */
4
+ export declare function generateInstrumentOnce<Options, InstrumentationClass extends new (...args: any[]) => Instrumentation>(name: string, instrumentationClass: InstrumentationClass, optionsCallback: (options: Options) => ConstructorParameters<InstrumentationClass>[0]): ((options: Options) => InstanceType<InstrumentationClass>) & {
5
+ id: string;
6
+ };
8
7
  export declare function generateInstrumentOnce<Options = unknown, InstrumentationInstance extends Instrumentation = Instrumentation>(name: string, creator: (options?: Options) => InstrumentationInstance): ((options?: Options) => InstrumentationInstance) & {
9
8
  id: string;
10
9
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/node",
3
- "version": "9.12.0",
3
+ "version": "9.14.0",
4
4
  "description": "Sentry Node SDK using OpenTelemetry for performance instrumentation",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node",
@@ -95,9 +95,9 @@
95
95
  "@opentelemetry/resources": "^1.30.1",
96
96
  "@opentelemetry/sdk-trace-base": "^1.30.1",
97
97
  "@opentelemetry/semantic-conventions": "^1.30.0",
98
- "@prisma/instrumentation": "6.5.0",
99
- "@sentry/core": "9.12.0",
100
- "@sentry/opentelemetry": "9.12.0",
98
+ "@prisma/instrumentation": "6.6.0",
99
+ "@sentry/core": "9.14.0",
100
+ "@sentry/opentelemetry": "9.14.0",
101
101
  "import-in-the-middle": "^1.13.0"
102
102
  },
103
103
  "devDependencies": {
@@ -1,37 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const util = require('node:util');
4
- const core = require('@sentry/core');
5
-
6
- const INTEGRATION_NAME = 'Console';
7
-
8
- /**
9
- * Capture console logs as breadcrumbs.
10
- */
11
- const consoleIntegration = core.defineIntegration(() => {
12
- return {
13
- name: INTEGRATION_NAME,
14
- setup(client) {
15
- core.addConsoleInstrumentationHandler(({ args, level }) => {
16
- if (core.getClient() !== client) {
17
- return;
18
- }
19
-
20
- core.addBreadcrumb(
21
- {
22
- category: 'console',
23
- level: core.severityLevelFromString(level),
24
- message: util.format.apply(undefined, args),
25
- },
26
- {
27
- input: [...args],
28
- level,
29
- },
30
- );
31
- });
32
- },
33
- };
34
- });
35
-
36
- exports.consoleIntegration = consoleIntegration;
37
- //# sourceMappingURL=console.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"console.js","sources":["../../../src/integrations/console.ts"],"sourcesContent":["import * as util from 'node:util';\nimport {\n addBreadcrumb,\n addConsoleInstrumentationHandler,\n defineIntegration,\n getClient,\n severityLevelFromString,\n} from '@sentry/core';\n\nconst INTEGRATION_NAME = 'Console';\n\n/**\n * Capture console logs as breadcrumbs.\n */\nexport const consoleIntegration = defineIntegration(() => {\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n addConsoleInstrumentationHandler(({ args, level }) => {\n if (getClient() !== client) {\n return;\n }\n\n addBreadcrumb(\n {\n category: 'console',\n level: severityLevelFromString(level),\n message: util.format.apply(undefined, args),\n },\n {\n input: [...args],\n level,\n },\n );\n });\n },\n };\n});\n"],"names":["defineIntegration","addConsoleInstrumentationHandler","getClient","addBreadcrumb","severityLevelFromString"],"mappings":";;;;;AASA,MAAM,gBAAA,GAAmB,SAAS;;AAElC;AACA;AACA;MACa,kBAAmB,GAAEA,sBAAiB,CAAC,MAAM;AAC1D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAMC,qCAAgC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAA,EAAO,KAAK;AAC5D,QAAQ,IAAIC,cAAS,EAAG,KAAI,MAAM,EAAE;AACpC,UAAU;AACV;;AAEA,QAAQC,kBAAa;AACrB,UAAU;AACV,YAAY,QAAQ,EAAE,SAAS;AAC/B,YAAY,KAAK,EAAEC,4BAAuB,CAAC,KAAK,CAAC;AACjD,YAAY,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC;AACvD,WAAW;AACX,UAAU;AACV,YAAY,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;AAC5B,YAAY,KAAK;AACjB,WAAW;AACX,SAAS;AACT,OAAO,CAAC;AACR,KAAK;AACL,GAAG;AACH,CAAC;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"log.js","sources":["../../src/log.ts"],"sourcesContent":["import { format } from 'node:util';\n\nimport type { LogSeverityLevel, Log, ParameterizedString } from '@sentry/core';\nimport { _INTERNAL_captureLog } from '@sentry/core';\n\ntype CaptureLogArgs =\n | [message: ParameterizedString, attributes?: Log['attributes']]\n | [messageTemplate: string, messageParams: Array<unknown>, attributes?: Log['attributes']];\n\n/**\n * Capture a log with the given level.\n *\n * @param level - The level of the log.\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., userId: 100.\n */\nfunction captureLog(level: LogSeverityLevel, ...args: CaptureLogArgs): void {\n const [messageOrMessageTemplate, paramsOrAttributes, maybeAttributes] = args;\n if (Array.isArray(paramsOrAttributes)) {\n const attributes = { ...maybeAttributes };\n attributes['sentry.message.template'] = messageOrMessageTemplate;\n paramsOrAttributes.forEach((param, index) => {\n attributes[`sentry.message.parameter.${index}`] = param;\n });\n const message = format(messageOrMessageTemplate, ...paramsOrAttributes);\n _INTERNAL_captureLog({ level, message, attributes });\n } else {\n _INTERNAL_captureLog({ level, message: messageOrMessageTemplate, attributes: paramsOrAttributes });\n }\n}\n\n/**\n * @summary Capture a log with the `trace` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.trace('Starting database connection', {\n * database: 'users',\n * connectionId: 'conn_123'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.trace('Database connection %s established for %s',\n * ['successful', 'users'],\n * { connectionId: 'conn_123' }\n * );\n * ```\n */\nexport function trace(...args: CaptureLogArgs): void {\n captureLog('trace', ...args);\n}\n\n/**\n * @summary Capture a log with the `debug` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.debug('Cache miss for user profile', {\n * userId: 'user_123',\n * cacheKey: 'profile:user_123'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.debug('Cache %s for %s: %s',\n * ['miss', 'user profile', 'key not found'],\n * { userId: 'user_123' }\n * );\n * ```\n */\nexport function debug(...args: CaptureLogArgs): void {\n captureLog('debug', ...args);\n}\n\n/**\n * @summary Capture a log with the `info` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.info('User profile updated', {\n * userId: 'user_123',\n * updatedFields: ['email', 'preferences']\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.info('User %s updated their %s',\n * ['John Doe', 'profile settings'],\n * { userId: 'user_123' }\n * );\n * ```\n */\nexport function info(...args: CaptureLogArgs): void {\n captureLog('info', ...args);\n}\n\n/**\n * @summary Capture a log with the `warn` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.warn('Rate limit approaching', {\n * endpoint: '/api/users',\n * currentRate: '95/100',\n * resetTime: '2024-03-20T10:00:00Z'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.warn('Rate limit %s for %s: %s',\n * ['approaching', '/api/users', '95/100 requests'],\n * { resetTime: '2024-03-20T10:00:00Z' }\n * );\n * ```\n */\nexport function warn(...args: CaptureLogArgs): void {\n captureLog('warn', ...args);\n}\n\n/**\n * @summary Capture a log with the `error` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.error('Failed to process payment', {\n * orderId: 'order_123',\n * errorCode: 'PAYMENT_FAILED',\n * amount: 99.99\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.error('Payment processing failed for order %s: %s',\n * ['order_123', 'insufficient funds'],\n * { amount: 99.99 }\n * );\n * ```\n */\nexport function error(...args: CaptureLogArgs): void {\n captureLog('error', ...args);\n}\n\n/**\n * @summary Capture a log with the `fatal` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.fatal('Database connection pool exhausted', {\n * database: 'users',\n * activeConnections: 100,\n * maxConnections: 100\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.fatal('Database %s: %s connections active',\n * ['connection pool exhausted', '100/100'],\n * { database: 'users' }\n * );\n * ```\n */\nexport function fatal(...args: CaptureLogArgs): void {\n captureLog('fatal', ...args);\n}\n\nexport { fmt } from '@sentry/core';\n"],"names":["format","_INTERNAL_captureLog"],"mappings":";;;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,KAAK,EAAoB,GAAG,IAAI,EAAwB;AAC5E,EAAE,MAAM,CAAC,wBAAwB,EAAE,kBAAkB,EAAE,eAAe,CAAE,GAAE,IAAI;AAC9E,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE;AACzC,IAAI,MAAM,UAAW,GAAE,EAAE,GAAG,iBAAiB;AAC7C,IAAI,UAAU,CAAC,yBAAyB,CAAA,GAAI,wBAAwB;AACpE,IAAI,kBAAkB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK;AACjD,MAAM,UAAU,CAAC,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAA,CAAA,GAAA,KAAA;AACA,KAAA,CAAA;AACA,IAAA,MAAA,OAAA,GAAAA,WAAA,CAAA,wBAAA,EAAA,GAAA,kBAAA,CAAA;AACA,IAAAC,yBAAA,CAAA,EAAA,KAAA,EAAA,OAAA,EAAA,UAAA,EAAA,CAAA;AACA,GAAA,MAAA;AACA,IAAAA,yBAAA,CAAA,EAAA,KAAA,EAAA,OAAA,EAAA,wBAAA,EAAA,UAAA,EAAA,kBAAA,EAAA,CAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,KAAA,CAAA,GAAA,IAAA,EAAA;AACA,EAAA,UAAA,CAAA,OAAA,EAAA,GAAA,IAAA,CAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,KAAA,CAAA,GAAA,IAAA,EAAA;AACA,EAAA,UAAA,CAAA,OAAA,EAAA,GAAA,IAAA,CAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,IAAA,CAAA,GAAA,IAAA,EAAA;AACA,EAAA,UAAA,CAAA,MAAA,EAAA,GAAA,IAAA,CAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,IAAA,CAAA,GAAA,IAAA,EAAA;AACA,EAAA,UAAA,CAAA,MAAA,EAAA,GAAA,IAAA,CAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,KAAA,CAAA,GAAA,IAAA,EAAA;AACA,EAAA,UAAA,CAAA,OAAA,EAAA,GAAA,IAAA,CAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,KAAA,CAAA,GAAA,IAAA,EAAA;AACA,EAAA,UAAA,CAAA,OAAA,EAAA,GAAA,IAAA,CAAA;AACA;;;;;;;;;;"}
@@ -1,35 +0,0 @@
1
- import * as util from 'node:util';
2
- import { defineIntegration, addConsoleInstrumentationHandler, getClient, addBreadcrumb, severityLevelFromString } from '@sentry/core';
3
-
4
- const INTEGRATION_NAME = 'Console';
5
-
6
- /**
7
- * Capture console logs as breadcrumbs.
8
- */
9
- const consoleIntegration = defineIntegration(() => {
10
- return {
11
- name: INTEGRATION_NAME,
12
- setup(client) {
13
- addConsoleInstrumentationHandler(({ args, level }) => {
14
- if (getClient() !== client) {
15
- return;
16
- }
17
-
18
- addBreadcrumb(
19
- {
20
- category: 'console',
21
- level: severityLevelFromString(level),
22
- message: util.format.apply(undefined, args),
23
- },
24
- {
25
- input: [...args],
26
- level,
27
- },
28
- );
29
- });
30
- },
31
- };
32
- });
33
-
34
- export { consoleIntegration };
35
- //# sourceMappingURL=console.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"console.js","sources":["../../../src/integrations/console.ts"],"sourcesContent":["import * as util from 'node:util';\nimport {\n addBreadcrumb,\n addConsoleInstrumentationHandler,\n defineIntegration,\n getClient,\n severityLevelFromString,\n} from '@sentry/core';\n\nconst INTEGRATION_NAME = 'Console';\n\n/**\n * Capture console logs as breadcrumbs.\n */\nexport const consoleIntegration = defineIntegration(() => {\n return {\n name: INTEGRATION_NAME,\n setup(client) {\n addConsoleInstrumentationHandler(({ args, level }) => {\n if (getClient() !== client) {\n return;\n }\n\n addBreadcrumb(\n {\n category: 'console',\n level: severityLevelFromString(level),\n message: util.format.apply(undefined, args),\n },\n {\n input: [...args],\n level,\n },\n );\n });\n },\n };\n});\n"],"names":[],"mappings":";;;AASA,MAAM,gBAAA,GAAmB,SAAS;;AAElC;AACA;AACA;MACa,kBAAmB,GAAE,iBAAiB,CAAC,MAAM;AAC1D,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,KAAK,CAAC,MAAM,EAAE;AAClB,MAAM,gCAAgC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAA,EAAO,KAAK;AAC5D,QAAQ,IAAI,SAAS,EAAG,KAAI,MAAM,EAAE;AACpC,UAAU;AACV;;AAEA,QAAQ,aAAa;AACrB,UAAU;AACV,YAAY,QAAQ,EAAE,SAAS;AAC/B,YAAY,KAAK,EAAE,uBAAuB,CAAC,KAAK,CAAC;AACjD,YAAY,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC;AACvD,WAAW;AACX,UAAU;AACV,YAAY,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;AAC5B,YAAY,KAAK;AACjB,WAAW;AACX,SAAS;AACT,OAAO,CAAC;AACR,KAAK;AACL,GAAG;AACH,CAAC;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"log.js","sources":["../../src/log.ts"],"sourcesContent":["import { format } from 'node:util';\n\nimport type { LogSeverityLevel, Log, ParameterizedString } from '@sentry/core';\nimport { _INTERNAL_captureLog } from '@sentry/core';\n\ntype CaptureLogArgs =\n | [message: ParameterizedString, attributes?: Log['attributes']]\n | [messageTemplate: string, messageParams: Array<unknown>, attributes?: Log['attributes']];\n\n/**\n * Capture a log with the given level.\n *\n * @param level - The level of the log.\n * @param message - The message to log.\n * @param attributes - Arbitrary structured data that stores information about the log - e.g., userId: 100.\n */\nfunction captureLog(level: LogSeverityLevel, ...args: CaptureLogArgs): void {\n const [messageOrMessageTemplate, paramsOrAttributes, maybeAttributes] = args;\n if (Array.isArray(paramsOrAttributes)) {\n const attributes = { ...maybeAttributes };\n attributes['sentry.message.template'] = messageOrMessageTemplate;\n paramsOrAttributes.forEach((param, index) => {\n attributes[`sentry.message.parameter.${index}`] = param;\n });\n const message = format(messageOrMessageTemplate, ...paramsOrAttributes);\n _INTERNAL_captureLog({ level, message, attributes });\n } else {\n _INTERNAL_captureLog({ level, message: messageOrMessageTemplate, attributes: paramsOrAttributes });\n }\n}\n\n/**\n * @summary Capture a log with the `trace` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.trace('Starting database connection', {\n * database: 'users',\n * connectionId: 'conn_123'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.trace('Database connection %s established for %s',\n * ['successful', 'users'],\n * { connectionId: 'conn_123' }\n * );\n * ```\n */\nexport function trace(...args: CaptureLogArgs): void {\n captureLog('trace', ...args);\n}\n\n/**\n * @summary Capture a log with the `debug` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.debug('Cache miss for user profile', {\n * userId: 'user_123',\n * cacheKey: 'profile:user_123'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.debug('Cache %s for %s: %s',\n * ['miss', 'user profile', 'key not found'],\n * { userId: 'user_123' }\n * );\n * ```\n */\nexport function debug(...args: CaptureLogArgs): void {\n captureLog('debug', ...args);\n}\n\n/**\n * @summary Capture a log with the `info` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.info('User profile updated', {\n * userId: 'user_123',\n * updatedFields: ['email', 'preferences']\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.info('User %s updated their %s',\n * ['John Doe', 'profile settings'],\n * { userId: 'user_123' }\n * );\n * ```\n */\nexport function info(...args: CaptureLogArgs): void {\n captureLog('info', ...args);\n}\n\n/**\n * @summary Capture a log with the `warn` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.warn('Rate limit approaching', {\n * endpoint: '/api/users',\n * currentRate: '95/100',\n * resetTime: '2024-03-20T10:00:00Z'\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.warn('Rate limit %s for %s: %s',\n * ['approaching', '/api/users', '95/100 requests'],\n * { resetTime: '2024-03-20T10:00:00Z' }\n * );\n * ```\n */\nexport function warn(...args: CaptureLogArgs): void {\n captureLog('warn', ...args);\n}\n\n/**\n * @summary Capture a log with the `error` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.error('Failed to process payment', {\n * orderId: 'order_123',\n * errorCode: 'PAYMENT_FAILED',\n * amount: 99.99\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.error('Payment processing failed for order %s: %s',\n * ['order_123', 'insufficient funds'],\n * { amount: 99.99 }\n * );\n * ```\n */\nexport function error(...args: CaptureLogArgs): void {\n captureLog('error', ...args);\n}\n\n/**\n * @summary Capture a log with the `fatal` level. Requires `_experiments.enableLogs` to be enabled.\n *\n * You can either pass a message and attributes or a message template, params and attributes.\n *\n * @example\n *\n * ```\n * Sentry.logger.fatal('Database connection pool exhausted', {\n * database: 'users',\n * activeConnections: 100,\n * maxConnections: 100\n * });\n * ```\n *\n * @example With template strings\n *\n * ```\n * Sentry.logger.fatal('Database %s: %s connections active',\n * ['connection pool exhausted', '100/100'],\n * { database: 'users' }\n * );\n * ```\n */\nexport function fatal(...args: CaptureLogArgs): void {\n captureLog('fatal', ...args);\n}\n\nexport { fmt } from '@sentry/core';\n"],"names":[],"mappings":";;;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,KAAK,EAAoB,GAAG,IAAI,EAAwB;AAC5E,EAAE,MAAM,CAAC,wBAAwB,EAAE,kBAAkB,EAAE,eAAe,CAAE,GAAE,IAAI;AAC9E,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE;AACzC,IAAI,MAAM,UAAW,GAAE,EAAE,GAAG,iBAAiB;AAC7C,IAAI,UAAU,CAAC,yBAAyB,CAAA,GAAI,wBAAwB;AACpE,IAAI,kBAAkB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK;AACjD,MAAM,UAAU,CAAC,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAA,CAAA,GAAA,KAAA;AACA,KAAA,CAAA;AACA,IAAA,MAAA,OAAA,GAAA,MAAA,CAAA,wBAAA,EAAA,GAAA,kBAAA,CAAA;AACA,IAAA,oBAAA,CAAA,EAAA,KAAA,EAAA,OAAA,EAAA,UAAA,EAAA,CAAA;AACA,GAAA,MAAA;AACA,IAAA,oBAAA,CAAA,EAAA,KAAA,EAAA,OAAA,EAAA,wBAAA,EAAA,UAAA,EAAA,kBAAA,EAAA,CAAA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,KAAA,CAAA,GAAA,IAAA,EAAA;AACA,EAAA,UAAA,CAAA,OAAA,EAAA,GAAA,IAAA,CAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,KAAA,CAAA,GAAA,IAAA,EAAA;AACA,EAAA,UAAA,CAAA,OAAA,EAAA,GAAA,IAAA,CAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,IAAA,CAAA,GAAA,IAAA,EAAA;AACA,EAAA,UAAA,CAAA,MAAA,EAAA,GAAA,IAAA,CAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,IAAA,CAAA,GAAA,IAAA,EAAA;AACA,EAAA,UAAA,CAAA,MAAA,EAAA,GAAA,IAAA,CAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,KAAA,CAAA,GAAA,IAAA,EAAA;AACA,EAAA,UAAA,CAAA,OAAA,EAAA,GAAA,IAAA,CAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAA,KAAA,CAAA,GAAA,IAAA,EAAA;AACA,EAAA,UAAA,CAAA,OAAA,EAAA,GAAA,IAAA,CAAA;AACA;;;;"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Capture console logs as breadcrumbs.
3
- */
4
- export declare const consoleIntegration: () => import("@sentry/core").Integration;
5
- //# sourceMappingURL=console.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../../src/integrations/console.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,eAAO,MAAM,kBAAkB,0CAuB7B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/log.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAoB,GAAG,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAG/E,KAAK,cAAc,GACf,CAAC,OAAO,EAAE,mBAAmB,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,GAC9D,CAAC,eAAe,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC;AAwB7F;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,KAAK,CAAC,GAAG,IAAI,EAAE,cAAc,GAAG,IAAI,CAEnD;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,KAAK,CAAC,GAAG,IAAI,EAAE,cAAc,GAAG,IAAI,CAEnD;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,IAAI,CAAC,GAAG,IAAI,EAAE,cAAc,GAAG,IAAI,CAElD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,IAAI,CAAC,GAAG,IAAI,EAAE,cAAc,GAAG,IAAI,CAElD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,KAAK,CAAC,GAAG,IAAI,EAAE,cAAc,GAAG,IAAI,CAEnD;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,KAAK,CAAC,GAAG,IAAI,EAAE,cAAc,GAAG,IAAI,CAEnD;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Capture console logs as breadcrumbs.
3
- */
4
- export declare const consoleIntegration: () => import("@sentry/core").Integration;
5
- //# sourceMappingURL=console.d.ts.map