@sentry/node 10.51.0 → 10.52.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 (69) hide show
  1. package/build/cjs/index.js +4 -4
  2. package/build/cjs/integrations/http.js +18 -145
  3. package/build/cjs/integrations/http.js.map +1 -1
  4. package/build/cjs/integrations/tracing/index.js +21 -22
  5. package/build/cjs/integrations/tracing/index.js.map +1 -1
  6. package/build/cjs/integrations/tracing/{redis.js → redis/index.js} +18 -10
  7. package/build/cjs/integrations/tracing/redis/index.js.map +1 -0
  8. package/build/cjs/integrations/tracing/redis/redis-dc-subscriber.js +186 -0
  9. package/build/cjs/integrations/tracing/redis/redis-dc-subscriber.js.map +1 -0
  10. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +255 -0
  11. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -0
  12. package/build/cjs/integrations/tracing/redis/vendored/redis-common.js +74 -0
  13. package/build/cjs/integrations/tracing/redis/vendored/redis-common.js.map +1 -0
  14. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +685 -0
  15. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -0
  16. package/build/cjs/integrations/tracing/redis/vendored/semconv.js +47 -0
  17. package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +1 -0
  18. package/build/cjs/utils/redisCache.js.map +1 -1
  19. package/build/esm/index.js +1 -1
  20. package/build/esm/integrations/http.js +21 -146
  21. package/build/esm/integrations/http.js.map +1 -1
  22. package/build/esm/integrations/tracing/index.js +2 -3
  23. package/build/esm/integrations/tracing/index.js.map +1 -1
  24. package/build/esm/integrations/tracing/{redis.js → redis/index.js} +17 -9
  25. package/build/esm/integrations/tracing/redis/index.js.map +1 -0
  26. package/build/esm/integrations/tracing/redis/redis-dc-subscriber.js +184 -0
  27. package/build/esm/integrations/tracing/redis/redis-dc-subscriber.js.map +1 -0
  28. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +253 -0
  29. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -0
  30. package/build/esm/integrations/tracing/redis/vendored/redis-common.js +72 -0
  31. package/build/esm/integrations/tracing/redis/vendored/redis-common.js.map +1 -0
  32. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +683 -0
  33. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -0
  34. package/build/esm/integrations/tracing/redis/vendored/semconv.js +39 -0
  35. package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +1 -0
  36. package/build/esm/package.json +1 -1
  37. package/build/esm/utils/redisCache.js.map +1 -1
  38. package/build/types/integrations/http.d.ts +8 -15
  39. package/build/types/integrations/http.d.ts.map +1 -1
  40. package/build/types/integrations/tracing/index.d.ts.map +1 -1
  41. package/build/types/integrations/tracing/{redis.d.ts → redis/index.d.ts} +3 -3
  42. package/build/types/integrations/tracing/redis/index.d.ts.map +1 -0
  43. package/build/types/integrations/tracing/redis/redis-dc-subscriber.d.ts +17 -0
  44. package/build/types/integrations/tracing/redis/redis-dc-subscriber.d.ts.map +1 -0
  45. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +15 -0
  46. package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts.map +1 -0
  47. package/build/types/integrations/tracing/redis/vendored/redis-common.d.ts +6 -0
  48. package/build/types/integrations/tracing/redis/vendored/redis-common.d.ts.map +1 -0
  49. package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts +16 -0
  50. package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts.map +1 -0
  51. package/build/types/integrations/tracing/redis/vendored/semconv.d.ts +8 -0
  52. package/build/types/integrations/tracing/redis/vendored/semconv.d.ts.map +1 -0
  53. package/build/types/integrations/tracing/redis/vendored/types.d.ts +58 -0
  54. package/build/types/integrations/tracing/redis/vendored/types.d.ts.map +1 -0
  55. package/build/types/utils/redisCache.d.ts +1 -1
  56. package/build/types/utils/redisCache.d.ts.map +1 -1
  57. package/build/types-ts3.8/integrations/http.d.ts +8 -15
  58. package/build/types-ts3.8/integrations/tracing/{redis.d.ts → redis/index.d.ts} +3 -3
  59. package/build/types-ts3.8/integrations/tracing/redis/redis-dc-subscriber.d.ts +17 -0
  60. package/build/types-ts3.8/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +15 -0
  61. package/build/types-ts3.8/integrations/tracing/redis/vendored/redis-common.d.ts +6 -0
  62. package/build/types-ts3.8/integrations/tracing/redis/vendored/redis-instrumentation.d.ts +16 -0
  63. package/build/types-ts3.8/integrations/tracing/redis/vendored/semconv.d.ts +8 -0
  64. package/build/types-ts3.8/integrations/tracing/redis/vendored/types.d.ts +58 -0
  65. package/build/types-ts3.8/utils/redisCache.d.ts +1 -1
  66. package/package.json +4 -6
  67. package/build/cjs/integrations/tracing/redis.js.map +0 -1
  68. package/build/esm/integrations/tracing/redis.js.map +0 -1
  69. package/build/types/integrations/tracing/redis.d.ts.map +0 -1
@@ -12,7 +12,7 @@ const mongo = require('./integrations/tracing/mongo.js');
12
12
  const mongoose = require('./integrations/tracing/mongoose.js');
13
13
  const mysql = require('./integrations/tracing/mysql.js');
14
14
  const mysql2 = require('./integrations/tracing/mysql2.js');
15
- const redis = require('./integrations/tracing/redis.js');
15
+ const index$b = require('./integrations/tracing/redis/index.js');
16
16
  const postgres = require('./integrations/tracing/postgres.js');
17
17
  const postgresjs = require('./integrations/tracing/postgresjs.js');
18
18
  const prisma = require('./integrations/tracing/prisma.js');
@@ -25,7 +25,7 @@ const tedious = require('./integrations/tracing/tedious.js');
25
25
  const genericPool = require('./integrations/tracing/genericPool.js');
26
26
  const dataloader = require('./integrations/tracing/dataloader.js');
27
27
  const amqplib = require('./integrations/tracing/amqplib.js');
28
- const index$b = require('./integrations/tracing/vercelai/index.js');
28
+ const index$c = require('./integrations/tracing/vercelai/index.js');
29
29
  const index$a = require('./integrations/tracing/openai/index.js');
30
30
  const index = require('./integrations/tracing/anthropic-ai/index.js');
31
31
  const index$4 = require('./integrations/tracing/google-genai/index.js');
@@ -60,7 +60,7 @@ exports.mongoIntegration = mongo.mongoIntegration;
60
60
  exports.mongooseIntegration = mongoose.mongooseIntegration;
61
61
  exports.mysqlIntegration = mysql.mysqlIntegration;
62
62
  exports.mysql2Integration = mysql2.mysql2Integration;
63
- exports.redisIntegration = redis.redisIntegration;
63
+ exports.redisIntegration = index$b.redisIntegration;
64
64
  exports.postgresIntegration = postgres.postgresIntegration;
65
65
  exports.postgresJsIntegration = postgresjs.postgresJsIntegration;
66
66
  exports.prismaIntegration = prisma.prismaIntegration;
@@ -77,7 +77,7 @@ exports.tediousIntegration = tedious.tediousIntegration;
77
77
  exports.genericPoolIntegration = genericPool.genericPoolIntegration;
78
78
  exports.dataloaderIntegration = dataloader.dataloaderIntegration;
79
79
  exports.amqplibIntegration = amqplib.amqplibIntegration;
80
- exports.vercelAIIntegration = index$b.vercelAIIntegration;
80
+ exports.vercelAIIntegration = index$c.vercelAIIntegration;
81
81
  exports.openAIIntegration = index$a.openAIIntegration;
82
82
  exports.anthropicAIIntegration = index.anthropicAIIntegration;
83
83
  exports.googleGenAIIntegration = index$4.googleGenAIIntegration;
@@ -1,20 +1,12 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
- const api = require('@opentelemetry/api');
4
- const instrumentationHttp = require('@opentelemetry/instrumentation-http');
5
3
  const core = require('@sentry/core');
6
4
  const nodeCore = require('@sentry/node-core');
7
5
 
8
6
  const INTEGRATION_NAME = 'Http';
9
7
 
10
- const INSTRUMENTATION_NAME = '@opentelemetry_sentry-patched/instrumentation-http';
11
-
12
- // The `http.client.request.created` diagnostics channel, needed for trace propagation,
13
- // was added in Node 22.12.0 (backported from 23.2.0). Earlier 22.x versions don't have it.
14
- const FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL =
15
- (nodeCore.NODE_VERSION.major === 22 && nodeCore.NODE_VERSION.minor >= 12) ||
16
- (nodeCore.NODE_VERSION.major === 23 && nodeCore.NODE_VERSION.minor >= 2) ||
17
- nodeCore.NODE_VERSION.major >= 24;
8
+ // TODO(v11): Consolidate all the various HTTP integration options into one,
9
+ // and deprecate the duplicated and aliased options.
18
10
 
19
11
  const instrumentSentryHttp = nodeCore.generateInstrumentOnce(
20
12
  `${INTEGRATION_NAME}.sentry`,
@@ -23,65 +15,6 @@ const instrumentSentryHttp = nodeCore.generateInstrumentOnce(
23
15
  },
24
16
  );
25
17
 
26
- const instrumentOtelHttp = nodeCore.generateInstrumentOnce(INTEGRATION_NAME, config => {
27
- const instrumentation = new instrumentationHttp.HttpInstrumentation({
28
- ...config,
29
- // This is hard-coded and can never be overridden by the user
30
- disableIncomingRequestInstrumentation: true,
31
- });
32
-
33
- // We want to update the logger namespace so we can better identify what is happening here
34
- try {
35
- instrumentation['_diag'] = api.diag.createComponentLogger({
36
- namespace: INSTRUMENTATION_NAME,
37
- });
38
- // @ts-expect-error We are writing a read-only property here...
39
- instrumentation.instrumentationName = INSTRUMENTATION_NAME;
40
- } catch {
41
- // ignore errors here...
42
- }
43
-
44
- // The OTel HttpInstrumentation (>=0.213.0) has a guard (`_httpPatched`/`_httpsPatched`)
45
- // that prevents patching `http`/`https` when loaded by both CJS `require()` and ESM `import`.
46
- // In environments like AWS Lambda, the runtime loads `http` via CJS first (for the Runtime API),
47
- // and then the user's ESM handler imports `node:http`. The guard blocks ESM patching after CJS,
48
- // which breaks HTTP spans for ESM handlers. We disable this guard to allow both to be patched.
49
- // TODO(andrei): Remove once https://github.com/open-telemetry/opentelemetry-js/issues/6489 is fixed.
50
- try {
51
- const noopDescriptor = { get: () => false, set: () => {} };
52
- Object.defineProperty(instrumentation, '_httpPatched', noopDescriptor);
53
- Object.defineProperty(instrumentation, '_httpsPatched', noopDescriptor);
54
- } catch {
55
- // ignore errors here...
56
- }
57
-
58
- return instrumentation;
59
- });
60
-
61
- /** Exported only for tests. */
62
- function _shouldUseOtelHttpInstrumentation(
63
- options,
64
- clientOptions = {},
65
- ) {
66
- // If `spans` is passed in, it takes precedence
67
- // Else, we by default emit spans, unless `skipOpenTelemetrySetup` is set to `true` or spans are not enabled
68
- if (typeof options.spans === 'boolean') {
69
- return options.spans;
70
- }
71
-
72
- if (clientOptions.skipOpenTelemetrySetup) {
73
- return false;
74
- }
75
-
76
- // IMPORTANT: We only disable span instrumentation when spans are not enabled _and_ we are on a Node version
77
- // that fully supports the necessary diagnostics channels for trace propagation
78
- if (!core.hasSpansEnabled(clientOptions) && FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL) {
79
- return false;
80
- }
81
-
82
- return true;
83
- }
84
-
85
18
  /**
86
19
  * The http integration instruments Node's internal http and https modules.
87
20
  * It creates breadcrumbs and spans for outgoing HTTP requests which will be attached to the currently active span.
@@ -89,6 +22,7 @@ function _shouldUseOtelHttpInstrumentation(
89
22
  const httpIntegration = core.defineIntegration((options = {}) => {
90
23
  const spans = options.spans ?? true;
91
24
  const disableIncomingRequestSpans = options.disableIncomingRequestSpans;
25
+ const enableServerSpans = spans && !disableIncomingRequestSpans;
92
26
 
93
27
  const serverOptions = {
94
28
  sessions: options.trackIncomingRequestsAsSessions,
@@ -103,13 +37,11 @@ const httpIntegration = core.defineIntegration((options = {}) => {
103
37
  ignoreStatusCodes: options.dropSpansForIncomingRequestStatusCodes,
104
38
  instrumentation: options.instrumentation,
105
39
  onSpanCreated: options.incomingRequestSpanHook,
106
- } ;
40
+ };
107
41
 
108
42
  const server = nodeCore.httpServerIntegration(serverOptions);
109
43
  const serverSpans = nodeCore.httpServerSpansIntegration(serverSpansOptions);
110
44
 
111
- const enableServerSpans = spans && !disableIncomingRequestSpans;
112
-
113
45
  return {
114
46
  name: INTEGRATION_NAME,
115
47
  setup(client) {
@@ -120,105 +52,46 @@ const httpIntegration = core.defineIntegration((options = {}) => {
120
52
  }
121
53
  },
122
54
  setupOnce() {
123
- const clientOptions = (core.getClient()?.getOptions() || {}) ;
124
- const useOtelHttpInstrumentation = _shouldUseOtelHttpInstrumentation(options, clientOptions);
125
-
126
55
  server.setupOnce();
127
56
 
128
57
  const sentryHttpInstrumentationOptions = {
129
58
  breadcrumbs: options.breadcrumbs,
130
- propagateTraceInOutgoingRequests:
131
- typeof options.tracePropagation === 'boolean'
132
- ? options.tracePropagation
133
- : FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL || !useOtelHttpInstrumentation,
134
- createSpansForOutgoingRequests: FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL,
135
- spans: options.spans,
59
+ spans,
60
+ propagateTraceInOutgoingRequests: options.tracePropagation ?? true,
61
+ createSpansForOutgoingRequests: spans,
136
62
  ignoreOutgoingRequests: options.ignoreOutgoingRequests,
137
63
  outgoingRequestHook: (span, request) => {
138
64
  // Sanitize data URLs to prevent long base64 strings in span attributes
139
- const url = nodeCore.getRequestUrl(request);
65
+ const url = core.getRequestUrlFromClientRequest(request);
140
66
  if (url.startsWith('data:')) {
141
67
  const sanitizedUrl = core.stripDataUrlContent(url);
68
+ // TODO(v11): Update these to the Sentry semantic attributes.
69
+ // https://getsentry.github.io/sentry-conventions/attributes/
142
70
  span.setAttribute('http.url', sanitizedUrl);
143
71
  span.setAttribute(core.SEMANTIC_ATTRIBUTE_URL_FULL, sanitizedUrl);
144
72
  span.updateName(`${request.method || 'GET'} ${sanitizedUrl}`);
145
73
  }
146
-
147
74
  options.instrumentation?.requestHook?.(span, request);
148
75
  },
149
76
  outgoingResponseHook: options.instrumentation?.responseHook,
150
77
  outgoingRequestApplyCustomAttributes: options.instrumentation?.applyCustomAttributesOnSpan,
151
- } ;
78
+ };
152
79
 
153
- // This is Sentry-specific instrumentation for outgoing request breadcrumbs & trace propagation
80
+ // This is Sentry-specific instrumentation for outgoing request
81
+ // breadcrumbs & trace propagation. It uses the diagnostic channels on
82
+ // node versions that support it, falling back to monkey-patching when
83
+ // needed.
154
84
  instrumentSentryHttp(sentryHttpInstrumentationOptions);
155
-
156
- // This is the "regular" OTEL instrumentation that emits outgoing request spans
157
- if (useOtelHttpInstrumentation) {
158
- const instrumentationConfig = getConfigWithDefaults(options);
159
- instrumentOtelHttp(instrumentationConfig);
160
- }
161
85
  },
162
86
  processEvent(event) {
163
- // Note: We always run this, even if spans are disabled
164
- // The reason being that e.g. the remix integration disables span creation here but still wants to use the ignore status codes option
87
+ // Always run this, even if spans are disabled
88
+ // The reason being that e.g. the remix integration disables span
89
+ // creation here but still wants to use the ignore status codes option
165
90
  return serverSpans.processEvent(event);
166
91
  },
167
92
  };
168
93
  });
169
94
 
170
- function getConfigWithDefaults(options = {}) {
171
- const instrumentationConfig = {
172
- // This is handled by the SentryHttpInstrumentation on Node 22+
173
- disableOutgoingRequestInstrumentation: FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL,
174
-
175
- ignoreOutgoingRequestHook: request => {
176
- const url = nodeCore.getRequestUrl(request);
177
-
178
- if (!url) {
179
- return false;
180
- }
181
-
182
- const _ignoreOutgoingRequests = options.ignoreOutgoingRequests;
183
- if (_ignoreOutgoingRequests?.(url, request)) {
184
- return true;
185
- }
186
-
187
- return false;
188
- },
189
-
190
- requireParentforOutgoingSpans: false,
191
- requestHook: (span, req) => {
192
- nodeCore.addOriginToSpan(span, 'auto.http.otel.http');
193
-
194
- // Sanitize data URLs to prevent long base64 strings in span attributes
195
- const url = nodeCore.getRequestUrl(req );
196
- if (url.startsWith('data:')) {
197
- const sanitizedUrl = core.stripDataUrlContent(url);
198
- span.setAttribute('http.url', sanitizedUrl);
199
- span.setAttribute(core.SEMANTIC_ATTRIBUTE_URL_FULL, sanitizedUrl);
200
- span.updateName(`${(req ).method || 'GET'} ${sanitizedUrl}`);
201
- }
202
-
203
- options.instrumentation?.requestHook?.(span, req);
204
- },
205
- responseHook: (span, res) => {
206
- options.instrumentation?.responseHook?.(span, res);
207
- },
208
- applyCustomAttributesOnSpan: (
209
- span,
210
- request,
211
- response,
212
- ) => {
213
- options.instrumentation?.applyCustomAttributesOnSpan?.(span, request, response);
214
- },
215
- } ;
216
-
217
- return instrumentationConfig;
218
- }
219
-
220
- exports._shouldUseOtelHttpInstrumentation = _shouldUseOtelHttpInstrumentation;
221
95
  exports.httpIntegration = httpIntegration;
222
- exports.instrumentOtelHttp = instrumentOtelHttp;
223
96
  exports.instrumentSentryHttp = instrumentSentryHttp;
224
97
  //# sourceMappingURL=http.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sources":["../../../src/integrations/http.ts"],"sourcesContent":["import type { ClientRequest, IncomingMessage, RequestOptions, ServerResponse } from 'node:http';\nimport { diag } from '@opentelemetry/api';\nimport type { HttpInstrumentationConfig } from '@opentelemetry/instrumentation-http';\nimport { HttpInstrumentation } from '@opentelemetry/instrumentation-http';\nimport type { Span } from '@sentry/core';\nimport {\n defineIntegration,\n getClient,\n hasSpansEnabled,\n SEMANTIC_ATTRIBUTE_URL_FULL,\n stripDataUrlContent,\n} from '@sentry/core';\nimport type { HTTPModuleRequestIncomingMessage, NodeClient, SentryHttpInstrumentationOptions } from '@sentry/node-core';\nimport {\n addOriginToSpan,\n generateInstrumentOnce,\n getRequestUrl,\n httpServerIntegration,\n httpServerSpansIntegration,\n NODE_VERSION,\n SentryHttpInstrumentation,\n} from '@sentry/node-core';\nimport type { NodeClientOptions } from '../types';\n\nconst INTEGRATION_NAME = 'Http';\n\nconst INSTRUMENTATION_NAME = '@opentelemetry_sentry-patched/instrumentation-http';\n\n// The `http.client.request.created` diagnostics channel, needed for trace propagation,\n// was added in Node 22.12.0 (backported from 23.2.0). Earlier 22.x versions don't have it.\nconst FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL =\n (NODE_VERSION.major === 22 && NODE_VERSION.minor >= 12) ||\n (NODE_VERSION.major === 23 && NODE_VERSION.minor >= 2) ||\n NODE_VERSION.major >= 24;\n\ninterface HttpOptions {\n /**\n * Whether breadcrumbs should be recorded for outgoing requests.\n * Defaults to true\n */\n breadcrumbs?: boolean;\n\n /**\n * If set to false, do not emit any spans.\n * This will ensure that the default HttpInstrumentation from OpenTelemetry is not setup,\n * only the Sentry-specific instrumentation for request isolation is applied.\n *\n * If `skipOpenTelemetrySetup: true` is configured, this defaults to `false`, otherwise it defaults to `true`.\n */\n spans?: boolean;\n\n /**\n * Whether the integration should create [Sessions](https://docs.sentry.io/product/releases/health/#sessions) for incoming requests to track the health and crash-free rate of your releases in Sentry.\n * Read more about Release Health: https://docs.sentry.io/product/releases/health/\n *\n * Defaults to `true`.\n */\n trackIncomingRequestsAsSessions?: boolean;\n\n /**\n * Number of milliseconds until sessions tracked with `trackIncomingRequestsAsSessions` will be flushed as a session aggregate.\n *\n * Defaults to `60000` (60s).\n */\n sessionFlushingDelayMS?: number;\n\n /**\n * Whether to inject trace propagation headers (sentry-trace, baggage, traceparent) into outgoing HTTP requests.\n *\n * When set to `false`, Sentry will not inject any trace propagation headers, but will still create breadcrumbs\n * (if `breadcrumbs` is enabled). This is useful when `skipOpenTelemetrySetup: true` is configured and you want\n * to avoid duplicate trace headers being injected by both Sentry and OpenTelemetry's HttpInstrumentation.\n *\n * @default `true`\n */\n tracePropagation?: boolean;\n\n /**\n * Do not capture spans or breadcrumbs for outgoing HTTP requests to URLs where the given callback returns `true`.\n * This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.\n *\n * The `url` param contains the entire URL, including query string (if any), protocol, host, etc. of the outgoing request.\n * For example: `'https://someService.com/users/details?id=123'`\n *\n * The `request` param contains the original {@type RequestOptions} object used to make the outgoing request.\n * You can use it to filter on additional properties like method, headers, etc.\n */\n ignoreOutgoingRequests?: (url: string, request: RequestOptions) => boolean;\n\n /**\n * Do not capture spans for incoming HTTP requests to URLs where the given callback returns `true`.\n * Spans will be non recording if tracing is disabled.\n *\n * The `urlPath` param consists of the URL path and query string (if any) of the incoming request.\n * For example: `'/users/details?id=123'`\n *\n * The `request` param contains the original {@type IncomingMessage} object of the incoming request.\n * You can use it to filter on additional properties like method, headers, etc.\n */\n ignoreIncomingRequests?: (urlPath: string, request: IncomingMessage) => boolean;\n\n /**\n * A hook that can be used to mutate the span for incoming requests.\n * This is triggered after the span is created, but before it is recorded.\n */\n incomingRequestSpanHook?: (span: Span, request: IncomingMessage, response: ServerResponse) => void;\n\n /**\n * Whether to automatically ignore common static asset requests like favicon.ico, robots.txt, etc.\n * This helps reduce noise in your transactions.\n *\n * @default `true`\n */\n ignoreStaticAssets?: boolean;\n\n /**\n * Do not capture spans for incoming HTTP requests with the given status codes.\n * By default, spans with some 3xx and 4xx status codes are ignored (see @default).\n * Expects an array of status codes or a range of status codes, e.g. [[300,399], 404] would ignore 3xx and 404 status codes.\n *\n * @default `[[401, 404], [301, 303], [305, 399]]`\n */\n dropSpansForIncomingRequestStatusCodes?: (number | [number, number])[];\n\n /**\n * Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.\n * This can be useful for long running requests where the body is not needed and we want to avoid capturing it.\n *\n * @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the incoming request.\n * @param request Contains the {@type RequestOptions} object used to make the incoming request.\n */\n ignoreIncomingRequestBody?: (url: string, request: RequestOptions) => boolean;\n\n /**\n * Controls the maximum size of incoming HTTP request bodies attached to events.\n *\n * Available options:\n * - 'none': No request bodies will be attached\n * - 'small': Request bodies up to 1,000 bytes will be attached\n * - 'medium': Request bodies up to 10,000 bytes will be attached (default)\n * - 'always': Request bodies will always be attached\n *\n * Note that even with 'always' setting, bodies exceeding 1MB will never be attached\n * for performance and security reasons.\n *\n * @default 'medium'\n */\n maxIncomingRequestBodySize?: 'none' | 'small' | 'medium' | 'always';\n\n /**\n * If true, do not generate spans for incoming requests at all.\n * This is used by Remix to avoid generating spans for incoming requests, as it generates its own spans.\n */\n disableIncomingRequestSpans?: boolean;\n\n /**\n * Additional instrumentation options that are passed to the underlying HttpInstrumentation.\n */\n instrumentation?: {\n requestHook?: (span: Span, req: ClientRequest | HTTPModuleRequestIncomingMessage) => void;\n responseHook?: (span: Span, response: HTTPModuleRequestIncomingMessage | ServerResponse) => void;\n applyCustomAttributesOnSpan?: (\n span: Span,\n request: ClientRequest | HTTPModuleRequestIncomingMessage,\n response: HTTPModuleRequestIncomingMessage | ServerResponse,\n ) => void;\n };\n}\n\nexport const instrumentSentryHttp = generateInstrumentOnce<SentryHttpInstrumentationOptions>(\n `${INTEGRATION_NAME}.sentry`,\n options => {\n return new SentryHttpInstrumentation(options);\n },\n);\n\nexport const instrumentOtelHttp = generateInstrumentOnce<HttpInstrumentationConfig>(INTEGRATION_NAME, config => {\n const instrumentation = new HttpInstrumentation({\n ...config,\n // This is hard-coded and can never be overridden by the user\n disableIncomingRequestInstrumentation: true,\n });\n\n // We want to update the logger namespace so we can better identify what is happening here\n try {\n instrumentation['_diag'] = diag.createComponentLogger({\n namespace: INSTRUMENTATION_NAME,\n });\n // @ts-expect-error We are writing a read-only property here...\n instrumentation.instrumentationName = INSTRUMENTATION_NAME;\n } catch {\n // ignore errors here...\n }\n\n // The OTel HttpInstrumentation (>=0.213.0) has a guard (`_httpPatched`/`_httpsPatched`)\n // that prevents patching `http`/`https` when loaded by both CJS `require()` and ESM `import`.\n // In environments like AWS Lambda, the runtime loads `http` via CJS first (for the Runtime API),\n // and then the user's ESM handler imports `node:http`. The guard blocks ESM patching after CJS,\n // which breaks HTTP spans for ESM handlers. We disable this guard to allow both to be patched.\n // TODO(andrei): Remove once https://github.com/open-telemetry/opentelemetry-js/issues/6489 is fixed.\n try {\n const noopDescriptor = { get: () => false, set: () => {} };\n Object.defineProperty(instrumentation, '_httpPatched', noopDescriptor);\n Object.defineProperty(instrumentation, '_httpsPatched', noopDescriptor);\n } catch {\n // ignore errors here...\n }\n\n return instrumentation;\n});\n\n/** Exported only for tests. */\nexport function _shouldUseOtelHttpInstrumentation(\n options: HttpOptions,\n clientOptions: Partial<NodeClientOptions> = {},\n): boolean {\n // If `spans` is passed in, it takes precedence\n // Else, we by default emit spans, unless `skipOpenTelemetrySetup` is set to `true` or spans are not enabled\n if (typeof options.spans === 'boolean') {\n return options.spans;\n }\n\n if (clientOptions.skipOpenTelemetrySetup) {\n return false;\n }\n\n // IMPORTANT: We only disable span instrumentation when spans are not enabled _and_ we are on a Node version\n // that fully supports the necessary diagnostics channels for trace propagation\n if (!hasSpansEnabled(clientOptions) && FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL) {\n return false;\n }\n\n return true;\n}\n\n/**\n * The http integration instruments Node's internal http and https modules.\n * It creates breadcrumbs and spans for outgoing HTTP requests which will be attached to the currently active span.\n */\nexport const httpIntegration = defineIntegration((options: HttpOptions = {}) => {\n const spans = options.spans ?? true;\n const disableIncomingRequestSpans = options.disableIncomingRequestSpans;\n\n const serverOptions = {\n sessions: options.trackIncomingRequestsAsSessions,\n sessionFlushingDelayMS: options.sessionFlushingDelayMS,\n ignoreRequestBody: options.ignoreIncomingRequestBody,\n maxRequestBodySize: options.maxIncomingRequestBodySize,\n } satisfies Parameters<typeof httpServerIntegration>[0];\n\n const serverSpansOptions = {\n ignoreIncomingRequests: options.ignoreIncomingRequests,\n ignoreStaticAssets: options.ignoreStaticAssets,\n ignoreStatusCodes: options.dropSpansForIncomingRequestStatusCodes,\n instrumentation: options.instrumentation,\n onSpanCreated: options.incomingRequestSpanHook,\n } satisfies Parameters<typeof httpServerSpansIntegration>[0];\n\n const server = httpServerIntegration(serverOptions);\n const serverSpans = httpServerSpansIntegration(serverSpansOptions);\n\n const enableServerSpans = spans && !disableIncomingRequestSpans;\n\n return {\n name: INTEGRATION_NAME,\n setup(client: NodeClient) {\n const clientOptions = client.getOptions();\n\n if (enableServerSpans && hasSpansEnabled(clientOptions)) {\n serverSpans.setup(client);\n }\n },\n setupOnce() {\n const clientOptions = (getClient<NodeClient>()?.getOptions() || {}) satisfies Partial<NodeClientOptions>;\n const useOtelHttpInstrumentation = _shouldUseOtelHttpInstrumentation(options, clientOptions);\n\n server.setupOnce();\n\n const sentryHttpInstrumentationOptions = {\n breadcrumbs: options.breadcrumbs,\n propagateTraceInOutgoingRequests:\n typeof options.tracePropagation === 'boolean'\n ? options.tracePropagation\n : FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL || !useOtelHttpInstrumentation,\n createSpansForOutgoingRequests: FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL,\n spans: options.spans,\n ignoreOutgoingRequests: options.ignoreOutgoingRequests,\n outgoingRequestHook: (span: Span, request: ClientRequest) => {\n // Sanitize data URLs to prevent long base64 strings in span attributes\n const url = getRequestUrl(request);\n if (url.startsWith('data:')) {\n const sanitizedUrl = stripDataUrlContent(url);\n span.setAttribute('http.url', sanitizedUrl);\n span.setAttribute(SEMANTIC_ATTRIBUTE_URL_FULL, sanitizedUrl);\n span.updateName(`${request.method || 'GET'} ${sanitizedUrl}`);\n }\n\n options.instrumentation?.requestHook?.(span, request);\n },\n outgoingResponseHook: options.instrumentation?.responseHook,\n outgoingRequestApplyCustomAttributes: options.instrumentation?.applyCustomAttributesOnSpan,\n } satisfies SentryHttpInstrumentationOptions;\n\n // This is Sentry-specific instrumentation for outgoing request breadcrumbs & trace propagation\n instrumentSentryHttp(sentryHttpInstrumentationOptions);\n\n // This is the \"regular\" OTEL instrumentation that emits outgoing request spans\n if (useOtelHttpInstrumentation) {\n const instrumentationConfig = getConfigWithDefaults(options);\n instrumentOtelHttp(instrumentationConfig);\n }\n },\n processEvent(event) {\n // Note: We always run this, even if spans are disabled\n // The reason being that e.g. the remix integration disables span creation here but still wants to use the ignore status codes option\n return serverSpans.processEvent(event);\n },\n };\n});\n\nfunction getConfigWithDefaults(options: Partial<HttpOptions> = {}): HttpInstrumentationConfig {\n const instrumentationConfig = {\n // This is handled by the SentryHttpInstrumentation on Node 22+\n disableOutgoingRequestInstrumentation: FULLY_SUPPORTS_HTTP_DIAGNOSTICS_CHANNEL,\n\n ignoreOutgoingRequestHook: request => {\n const url = getRequestUrl(request);\n\n if (!url) {\n return false;\n }\n\n const _ignoreOutgoingRequests = options.ignoreOutgoingRequests;\n if (_ignoreOutgoingRequests?.(url, request)) {\n return true;\n }\n\n return false;\n },\n\n requireParentforOutgoingSpans: false,\n requestHook: (span, req) => {\n addOriginToSpan(span, 'auto.http.otel.http');\n\n // Sanitize data URLs to prevent long base64 strings in span attributes\n const url = getRequestUrl(req as ClientRequest);\n if (url.startsWith('data:')) {\n const sanitizedUrl = stripDataUrlContent(url);\n span.setAttribute('http.url', sanitizedUrl);\n span.setAttribute(SEMANTIC_ATTRIBUTE_URL_FULL, sanitizedUrl);\n span.updateName(`${(req as ClientRequest).method || 'GET'} ${sanitizedUrl}`);\n }\n\n options.instrumentation?.requestHook?.(span, req);\n },\n responseHook: (span, res) => {\n options.instrumentation?.responseHook?.(span, res);\n },\n applyCustomAttributesOnSpan: (\n span: Span,\n request: ClientRequest | HTTPModuleRequestIncomingMessage,\n response: HTTPModuleRequestIncomingMessage | ServerResponse,\n ) => {\n options.instrumentation?.applyCustomAttributesOnSpan?.(span, request, response);\n },\n } satisfies HttpInstrumentationConfig;\n\n return instrumentationConfig;\n}\n"],"names":["NODE_VERSION","generateInstrumentOnce","SentryHttpInstrumentation","HttpInstrumentation","diag","hasSpansEnabled","defineIntegration","httpServerIntegration","httpServerSpansIntegration","getClient","getRequestUrl","stripDataUrlContent","SEMANTIC_ATTRIBUTE_URL_FULL","addOriginToSpan"],"mappings":";;;;;;;AAwBA,MAAM,gBAAA,GAAmB,MAAM;;AAE/B,MAAM,oBAAA,GAAuB,oDAAoD;;AAEjF;AACA;AACA,MAAM,uCAAA;AACN,EAAE,CAACA,qBAAY,CAAC,KAAA,KAAU,EAAA,IAAMA,qBAAY,CAAC,KAAA,IAAS,EAAE;AACxD,GAAGA,qBAAY,CAAC,KAAA,KAAU,EAAA,IAAMA,qBAAY,CAAC,KAAA,IAAS,CAAC,CAAA;AACvD,EAAEA,qBAAY,CAAC,KAAA,IAAS,EAAE;;AAwInB,MAAM,oBAAA,GAAuBC,+BAAsB;AAC1D,EAAE,CAAC,EAAA,gBAAA,CAAA,OAAA,CAA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GAAA,MAAA,IAAA,KAAA,CAAA,CAAA,EAAA,YAAA,CAAA,CAAA,CAAA;AACA,MAAA;;AAEA,MAAA,OAAA,CAAA,eAAA,EAAA,WAAA,GAAA,IAAA,EAAA,GAAA,CAAA;AACA,IAAA,CAAA;AACA,IAAA,YAAA,EAAA,CAAA,IAAA,EAAA,GAAA,KAAA;AACA,MAAA,OAAA,CAAA,eAAA,EAAA,YAAA,GAAA,IAAA,EAAA,GAAA,CAAA;AACA,IAAA,CAAA;AACA,IAAA,2BAAA,EAAA;AACA,MAAA,IAAA;AACA,MAAA,OAAA;AACA,MAAA,QAAA;AACA,SAAA;AACA,MAAA,OAAA,CAAA,eAAA,EAAA,2BAAA,GAAA,IAAA,EAAA,OAAA,EAAA,QAAA,CAAA;AACA,IAAA,CAAA;AACA,GAAA;;AAEA,EAAA,OAAA,qBAAA;AACA;;;;;;;"}
1
+ {"version":3,"file":"http.js","sources":["../../../src/integrations/http.ts"],"sourcesContent":["import type { RequestOptions } from 'node:http';\nimport type { HttpClientRequest, HttpIncomingMessage, HttpServerResponse, Span } from '@sentry/core';\nimport {\n defineIntegration,\n hasSpansEnabled,\n SEMANTIC_ATTRIBUTE_URL_FULL,\n stripDataUrlContent,\n getRequestUrlFromClientRequest,\n} from '@sentry/core';\nimport type {\n NodeClient,\n SentryHttpInstrumentationOptions,\n HttpServerIntegrationOptions,\n HttpServerSpansIntegrationOptions,\n} from '@sentry/node-core';\nimport {\n generateInstrumentOnce,\n httpServerIntegration,\n httpServerSpansIntegration,\n SentryHttpInstrumentation,\n} from '@sentry/node-core';\n\nconst INTEGRATION_NAME = 'Http';\n\n// TODO(v11): Consolidate all the various HTTP integration options into one,\n// and deprecate the duplicated and aliased options.\ninterface HttpOptions {\n /**\n * Whether breadcrumbs should be recorded for outgoing requests.\n * Defaults to true\n */\n breadcrumbs?: boolean;\n\n /**\n * If set to false, do not emit any spans.\n * This will ensure that the default HttpInstrumentation from OpenTelemetry is not setup,\n * only the Sentry-specific instrumentation for request isolation is applied.\n *\n * If `skipOpenTelemetrySetup: true` is configured, this defaults to `false`, otherwise it defaults to `true`.\n */\n spans?: boolean;\n\n /**\n * Whether the integration should create [Sessions](https://docs.sentry.io/product/releases/health/#sessions) for incoming requests to track the health and crash-free rate of your releases in Sentry.\n * Read more about Release Health: https://docs.sentry.io/product/releases/health/\n *\n * Defaults to `true`.\n */\n trackIncomingRequestsAsSessions?: boolean;\n\n /**\n * Number of milliseconds until sessions tracked with `trackIncomingRequestsAsSessions` will be flushed as a session aggregate.\n *\n * Defaults to `60000` (60s).\n */\n sessionFlushingDelayMS?: number;\n\n /**\n * Whether to inject trace propagation headers (sentry-trace, baggage, traceparent) into outgoing HTTP requests.\n *\n * When set to `false`, Sentry will not inject any trace propagation headers, but will still create breadcrumbs\n * (if `breadcrumbs` is enabled). This is useful when `skipOpenTelemetrySetup: true` is configured and you want\n * to avoid duplicate trace headers being injected by both Sentry and OpenTelemetry's HttpInstrumentation.\n *\n * @default `true`\n */\n tracePropagation?: boolean;\n\n /**\n * Do not capture spans or breadcrumbs for outgoing HTTP requests to URLs where the given callback returns `true`.\n * This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.\n *\n * The `url` param contains the entire URL, including query string (if any), protocol, host, etc. of the outgoing request.\n * For example: `'https://someService.com/users/details?id=123'`\n *\n * The `request` param contains the original {@type RequestOptions} object used to make the outgoing request.\n * You can use it to filter on additional properties like method, headers, etc.\n */\n ignoreOutgoingRequests?: (url: string, request: RequestOptions) => boolean;\n\n /**\n * Do not capture spans for incoming HTTP requests to URLs where the given callback returns `true`.\n * Spans will be non recording if tracing is disabled.\n *\n * The `urlPath` param consists of the URL path and query string (if any) of the incoming request.\n * For example: `'/users/details?id=123'`\n *\n * The `request` param contains the original {@type IncomingMessage} object of the incoming request.\n * You can use it to filter on additional properties like method, headers, etc.\n */\n ignoreIncomingRequests?: (urlPath: string, request: HttpIncomingMessage) => boolean;\n\n /**\n * A hook that can be used to mutate the span for incoming requests.\n * This is triggered after the span is created, but before it is recorded.\n */\n incomingRequestSpanHook?: (span: Span, request: HttpIncomingMessage, response: HttpServerResponse) => void;\n\n /**\n * Whether to automatically ignore common static asset requests like favicon.ico, robots.txt, etc.\n * This helps reduce noise in your transactions.\n *\n * @default `true`\n */\n ignoreStaticAssets?: boolean;\n\n /**\n * Do not capture spans for incoming HTTP requests with the given status codes.\n * By default, spans with some 3xx and 4xx status codes are ignored (see @default).\n * Expects an array of status codes or a range of status codes, e.g. [[300,399], 404] would ignore 3xx and 404 status codes.\n *\n * @default `[[401, 404], [301, 303], [305, 399]]`\n */\n dropSpansForIncomingRequestStatusCodes?: (number | [number, number])[];\n\n /**\n * Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.\n * This can be useful for long running requests where the body is not needed and we want to avoid capturing it.\n *\n * @param url Contains the entire URL, including query string (if any), protocol, host, etc. of the incoming request.\n * @param request Contains the {@type RequestOptions} object used to make the incoming request.\n */\n ignoreIncomingRequestBody?: (url: string, request: RequestOptions) => boolean;\n\n /**\n * Controls the maximum size of incoming HTTP request bodies attached to events.\n *\n * Available options:\n * - 'none': No request bodies will be attached\n * - 'small': Request bodies up to 1,000 bytes will be attached\n * - 'medium': Request bodies up to 10,000 bytes will be attached (default)\n * - 'always': Request bodies will always be attached\n *\n * Note that even with 'always' setting, bodies exceeding 1MB will never be attached\n * for performance and security reasons.\n *\n * @default 'medium'\n */\n maxIncomingRequestBodySize?: 'none' | 'small' | 'medium' | 'always';\n\n /**\n * If true, do not generate spans for incoming requests at all.\n * This is used by Remix to avoid generating spans for incoming requests, as it generates its own spans.\n */\n disableIncomingRequestSpans?: boolean;\n\n /**\n * Additional instrumentation options that are passed to the underlying HttpInstrumentation.\n */\n instrumentation?: {\n requestHook?: (span: Span, req: HttpIncomingMessage | HttpClientRequest) => void;\n responseHook?: (span: Span, response: HttpIncomingMessage | HttpServerResponse) => void;\n applyCustomAttributesOnSpan?: (\n span: Span,\n request: HttpIncomingMessage | HttpClientRequest,\n response: HttpIncomingMessage | HttpServerResponse,\n ) => void;\n };\n}\n\nexport const instrumentSentryHttp = generateInstrumentOnce<SentryHttpInstrumentationOptions>(\n `${INTEGRATION_NAME}.sentry`,\n options => {\n return new SentryHttpInstrumentation(options);\n },\n);\n\n/**\n * The http integration instruments Node's internal http and https modules.\n * It creates breadcrumbs and spans for outgoing HTTP requests which will be attached to the currently active span.\n */\nexport const httpIntegration = defineIntegration((options: HttpOptions = {}) => {\n const spans = options.spans ?? true;\n const disableIncomingRequestSpans = options.disableIncomingRequestSpans;\n const enableServerSpans = spans && !disableIncomingRequestSpans;\n\n const serverOptions = {\n sessions: options.trackIncomingRequestsAsSessions,\n sessionFlushingDelayMS: options.sessionFlushingDelayMS,\n ignoreRequestBody: options.ignoreIncomingRequestBody,\n maxRequestBodySize: options.maxIncomingRequestBodySize,\n } satisfies HttpServerIntegrationOptions;\n\n const serverSpansOptions: HttpServerSpansIntegrationOptions = {\n ignoreIncomingRequests: options.ignoreIncomingRequests,\n ignoreStaticAssets: options.ignoreStaticAssets,\n ignoreStatusCodes: options.dropSpansForIncomingRequestStatusCodes,\n instrumentation: options.instrumentation,\n onSpanCreated: options.incomingRequestSpanHook,\n };\n\n const server = httpServerIntegration(serverOptions);\n const serverSpans = httpServerSpansIntegration(serverSpansOptions);\n\n return {\n name: INTEGRATION_NAME,\n setup(client: NodeClient) {\n const clientOptions = client.getOptions();\n\n if (enableServerSpans && hasSpansEnabled(clientOptions)) {\n serverSpans.setup(client);\n }\n },\n setupOnce() {\n server.setupOnce();\n\n const sentryHttpInstrumentationOptions: SentryHttpInstrumentationOptions = {\n breadcrumbs: options.breadcrumbs,\n spans,\n propagateTraceInOutgoingRequests: options.tracePropagation ?? true,\n createSpansForOutgoingRequests: spans,\n ignoreOutgoingRequests: options.ignoreOutgoingRequests,\n outgoingRequestHook: (span: Span, request: HttpClientRequest) => {\n // Sanitize data URLs to prevent long base64 strings in span attributes\n const url = getRequestUrlFromClientRequest(request);\n if (url.startsWith('data:')) {\n const sanitizedUrl = stripDataUrlContent(url);\n // TODO(v11): Update these to the Sentry semantic attributes.\n // https://getsentry.github.io/sentry-conventions/attributes/\n span.setAttribute('http.url', sanitizedUrl);\n span.setAttribute(SEMANTIC_ATTRIBUTE_URL_FULL, sanitizedUrl);\n span.updateName(`${request.method || 'GET'} ${sanitizedUrl}`);\n }\n options.instrumentation?.requestHook?.(span, request);\n },\n outgoingResponseHook: options.instrumentation?.responseHook,\n outgoingRequestApplyCustomAttributes: options.instrumentation?.applyCustomAttributesOnSpan,\n };\n\n // This is Sentry-specific instrumentation for outgoing request\n // breadcrumbs & trace propagation. It uses the diagnostic channels on\n // node versions that support it, falling back to monkey-patching when\n // needed.\n instrumentSentryHttp(sentryHttpInstrumentationOptions);\n },\n processEvent(event) {\n // Always run this, even if spans are disabled\n // The reason being that e.g. the remix integration disables span\n // creation here but still wants to use the ignore status codes option\n return serverSpans.processEvent(event);\n },\n };\n});\n"],"names":["generateInstrumentOnce","SentryHttpInstrumentation","defineIntegration","httpServerIntegration","httpServerSpansIntegration","hasSpansEnabled","getRequestUrlFromClientRequest","stripDataUrlContent","SEMANTIC_ATTRIBUTE_URL_FULL"],"mappings":";;;;;AAsBA,MAAM,gBAAA,GAAmB,MAAM;;AAE/B;AACA;;AAuIO,MAAM,oBAAA,GAAuBA,+BAAsB;AAC1D,EAAE,CAAC,EAAA,gBAAA,CAAA,OAAA,CAAA;AACA,EAAA,OAAA,IAAA;AACA,IAAA,OAAA,IAAAC,kCAAA,CAAA,OAAA,CAAA;AACA,EAAA,CAAA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAA,eAAA,GAAAC,sBAAA,CAAA,CAAA,OAAA,GAAA,EAAA,KAAA;AACA,EAAA,MAAA,KAAA,GAAA,OAAA,CAAA,KAAA,IAAA,IAAA;AACA,EAAA,MAAA,2BAAA,GAAA,OAAA,CAAA,2BAAA;AACA,EAAA,MAAA,iBAAA,GAAA,KAAA,IAAA,CAAA,2BAAA;;AAEA,EAA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AA,CAAA;AACA,UAAA,IAAA,GAAA,CAAA,UAAA,CAAA,OAAA,CAAA,EAAA;AACA,YAAA,MAAA,YAAA,GAAAC,wBAAA,CAAA,GAAA,CAAA;AACA;AACA;AACA,YAAA,IAAA,CAAA,YAAA,CAAA,UAAA,EAAA,YAAA,CAAA;AACA,YAAA,IAAA,CAAA,YAAA,CAAAC,gCAAA,EAAA,YAAA,CAAA;AACA,YAAA,IAAA,CAAA,UAAA,CAAA,CAAA,EAAA,OAAA,CAAA,MAAA,IAAA,KAAA,CAAA,CAAA,EAAA,YAAA,CAAA,CAAA,CAAA;AACA,UAAA;AACA,UAAA,OAAA,CAAA,eAAA,EAAA,WAAA,GAAA,IAAA,EAAA,OAAA,CAAA;AACA,QAAA,CAAA;AACA,QAAA,oBAAA,EAAA,OAAA,CAAA,eAAA,EAAA,YAAA;AACA,QAAA,oCAAA,EAAA,OAAA,CAAA,eAAA,EAAA,2BAAA;AACA,OAAA;;AAEA;AACA;AACA;AACA;AACA,MAAA,oBAAA,CAAA,gCAAA,CAAA;AACA,IAAA,CAAA;AACA,IAAA,YAAA,CAAA,KAAA,EAAA;AACA;AACA;AACA;AACA,MAAA,OAAA,WAAA,CAAA,YAAA,CAAA,KAAA,CAAA;AACA,IAAA,CAAA;AACA,GAAA;AACA,CAAA;;;;;"}
@@ -2,32 +2,32 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
3
  const http = require('../http.js');
4
4
  const amqplib = require('./amqplib.js');
5
- const index$6 = require('./anthropic-ai/index.js');
5
+ const index$7 = require('./anthropic-ai/index.js');
6
6
  const connect = require('./connect.js');
7
7
  const express = require('./express.js');
8
8
  const index = require('./fastify/index.js');
9
9
  const firebase = require('./firebase/firebase.js');
10
10
  const genericPool = require('./genericPool.js');
11
- const index$7 = require('./google-genai/index.js');
11
+ const index$8 = require('./google-genai/index.js');
12
12
  const graphql = require('./graphql.js');
13
13
  const index$1 = require('./hapi/index.js');
14
14
  const index$2 = require('./hono/index.js');
15
15
  const kafka = require('./kafka.js');
16
16
  const koa = require('./koa.js');
17
- const index$3 = require('./langchain/index.js');
18
- const index$8 = require('./langgraph/index.js');
17
+ const index$4 = require('./langchain/index.js');
18
+ const index$9 = require('./langgraph/index.js');
19
19
  const lrumemoizer = require('./lrumemoizer.js');
20
20
  const mongo = require('./mongo.js');
21
21
  const mongoose = require('./mongoose.js');
22
22
  const mysql = require('./mysql.js');
23
23
  const mysql2 = require('./mysql2.js');
24
- const index$5 = require('./openai/index.js');
24
+ const index$6 = require('./openai/index.js');
25
25
  const postgres = require('./postgres.js');
26
26
  const postgresjs = require('./postgresjs.js');
27
27
  const prisma = require('./prisma.js');
28
- const redis = require('./redis.js');
28
+ const index$3 = require('./redis/index.js');
29
29
  const tedious = require('./tedious.js');
30
- const index$4 = require('./vercelai/index.js');
30
+ const index$5 = require('./vercelai/index.js');
31
31
 
32
32
  /**
33
33
  * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.
@@ -42,7 +42,7 @@ function getAutoPerformanceIntegrations() {
42
42
  mongoose.mongooseIntegration(),
43
43
  mysql.mysqlIntegration(),
44
44
  mysql2.mysql2Integration(),
45
- redis.redisIntegration(),
45
+ index$3.redisIntegration(),
46
46
  postgres.postgresIntegration(),
47
47
  prisma.prismaIntegration(),
48
48
  index$1.hapiIntegration(),
@@ -55,12 +55,12 @@ function getAutoPerformanceIntegrations() {
55
55
  lrumemoizer.lruMemoizerIntegration(),
56
56
  // AI providers
57
57
  // LangChain must come first to disable AI provider integrations before they instrument
58
- index$3.langChainIntegration(),
59
- index$8.langGraphIntegration(),
60
- index$4.vercelAIIntegration(),
61
- index$5.openAIIntegration(),
62
- index$6.anthropicAIIntegration(),
63
- index$7.googleGenAIIntegration(),
58
+ index$4.langChainIntegration(),
59
+ index$9.langGraphIntegration(),
60
+ index$5.vercelAIIntegration(),
61
+ index$6.openAIIntegration(),
62
+ index$7.anthropicAIIntegration(),
63
+ index$8.googleGenAIIntegration(),
64
64
  postgresjs.postgresJsIntegration(),
65
65
  firebase.firebaseIntegration(),
66
66
  ];
@@ -73,7 +73,6 @@ function getAutoPerformanceIntegrations() {
73
73
  function getOpenTelemetryInstrumentationToPreload() {
74
74
  return [
75
75
  http.instrumentSentryHttp,
76
- http.instrumentOtelHttp,
77
76
  express.instrumentExpress,
78
77
  connect.instrumentConnect,
79
78
  index.instrumentFastify,
@@ -90,18 +89,18 @@ function getOpenTelemetryInstrumentationToPreload() {
90
89
  postgres.instrumentPostgres,
91
90
  index$1.instrumentHapi,
92
91
  graphql.instrumentGraphql,
93
- redis.instrumentRedis,
92
+ index$3.instrumentRedis,
94
93
  tedious.instrumentTedious,
95
94
  genericPool.instrumentGenericPool,
96
95
  amqplib.instrumentAmqplib,
97
- index$3.instrumentLangChain,
98
- index$4.instrumentVercelAi,
99
- index$5.instrumentOpenAi,
96
+ index$4.instrumentLangChain,
97
+ index$5.instrumentVercelAi,
98
+ index$6.instrumentOpenAi,
100
99
  postgresjs.instrumentPostgresJs,
101
100
  firebase.instrumentFirebase,
102
- index$6.instrumentAnthropicAi,
103
- index$7.instrumentGoogleGenAI,
104
- index$8.instrumentLangGraph,
101
+ index$7.instrumentAnthropicAi,
102
+ index$8.instrumentGoogleGenAI,
103
+ index$9.instrumentLangGraph,
105
104
  ];
106
105
  }
107
106
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/integrations/tracing/index.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { instrumentOtelHttp, instrumentSentryHttp } from '../http';\nimport { amqplibIntegration, instrumentAmqplib } from './amqplib';\nimport { anthropicAIIntegration, instrumentAnthropicAi } from './anthropic-ai';\nimport { connectIntegration, instrumentConnect } from './connect';\nimport { expressIntegration, instrumentExpress } from './express';\nimport { fastifyIntegration, instrumentFastify, instrumentFastifyV3 } from './fastify';\nimport { firebaseIntegration, instrumentFirebase } from './firebase';\nimport { genericPoolIntegration, instrumentGenericPool } from './genericPool';\nimport { googleGenAIIntegration, instrumentGoogleGenAI } from './google-genai';\nimport { graphqlIntegration, instrumentGraphql } from './graphql';\nimport { hapiIntegration, instrumentHapi } from './hapi';\nimport { honoIntegration, instrumentHono } from './hono';\nimport { instrumentKafka, kafkaIntegration } from './kafka';\nimport { instrumentKoa, koaIntegration } from './koa';\nimport { instrumentLangChain, langChainIntegration } from './langchain';\nimport { instrumentLangGraph, langGraphIntegration } from './langgraph';\nimport { instrumentLruMemoizer, lruMemoizerIntegration } from './lrumemoizer';\nimport { instrumentMongo, mongoIntegration } from './mongo';\nimport { instrumentMongoose, mongooseIntegration } from './mongoose';\nimport { instrumentMysql, mysqlIntegration } from './mysql';\nimport { instrumentMysql2, mysql2Integration } from './mysql2';\nimport { instrumentOpenAi, openAIIntegration } from './openai';\nimport { instrumentPostgres, postgresIntegration } from './postgres';\nimport { instrumentPostgresJs, postgresJsIntegration } from './postgresjs';\nimport { prismaIntegration } from './prisma';\nimport { instrumentRedis, redisIntegration } from './redis';\nimport { instrumentTedious, tediousIntegration } from './tedious';\nimport { instrumentVercelAi, vercelAIIntegration } from './vercelai';\n\n/**\n * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.\n */\nexport function getAutoPerformanceIntegrations(): Integration[] {\n return [\n expressIntegration(),\n fastifyIntegration(),\n graphqlIntegration(),\n honoIntegration(),\n mongoIntegration(),\n mongooseIntegration(),\n mysqlIntegration(),\n mysql2Integration(),\n redisIntegration(),\n postgresIntegration(),\n prismaIntegration(),\n hapiIntegration(),\n koaIntegration(),\n connectIntegration(),\n tediousIntegration(),\n genericPoolIntegration(),\n kafkaIntegration(),\n amqplibIntegration(),\n lruMemoizerIntegration(),\n // AI providers\n // LangChain must come first to disable AI provider integrations before they instrument\n langChainIntegration(),\n langGraphIntegration(),\n vercelAIIntegration(),\n openAIIntegration(),\n anthropicAIIntegration(),\n googleGenAIIntegration(),\n postgresJsIntegration(),\n firebaseIntegration(),\n ];\n}\n\n/**\n * Get a list of methods to instrument OTEL, when preload instrumentation.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getOpenTelemetryInstrumentationToPreload(): (((options?: any) => void) & { id: string })[] {\n return [\n instrumentSentryHttp,\n instrumentOtelHttp,\n instrumentExpress,\n instrumentConnect,\n instrumentFastify,\n instrumentFastifyV3,\n instrumentHapi,\n instrumentHono,\n instrumentKafka,\n instrumentKoa,\n instrumentLruMemoizer,\n instrumentMongo,\n instrumentMongoose,\n instrumentMysql,\n instrumentMysql2,\n instrumentPostgres,\n instrumentHapi,\n instrumentGraphql,\n instrumentRedis,\n instrumentTedious,\n instrumentGenericPool,\n instrumentAmqplib,\n instrumentLangChain,\n instrumentVercelAi,\n instrumentOpenAi,\n instrumentPostgresJs,\n instrumentFirebase,\n instrumentAnthropicAi,\n instrumentGoogleGenAI,\n instrumentLangGraph,\n ];\n}\n"],"names":["expressIntegration","fastifyIntegration","graphqlIntegration","honoIntegration","mongoIntegration","mongooseIntegration","mysqlIntegration","mysql2Integration","redisIntegration","postgresIntegration","prismaIntegration","hapiIntegration","koaIntegration","connectIntegration","tediousIntegration","genericPoolIntegration","kafkaIntegration","amqplibIntegration","lruMemoizerIntegration","langChainIntegration","langGraphIntegration","vercelAIIntegration","openAIIntegration","anthropicAIIntegration","googleGenAIIntegration","postgresJsIntegration","firebaseIntegration","instrumentSentryHttp","instrumentOtelHttp","instrumentExpress","instrumentConnect","instrumentFastify","instrumentFastifyV3","instrumentHapi","instrumentHono","instrumentKafka","instrumentKoa","instrumentLruMemoizer","instrumentMongo","instrumentMongoose","instrumentMysql","instrumentMysql2","instrumentPostgres","instrumentGraphql","instrumentRedis","instrumentTedious","instrumentGenericPool","instrumentAmqplib","instrumentLangChain","instrumentVercelAi","instrumentOpenAi","instrumentPostgresJs","instrumentFirebase","instrumentAnthropicAi","instrumentGoogleGenAI","instrumentLangGraph"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA;AACA;AACA;AACO,SAAS,8BAA8B,GAAk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AIU,yBAAiB;AACrB,IAAIC,qBAAe;AACnB,IAAIC,yBAAiB;AACrB,IAAIC,iCAAqB;AACzB,IAAIC,yBAAiB;AACrB,IAAIC,2BAAmB;AACvB,IAAIC,0BAAkB;AACtB,IAAIC,wBAAgB;AACpB,IAAIC,+BAAoB;AACxB,IAAIC,2BAAkB;AACtB,IAAIC,6BAAqB;AACzB,IAAIC,6BAAqB;AACzB,IAAIC,2BAAmB;AACvB,GAAG;AACH;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/integrations/tracing/index.ts"],"sourcesContent":["import type { Integration } from '@sentry/core';\nimport { instrumentSentryHttp } from '../http';\nimport { amqplibIntegration, instrumentAmqplib } from './amqplib';\nimport { anthropicAIIntegration, instrumentAnthropicAi } from './anthropic-ai';\nimport { connectIntegration, instrumentConnect } from './connect';\nimport { expressIntegration, instrumentExpress } from './express';\nimport { fastifyIntegration, instrumentFastify, instrumentFastifyV3 } from './fastify';\nimport { firebaseIntegration, instrumentFirebase } from './firebase';\nimport { genericPoolIntegration, instrumentGenericPool } from './genericPool';\nimport { googleGenAIIntegration, instrumentGoogleGenAI } from './google-genai';\nimport { graphqlIntegration, instrumentGraphql } from './graphql';\nimport { hapiIntegration, instrumentHapi } from './hapi';\nimport { honoIntegration, instrumentHono } from './hono';\nimport { instrumentKafka, kafkaIntegration } from './kafka';\nimport { instrumentKoa, koaIntegration } from './koa';\nimport { instrumentLangChain, langChainIntegration } from './langchain';\nimport { instrumentLangGraph, langGraphIntegration } from './langgraph';\nimport { instrumentLruMemoizer, lruMemoizerIntegration } from './lrumemoizer';\nimport { instrumentMongo, mongoIntegration } from './mongo';\nimport { instrumentMongoose, mongooseIntegration } from './mongoose';\nimport { instrumentMysql, mysqlIntegration } from './mysql';\nimport { instrumentMysql2, mysql2Integration } from './mysql2';\nimport { instrumentOpenAi, openAIIntegration } from './openai';\nimport { instrumentPostgres, postgresIntegration } from './postgres';\nimport { instrumentPostgresJs, postgresJsIntegration } from './postgresjs';\nimport { prismaIntegration } from './prisma';\nimport { instrumentRedis, redisIntegration } from './redis';\nimport { instrumentTedious, tediousIntegration } from './tedious';\nimport { instrumentVercelAi, vercelAIIntegration } from './vercelai';\n\n/**\n * With OTEL, all performance integrations will be added, as OTEL only initializes them when the patched package is actually required.\n */\nexport function getAutoPerformanceIntegrations(): Integration[] {\n return [\n expressIntegration(),\n fastifyIntegration(),\n graphqlIntegration(),\n honoIntegration(),\n mongoIntegration(),\n mongooseIntegration(),\n mysqlIntegration(),\n mysql2Integration(),\n redisIntegration(),\n postgresIntegration(),\n prismaIntegration(),\n hapiIntegration(),\n koaIntegration(),\n connectIntegration(),\n tediousIntegration(),\n genericPoolIntegration(),\n kafkaIntegration(),\n amqplibIntegration(),\n lruMemoizerIntegration(),\n // AI providers\n // LangChain must come first to disable AI provider integrations before they instrument\n langChainIntegration(),\n langGraphIntegration(),\n vercelAIIntegration(),\n openAIIntegration(),\n anthropicAIIntegration(),\n googleGenAIIntegration(),\n postgresJsIntegration(),\n firebaseIntegration(),\n ];\n}\n\n/**\n * Get a list of methods to instrument OTEL, when preload instrumentation.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getOpenTelemetryInstrumentationToPreload(): (((options?: any) => void) & { id: string })[] {\n return [\n instrumentSentryHttp,\n instrumentExpress,\n instrumentConnect,\n instrumentFastify,\n instrumentFastifyV3,\n instrumentHapi,\n instrumentHono,\n instrumentKafka,\n instrumentKoa,\n instrumentLruMemoizer,\n instrumentMongo,\n instrumentMongoose,\n instrumentMysql,\n instrumentMysql2,\n instrumentPostgres,\n instrumentHapi,\n instrumentGraphql,\n instrumentRedis,\n instrumentTedious,\n instrumentGenericPool,\n instrumentAmqplib,\n instrumentLangChain,\n instrumentVercelAi,\n instrumentOpenAi,\n instrumentPostgresJs,\n instrumentFirebase,\n instrumentAnthropicAi,\n instrumentGoogleGenAI,\n instrumentLangGraph,\n ];\n}\n"],"names":["expressIntegration","fastifyIntegration","graphqlIntegration","honoIntegration","mongoIntegration","mongooseIntegration","mysqlIntegration","mysql2Integration","redisIntegration","postgresIntegration","prismaIntegration","hapiIntegration","koaIntegration","connectIntegration","tediousIntegration","genericPoolIntegration","kafkaIntegration","amqplibIntegration","lruMemoizerIntegration","langChainIntegration","langGraphIntegration","vercelAIIntegration","openAIIntegration","anthropicAIIntegration","googleGenAIIntegration","postgresJsIntegration","firebaseIntegration","instrumentSentryHttp","instrumentExpress","instrumentConnect","instrumentFastify","instrumentFastifyV3","instrumentHapi","instrumentHono","instrumentKafka","instrumentKoa","instrumentLruMemoizer","instrumentMongo","instrumentMongoose","instrumentMysql","instrumentMysql2","instrumentPostgres","instrumentGraphql","instrumentRedis","instrumentTedious","instrumentGenericPool","instrumentAmqplib","instrumentLangChain","instrumentVercelAi","instrumentOpenAi","instrumentPostgresJs","instrumentFirebase","instrumentAnthropicAi","instrumentGoogleGenAI","instrumentLangGraph"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA;AACA;AACA;AACO,SAAS,8BAA8B,GAAkB;AAChE,EAAE,OAAO;AACT,IAAIA,0BAAkB,EAAE;AACxB,IAAIC,wBAAkB,EAAE;AACxB,IAAIC,0BAAkB,EAAE;AACxB,IAAIC,uBAAe,EAAE;AACrB,IAAIC,sBAAgB,EAAE;AACtB,IAAIC,4BAAmB,EAAE;AACzB,IAAIC,sBAAgB,EAAE;AACtB,IAAIC,wBAAiB,EAAE;AACvB,IAAIC,wBAAgB,EAAE;AACtB,IAAIC,4BAAmB,EAAE;AACzB,IAAIC,wBAAiB,EAAE;AACvB,IAAIC,uBAAe,EAAE;AACrB,IAAIC,kBAAc,EAAE;AACpB,IAAIC,0BAAkB,EAAE;AACxB,IAAIC,0BAAkB,EAAE;AACxB,IAAIC,kCAAsB,EAAE;AAC5B,IAAIC,sBAAgB,EAAE;AACtB,IAAIC,0BAAkB,EAAE;AACxB,IAAIC,kCAAsB,EAAE;AAC5B;AACA;AACA,IAAIC,4BAAoB,EAAE;AAC1B,IAAIC,4BAAoB,EAAE;AAC1B,IAAIC,2BAAmB,EAAE;AACzB,IAAIC,yBAAiB,EAAE;AACvB,IAAIC,8BAAsB,EAAE;AAC5B,IAAIC,8BAAsB,EAAE;AAC5B,IAAIC,gCAAqB,EAAE;AAC3B,IAAIC,4BAAmB,EAAE;AACzB,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACO,SAAS,wCAAwC,GAAmD;AAC3G,EAAE,OAAO;AACT,IAAIC,yBAAoB;AACxB,IAAIC,yBAAiB;AACrB,IAAIC,yBAAiB;AACrB,IAAIC,uBAAiB;AACrB,IAAIC,yBAAmB;AACvB,IAAIC,sBAAc;AAClB,IAAIC,sBAAc;AAClB,IAAIC,qBAAe;AACnB,IAAIC,iBAAa;AACjB,IAAIC,iCAAqB;AACzB,IAAIC,qBAAe;AACnB,IAAIC,2BAAkB;AACtB,IAAIC,qBAAe;AACnB,IAAIC,uBAAgB;AACpB,IAAIC,2BAAkB;AACtB,IAAIT,sBAAc;AAClB,IAAIU,yBAAiB;AACrB,IAAIC,uBAAe;AACnB,IAAIC,yBAAiB;AACrB,IAAIC,iCAAqB;AACzB,IAAIC,yBAAiB;AACrB,IAAIC,2BAAmB;AACvB,IAAIC,0BAAkB;AACtB,IAAIC,wBAAgB;AACpB,IAAIC,+BAAoB;AACxB,IAAIC,2BAAkB;AACtB,IAAIC,6BAAqB;AACzB,IAAIC,6BAAqB;AACzB,IAAIC,2BAAmB;AACvB,GAAG;AACH;;;;;"}
@@ -1,10 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
 
3
- const instrumentationIoredis = require('@opentelemetry/instrumentation-ioredis');
4
- const instrumentationRedis = require('@opentelemetry/instrumentation-redis');
5
3
  const core = require('@sentry/core');
6
4
  const nodeCore = require('@sentry/node-core');
7
- const redisCache = require('../../utils/redisCache.js');
5
+ const redisCache = require('../../../utils/redisCache.js');
6
+ const ioredisInstrumentation = require('./vendored/ioredis-instrumentation.js');
7
+ const redisInstrumentation = require('./vendored/redis-instrumentation.js');
8
+ const redisDcSubscriber = require('./redis-dc-subscriber.js');
8
9
 
9
10
  const INTEGRATION_NAME = 'Redis';
10
11
 
@@ -18,8 +19,6 @@ const cacheResponseHook = (
18
19
  cmdArgs,
19
20
  response,
20
21
  ) => {
21
- span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.redis');
22
-
23
22
  const safeKey = redisCache.getCacheKeySafely(redisCommand, cmdArgs);
24
23
  const cacheOperation = redisCache.getCacheOperation(redisCommand);
25
24
 
@@ -35,8 +34,12 @@ const cacheResponseHook = (
35
34
 
36
35
  // otel/ioredis seems to be using the old standard, as there was a change to those params: https://github.com/open-telemetry/opentelemetry-specification/issues/3199
37
36
  // We are using params based on the docs: https://opentelemetry.io/docs/specs/semconv/attributes-registry/network/
38
- const networkPeerAddress = core.spanToJSON(span).data['net.peer.name'];
39
- const networkPeerPort = core.spanToJSON(span).data['net.peer.port'];
37
+ // Fall back to stable semconv attributes (server.address/server.port) when
38
+ // old-semconv ones are absent, eg OTEL_SEMCONV_STABILITY_OPT_IN=database
39
+ // set for node-redis v4/v5.
40
+ const spanData = core.spanToJSON(span).data;
41
+ const networkPeerAddress = spanData['net.peer.name'] ?? spanData['server.address'];
42
+ const networkPeerPort = spanData['net.peer.port'] ?? spanData['server.port'];
40
43
  if (networkPeerPort && networkPeerAddress) {
41
44
  span.setAttributes({ 'network.peer.address': networkPeerAddress, 'network.peer.port': networkPeerPort });
42
45
  }
@@ -65,13 +68,13 @@ const cacheResponseHook = (
65
68
  };
66
69
 
67
70
  const instrumentIORedis = nodeCore.generateInstrumentOnce(`${INTEGRATION_NAME}.IORedis`, () => {
68
- return new instrumentationIoredis.IORedisInstrumentation({
71
+ return new ioredisInstrumentation.IORedisInstrumentation({
69
72
  responseHook: cacheResponseHook,
70
73
  });
71
74
  });
72
75
 
73
76
  const instrumentRedisModule = nodeCore.generateInstrumentOnce(`${INTEGRATION_NAME}.Redis`, () => {
74
- return new instrumentationRedis.RedisInstrumentation({
77
+ return new redisInstrumentation.RedisInstrumentation({
75
78
  responseHook: cacheResponseHook,
76
79
  });
77
80
  });
@@ -81,6 +84,11 @@ const instrumentRedis = Object.assign(
81
84
  () => {
82
85
  instrumentIORedis();
83
86
  instrumentRedisModule();
87
+ // node-redis >= 5.12.0 publishes via diagnostics_channel. The subscriber uses
88
+ // `@sentry/opentelemetry/tracing-channel`, which needs the Sentry OTel context manager
89
+ // to be registered before it can `bindStore`. `initOpenTelemetry()` runs after integration
90
+ // `setupOnce`, so defer to the next tick.
91
+ void Promise.resolve().then(() => redisDcSubscriber.subscribeRedisDiagnosticChannels(cacheResponseHook));
84
92
 
85
93
  // todo: implement them gradually
86
94
  // new LegacyRedisInstrumentation({}),
@@ -118,4 +126,4 @@ const redisIntegration = core.defineIntegration(_redisIntegration);
118
126
  exports.cacheResponseHook = cacheResponseHook;
119
127
  exports.instrumentRedis = instrumentRedis;
120
128
  exports.redisIntegration = redisIntegration;
121
- //# sourceMappingURL=redis.js.map
129
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/redis/index.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { IntegrationFn } from '@sentry/core';\nimport {\n defineIntegration,\n SEMANTIC_ATTRIBUTE_CACHE_HIT,\n SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE,\n SEMANTIC_ATTRIBUTE_CACHE_KEY,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n spanToJSON,\n truncate,\n} from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\nimport type { IORedisCommandArgs } from '../../../utils/redisCache';\nimport {\n calculateCacheItemSize,\n GET_COMMANDS,\n getCacheKeySafely,\n getCacheOperation,\n isInCommands,\n shouldConsiderForCache,\n} from '../../../utils/redisCache';\nimport type { IORedisResponseCustomAttributeFunction } from './vendored/types';\nimport { IORedisInstrumentation } from './vendored/ioredis-instrumentation';\nimport { RedisInstrumentation } from './vendored/redis-instrumentation';\nimport { subscribeRedisDiagnosticChannels } from './redis-dc-subscriber';\n\ninterface RedisOptions {\n /**\n * Define cache prefixes for cache keys that should be captured as a cache span.\n *\n * Setting this to, for example, `['user:']` will capture cache keys that start with `user:`.\n */\n cachePrefixes?: string[];\n /**\n * Maximum length of the cache key added to the span description. If the key exceeds this length, it will be truncated.\n *\n * Passing `0` will use the full cache key without truncation.\n *\n * By default, the full cache key is used.\n */\n maxCacheKeyLength?: number;\n}\n\nconst INTEGRATION_NAME = 'Redis';\n\n/* Only exported for testing purposes */\nexport let _redisOptions: RedisOptions = {};\n\n/* Only exported for testing purposes */\nexport const cacheResponseHook: IORedisResponseCustomAttributeFunction = (\n span: Span,\n redisCommand: string,\n cmdArgs: IORedisCommandArgs,\n response: unknown,\n) => {\n const safeKey = getCacheKeySafely(redisCommand, cmdArgs);\n const cacheOperation = getCacheOperation(redisCommand);\n\n if (\n !safeKey ||\n !cacheOperation ||\n !_redisOptions.cachePrefixes ||\n !shouldConsiderForCache(redisCommand, safeKey, _redisOptions.cachePrefixes)\n ) {\n // not relevant for cache\n return;\n }\n\n // otel/ioredis seems to be using the old standard, as there was a change to those params: https://github.com/open-telemetry/opentelemetry-specification/issues/3199\n // We are using params based on the docs: https://opentelemetry.io/docs/specs/semconv/attributes-registry/network/\n // Fall back to stable semconv attributes (server.address/server.port) when\n // old-semconv ones are absent, eg OTEL_SEMCONV_STABILITY_OPT_IN=database\n // set for node-redis v4/v5.\n const spanData = spanToJSON(span).data;\n const networkPeerAddress = spanData['net.peer.name'] ?? spanData['server.address'];\n const networkPeerPort = spanData['net.peer.port'] ?? spanData['server.port'];\n if (networkPeerPort && networkPeerAddress) {\n span.setAttributes({ 'network.peer.address': networkPeerAddress, 'network.peer.port': networkPeerPort });\n }\n\n const cacheItemSize = calculateCacheItemSize(response);\n\n if (cacheItemSize) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, cacheItemSize);\n }\n\n if (isInCommands(GET_COMMANDS, redisCommand) && cacheItemSize !== undefined) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_HIT, cacheItemSize > 0);\n }\n\n span.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: cacheOperation,\n [SEMANTIC_ATTRIBUTE_CACHE_KEY]: safeKey,\n });\n\n // todo: change to string[] once EAP supports it\n const spanDescription = safeKey.join(', ');\n\n span.updateName(\n _redisOptions.maxCacheKeyLength ? truncate(spanDescription, _redisOptions.maxCacheKeyLength) : spanDescription,\n );\n};\n\nconst instrumentIORedis = generateInstrumentOnce(`${INTEGRATION_NAME}.IORedis`, () => {\n return new IORedisInstrumentation({\n responseHook: cacheResponseHook,\n });\n});\n\nconst instrumentRedisModule = generateInstrumentOnce(`${INTEGRATION_NAME}.Redis`, () => {\n return new RedisInstrumentation({\n responseHook: cacheResponseHook,\n });\n});\n\n/** To be able to preload all Redis OTel instrumentations with just one ID (\"Redis\"), all the instrumentations are generated in this one function */\nexport const instrumentRedis = Object.assign(\n (): void => {\n instrumentIORedis();\n instrumentRedisModule();\n // node-redis >= 5.12.0 publishes via diagnostics_channel. The subscriber uses\n // `@sentry/opentelemetry/tracing-channel`, which needs the Sentry OTel context manager\n // to be registered before it can `bindStore`. `initOpenTelemetry()` runs after integration\n // `setupOnce`, so defer to the next tick.\n void Promise.resolve().then(() => subscribeRedisDiagnosticChannels(cacheResponseHook));\n\n // todo: implement them gradually\n // new LegacyRedisInstrumentation({}),\n },\n { id: INTEGRATION_NAME },\n);\n\nconst _redisIntegration = ((options: RedisOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n _redisOptions = options;\n instrumentRedis();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [redis](https://www.npmjs.com/package/redis) and\n * [ioredis](https://www.npmjs.com/package/ioredis) libraries.\n *\n * For more information, see the [`redisIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/redis/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.redisIntegration()],\n * });\n * ```\n */\nexport const redisIntegration = defineIntegration(_redisIntegration);\n"],"names":["_redisOptions","getCacheKeySafely","getCacheOperation","shouldConsiderForCache","spanToJSON","calculateCacheItemSize","SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE","isInCommands","GET_COMMANDS","SEMANTIC_ATTRIBUTE_CACHE_HIT","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_CACHE_KEY","truncate","generateInstrumentOnce","IORedisInstrumentation","RedisInstrumentation","subscribeRedisDiagnosticChannels","defineIntegration"],"mappings":";;;;;;;;;AA2CA,MAAM,gBAAA,GAAmB,OAAO;;AAEhC;AACWA,qBAAa,GAAiB;;AAEzC;AACO,MAAM,iBAAiB,GAA2C;AACzE,EAAE,IAAI;AACN,EAAE,YAAY;AACd,EAAE,OAAO;AACT,EAAE,QAAQ;AACV,KAAK;AACL,EAAE,MAAM,UAAUC,4BAAiB,CAAC,YAAY,EAAE,OAAO,CAAC;AAC1D,EAAE,MAAM,cAAA,GAAiBC,4BAAiB,CAAC,YAAY,CAAC;;AAExD,EAAE;AACF,IAAI,CAAC,OAAA;AACL,IAAI,CAAC,cAAA;AACL,IAAI,CAACF,qBAAa,CAAC,aAAA;AACnB,IAAI,CAACG,iCAAsB,CAAC,YAAY,EAAE,OAAO,EAAEH,qBAAa,CAAC,aAAa;AAC9E,IAAI;AACJ;AACA,IAAI;AACJ,EAAE;;AAEF;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,WAAWI,eAAU,CAAC,IAAI,CAAC,CAAC,IAAI;AACxC,EAAE,MAAM,kBAAA,GAAqB,QAAQ,CAAC,eAAe,CAAA,IAAK,QAAQ,CAAC,gBAAgB,CAAC;AACpF,EAAE,MAAM,eAAA,GAAk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