@sentry/node 10.54.0 → 10.56.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 (166) hide show
  1. package/build/cjs/integrations/node-fetch/vendored/undici.js +2 -3
  2. package/build/cjs/integrations/node-fetch/vendored/undici.js.map +1 -1
  3. package/build/cjs/integrations/tracing/InstrumentationNodeModuleFile.js +15 -0
  4. package/build/cjs/integrations/tracing/InstrumentationNodeModuleFile.js.map +1 -0
  5. package/build/cjs/integrations/tracing/amqplib/vendored/amqplib.js +9 -9
  6. package/build/cjs/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -1
  7. package/build/cjs/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
  8. package/build/cjs/integrations/tracing/anthropic-ai/index.js.map +1 -1
  9. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js +3 -5
  10. package/build/cjs/integrations/tracing/connect/vendored/instrumentation.js.map +1 -1
  11. package/build/cjs/integrations/tracing/express.js +3 -5
  12. package/build/cjs/integrations/tracing/express.js.map +1 -1
  13. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js +10 -11
  14. package/build/cjs/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  15. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js +3 -4
  16. package/build/cjs/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -1
  17. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js +2 -1
  18. package/build/cjs/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
  19. package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js +2 -1
  20. package/build/cjs/integrations/tracing/firebase/otel/patches/functions.js.map +1 -1
  21. package/build/cjs/integrations/tracing/google-genai/instrumentation.js +2 -1
  22. package/build/cjs/integrations/tracing/google-genai/instrumentation.js.map +1 -1
  23. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js +4 -3
  24. package/build/cjs/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
  25. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js +2 -5
  26. package/build/cjs/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -1
  27. package/build/cjs/integrations/tracing/hono/index.js.map +1 -1
  28. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js +3 -2
  29. package/build/cjs/integrations/tracing/knex/vendored/instrumentation.js.map +1 -1
  30. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js +3 -4
  31. package/build/cjs/integrations/tracing/koa/vendored/instrumentation.js.map +1 -1
  32. package/build/cjs/integrations/tracing/langchain/instrumentation.js +3 -2
  33. package/build/cjs/integrations/tracing/langchain/instrumentation.js.map +1 -1
  34. package/build/cjs/integrations/tracing/langgraph/index.js.map +1 -1
  35. package/build/cjs/integrations/tracing/langgraph/instrumentation.js +7 -5
  36. package/build/cjs/integrations/tracing/langgraph/instrumentation.js.map +1 -1
  37. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js +7 -6
  38. package/build/cjs/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -1
  39. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js +3 -2
  40. package/build/cjs/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
  41. package/build/cjs/integrations/tracing/openai/index.js.map +1 -1
  42. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js +5 -5
  43. package/build/cjs/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -1
  44. package/build/cjs/integrations/tracing/postgresjs.js +2 -1
  45. package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
  46. package/build/cjs/integrations/tracing/redis/index.js +3 -2
  47. package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
  48. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +1 -1
  49. package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  50. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +4 -3
  51. package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  52. package/build/cjs/integrations/tracing/vercelai/instrumentation.js +6 -5
  53. package/build/cjs/integrations/tracing/vercelai/instrumentation.js.map +1 -1
  54. package/build/cjs/utils/setHttpServerSpanRouteAttribute.js +21 -0
  55. package/build/cjs/utils/setHttpServerSpanRouteAttribute.js.map +1 -0
  56. package/build/esm/integrations/node-fetch/vendored/undici.js +3 -4
  57. package/build/esm/integrations/node-fetch/vendored/undici.js.map +1 -1
  58. package/build/esm/integrations/tracing/InstrumentationNodeModuleFile.js +13 -0
  59. package/build/esm/integrations/tracing/InstrumentationNodeModuleFile.js.map +1 -0
  60. package/build/esm/integrations/tracing/amqplib/vendored/amqplib.js +7 -7
  61. package/build/esm/integrations/tracing/amqplib/vendored/amqplib.js.map +1 -1
  62. package/build/esm/integrations/tracing/amqplib/vendored/utils.js.map +1 -1
  63. package/build/esm/integrations/tracing/anthropic-ai/index.js.map +1 -1
  64. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js +3 -5
  65. package/build/esm/integrations/tracing/connect/vendored/instrumentation.js.map +1 -1
  66. package/build/esm/integrations/tracing/express.js +3 -5
  67. package/build/esm/integrations/tracing/express.js.map +1 -1
  68. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js +3 -4
  69. package/build/esm/integrations/tracing/fastify/v3/instrumentation.js.map +1 -1
  70. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js +3 -4
  71. package/build/esm/integrations/tracing/fastify/vendored/instrumentation.js.map +1 -1
  72. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js +2 -1
  73. package/build/esm/integrations/tracing/firebase/otel/patches/firestore.js.map +1 -1
  74. package/build/esm/integrations/tracing/firebase/otel/patches/functions.js +2 -1
  75. package/build/esm/integrations/tracing/firebase/otel/patches/functions.js.map +1 -1
  76. package/build/esm/integrations/tracing/google-genai/instrumentation.js +2 -1
  77. package/build/esm/integrations/tracing/google-genai/instrumentation.js.map +1 -1
  78. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js +2 -1
  79. package/build/esm/integrations/tracing/graphql/vendored/instrumentation.js.map +1 -1
  80. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js +2 -5
  81. package/build/esm/integrations/tracing/hapi/vendored/instrumentation.js.map +1 -1
  82. package/build/esm/integrations/tracing/hono/index.js.map +1 -1
  83. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js +2 -1
  84. package/build/esm/integrations/tracing/knex/vendored/instrumentation.js.map +1 -1
  85. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js +3 -4
  86. package/build/esm/integrations/tracing/koa/vendored/instrumentation.js.map +1 -1
  87. package/build/esm/integrations/tracing/langchain/instrumentation.js +2 -1
  88. package/build/esm/integrations/tracing/langchain/instrumentation.js.map +1 -1
  89. package/build/esm/integrations/tracing/langgraph/index.js.map +1 -1
  90. package/build/esm/integrations/tracing/langgraph/instrumentation.js +5 -3
  91. package/build/esm/integrations/tracing/langgraph/instrumentation.js.map +1 -1
  92. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js +2 -1
  93. package/build/esm/integrations/tracing/mongo/vendored/instrumentation.js.map +1 -1
  94. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js +2 -1
  95. package/build/esm/integrations/tracing/mysql2/vendored/instrumentation.js.map +1 -1
  96. package/build/esm/integrations/tracing/openai/index.js.map +1 -1
  97. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js +5 -5
  98. package/build/esm/integrations/tracing/postgres/vendored/instrumentation.js.map +1 -1
  99. package/build/esm/integrations/tracing/postgresjs.js +2 -1
  100. package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
  101. package/build/esm/integrations/tracing/redis/index.js +3 -2
  102. package/build/esm/integrations/tracing/redis/index.js.map +1 -1
  103. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +1 -1
  104. package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -1
  105. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +2 -1
  106. package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -1
  107. package/build/esm/integrations/tracing/vercelai/instrumentation.js +6 -5
  108. package/build/esm/integrations/tracing/vercelai/instrumentation.js.map +1 -1
  109. package/build/esm/package.json +1 -1
  110. package/build/esm/utils/setHttpServerSpanRouteAttribute.js +19 -0
  111. package/build/esm/utils/setHttpServerSpanRouteAttribute.js.map +1 -0
  112. package/build/types/integrations/node-fetch/vendored/undici.d.ts.map +1 -1
  113. package/build/types/integrations/tracing/InstrumentationNodeModuleFile.d.ts +9 -0
  114. package/build/types/integrations/tracing/InstrumentationNodeModuleFile.d.ts.map +1 -0
  115. package/build/types/integrations/tracing/amqplib/vendored/amqplib.d.ts.map +1 -1
  116. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts +2 -2
  117. package/build/types/integrations/tracing/amqplib/vendored/utils.d.ts.map +1 -1
  118. package/build/types/integrations/tracing/anthropic-ai/index.d.ts +7 -7
  119. package/build/types/integrations/tracing/connect/vendored/instrumentation.d.ts.map +1 -1
  120. package/build/types/integrations/tracing/express.d.ts.map +1 -1
  121. package/build/types/integrations/tracing/fastify/v3/instrumentation.d.ts.map +1 -1
  122. package/build/types/integrations/tracing/fastify/vendored/instrumentation.d.ts.map +1 -1
  123. package/build/types/integrations/tracing/firebase/otel/patches/firestore.d.ts.map +1 -1
  124. package/build/types/integrations/tracing/firebase/otel/patches/functions.d.ts.map +1 -1
  125. package/build/types/integrations/tracing/google-genai/instrumentation.d.ts.map +1 -1
  126. package/build/types/integrations/tracing/graphql/vendored/instrumentation.d.ts.map +1 -1
  127. package/build/types/integrations/tracing/hapi/vendored/instrumentation.d.ts.map +1 -1
  128. package/build/types/integrations/tracing/hono/index.d.ts +6 -0
  129. package/build/types/integrations/tracing/hono/index.d.ts.map +1 -1
  130. package/build/types/integrations/tracing/knex/vendored/instrumentation.d.ts.map +1 -1
  131. package/build/types/integrations/tracing/koa/vendored/instrumentation.d.ts.map +1 -1
  132. package/build/types/integrations/tracing/langchain/instrumentation.d.ts.map +1 -1
  133. package/build/types/integrations/tracing/langgraph/index.d.ts +7 -7
  134. package/build/types/integrations/tracing/langgraph/instrumentation.d.ts.map +1 -1
  135. package/build/types/integrations/tracing/mongo/vendored/instrumentation.d.ts.map +1 -1
  136. package/build/types/integrations/tracing/mysql2/vendored/instrumentation.d.ts.map +1 -1
  137. package/build/types/integrations/tracing/openai/index.d.ts +7 -7
  138. package/build/types/integrations/tracing/postgres/vendored/instrumentation.d.ts.map +1 -1
  139. package/build/types/integrations/tracing/postgresjs.d.ts.map +1 -1
  140. package/build/types/integrations/tracing/redis/index.d.ts +4 -1
  141. package/build/types/integrations/tracing/redis/index.d.ts.map +1 -1
  142. package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts.map +1 -1
  143. package/build/types/integrations/tracing/vercelai/instrumentation.d.ts +2 -2
  144. package/build/types/integrations/tracing/vercelai/instrumentation.d.ts.map +1 -1
  145. package/build/types/integrations/tracing/vercelai/types.d.ts +6 -4
  146. package/build/types/integrations/tracing/vercelai/types.d.ts.map +1 -1
  147. package/build/types/utils/setHttpServerSpanRouteAttribute.d.ts +9 -0
  148. package/build/types/utils/setHttpServerSpanRouteAttribute.d.ts.map +1 -0
  149. package/build/types-ts3.8/integrations/tracing/InstrumentationNodeModuleFile.d.ts +9 -0
  150. package/build/types-ts3.8/integrations/tracing/amqplib/vendored/utils.d.ts +2 -2
  151. package/build/types-ts3.8/integrations/tracing/anthropic-ai/index.d.ts +7 -7
  152. package/build/types-ts3.8/integrations/tracing/hono/index.d.ts +6 -0
  153. package/build/types-ts3.8/integrations/tracing/langgraph/index.d.ts +7 -7
  154. package/build/types-ts3.8/integrations/tracing/openai/index.d.ts +7 -7
  155. package/build/types-ts3.8/integrations/tracing/redis/index.d.ts +4 -1
  156. package/build/types-ts3.8/integrations/tracing/vercelai/instrumentation.d.ts +2 -2
  157. package/build/types-ts3.8/integrations/tracing/vercelai/types.d.ts +6 -4
  158. package/build/types-ts3.8/utils/setHttpServerSpanRouteAttribute.d.ts +9 -0
  159. package/package.json +5 -4
  160. package/build/cjs/integrations/tracing/redis/redis-dc-subscriber.js +0 -151
  161. package/build/cjs/integrations/tracing/redis/redis-dc-subscriber.js.map +0 -1
  162. package/build/esm/integrations/tracing/redis/redis-dc-subscriber.js +0 -149
  163. package/build/esm/integrations/tracing/redis/redis-dc-subscriber.js.map +0 -1
  164. package/build/types/integrations/tracing/redis/redis-dc-subscriber.d.ts +0 -17
  165. package/build/types/integrations/tracing/redis/redis-dc-subscriber.d.ts.map +0 -1
  166. package/build/types-ts3.8/integrations/tracing/redis/redis-dc-subscriber.d.ts +0 -17
@@ -1 +0,0 @@
1
- {"version":3,"file":"redis-dc-subscriber.js","sources":["../../../../../src/integrations/tracing/redis/redis-dc-subscriber.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_STATUS_ERROR,\n startSpanManual,\n} from '@sentry/core';\nimport { tracingChannel, type TracingChannelContextWithSpan } from '@sentry/opentelemetry/tracing-channel';\nimport { defaultDbStatementSerializer } from './vendored/redis-common';\nimport {\n ATTR_DB_STATEMENT,\n ATTR_DB_SYSTEM,\n ATTR_NET_PEER_NAME,\n ATTR_NET_PEER_PORT,\n DB_SYSTEM_VALUE_REDIS,\n} from './vendored/semconv';\nimport type { IORedisInstrumentationConfig } from './vendored/types';\n\n// Channel names as published by node-redis >= 5.12.0.\n// Hardcoded so we don't import `redis` at module-load time.\nconst CHANNEL_COMMAND = 'node-redis:command';\nconst CHANNEL_BATCH = 'node-redis:batch';\nconst CHANNEL_CONNECT = 'node-redis:connect';\n\nconst ORIGIN = 'auto.db.redis.diagnostic_channel';\n\ninterface CommandData {\n command: string;\n args: Array<string | Buffer>;\n database?: number;\n serverAddress?: string;\n serverPort?: number;\n result?: unknown;\n error?: Error;\n}\n\ninterface BatchData {\n batchMode?: 'MULTI' | 'PIPELINE';\n batchSize?: number;\n database?: number;\n clientId?: string | number;\n serverAddress?: string;\n serverPort?: number;\n result?: unknown[];\n error?: Error;\n}\n\ninterface ConnectData {\n serverAddress?: string;\n serverPort?: number;\n url?: string;\n error?: Error;\n}\n\nconst NOOP = (): void => {};\n\nlet subscribed = false;\nlet currentResponseHook: IORedisInstrumentationConfig['responseHook'] | undefined;\n\n/**\n * Subscribe Sentry handlers to node-redis diagnostics_channel events (>= 5.12.0).\n *\n * Uses `@sentry/opentelemetry/tracing-channel` so OTel AsyncLocalStorage context propagates\n * automatically via `bindStore` — without it, spans created in `start` would not become\n * the active context for subsequent operations.\n *\n * Safe on every runtime that exposes `node:diagnostics_channel` (Node, Bun, Deno, Workers).\n * In node-redis < 5.12.0 the channels are never published to, so subscribers are inert and\n * there is no double-instrumentation against the IITM-based patcher (gated to < 5.12.0).\n */\nexport function subscribeRedisDiagnosticChannels(responseHook?: IORedisInstrumentationConfig['responseHook']): void {\n currentResponseHook = responseHook;\n if (subscribed) return;\n\n try {\n setupCommandChannel();\n setupBatchChannel();\n setupConnectChannel();\n subscribed = true;\n } catch {\n // tracingChannel from @sentry/opentelemetry requires `node:diagnostics_channel`.\n // On runtimes where it isn't available, fail closed.\n }\n}\n\nfunction setupCommandChannel(): void {\n const channel = tracingChannel<CommandData>(CHANNEL_COMMAND, data => {\n // node-redis >= 5.12.0 includes the command name as args[0] in the DC payload.\n // Strip it so serialization and cache key extraction see only the actual arguments.\n const actualArgs = data.args.slice(1);\n const statement = safeSerialize(data.command, actualArgs);\n return startSpanManual(\n {\n name: `redis-${data.command}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db.redis',\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n ...(statement != null ? { [ATTR_DB_STATEMENT]: statement } : {}),\n ...(data.serverAddress != null ? { [ATTR_NET_PEER_NAME]: data.serverAddress } : {}),\n ...(data.serverPort != null ? { [ATTR_NET_PEER_PORT]: data.serverPort } : {}),\n },\n },\n span => span,\n ) as Span;\n });\n\n channel.subscribe({\n start: NOOP,\n asyncStart: NOOP,\n end: NOOP,\n asyncEnd: data => {\n const span = data._sentrySpan;\n // only end if error handler isn't going to\n if (!span || data.error) return;\n // Same slice: strip command name from args before passing to the response hook.\n runResponseHook(span, data.command, data.args.slice(1), data.result);\n span.end();\n },\n error: data => {\n const span = data._sentrySpan;\n if (!span) return;\n if (data.error) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: data.error.message });\n }\n span.end();\n },\n });\n}\n\nfunction setupBatchChannel(): void {\n const channel = tracingChannel<BatchData>(CHANNEL_BATCH, data => {\n const operationName = data.batchMode === 'PIPELINE' ? 'PIPELINE' : 'MULTI';\n\n return startSpanManual(\n {\n name: operationName,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db.redis',\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n ...(data.batchSize != null ? { 'db.redis.batch_size': data.batchSize } : {}),\n ...(data.serverAddress != null ? { [ATTR_NET_PEER_NAME]: data.serverAddress } : {}),\n ...(data.serverPort != null ? { [ATTR_NET_PEER_PORT]: data.serverPort } : {}),\n },\n },\n span => span,\n ) as Span;\n });\n\n channel.subscribe({\n start: NOOP,\n asyncStart: NOOP,\n end: NOOP,\n asyncEnd: data => {\n // only end if the error handler isn't going to\n if (!data.error) data._sentrySpan?.end();\n },\n error: data => {\n const span = data._sentrySpan;\n if (!span) return;\n if (data.error) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: data.error.message });\n }\n span.end();\n },\n });\n}\n\nfunction setupConnectChannel(): void {\n const channel = tracingChannel<ConnectData>(CHANNEL_CONNECT, data => {\n return startSpanManual(\n {\n name: 'redis-connect',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db.redis.connect',\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n ...(data.serverAddress != null ? { [ATTR_NET_PEER_NAME]: data.serverAddress } : {}),\n ...(data.serverPort != null ? { [ATTR_NET_PEER_PORT]: data.serverPort } : {}),\n },\n },\n span => span,\n ) as Span;\n });\n\n channel.subscribe({\n start: NOOP,\n asyncStart: NOOP,\n end: NOOP,\n asyncEnd: data => {\n // only end if the error handler isn't going to\n if (!data.error) data._sentrySpan?.end();\n },\n error: data => {\n const span = data._sentrySpan;\n if (!span) return;\n if (data.error) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: data.error.message });\n }\n span.end();\n },\n });\n}\n\nfunction runResponseHook(span: Span, command: string, args: Array<string | Buffer>, result: unknown): void {\n const hook = currentResponseHook;\n if (!hook) return;\n try {\n hook(span, command, args as unknown as Parameters<typeof hook>[2], result);\n } catch {\n // never let user hooks break instrumentation\n }\n}\n\nfunction safeSerialize(command: string, args: Array<string | Buffer>): string | undefined {\n try {\n return defaultDbStatementSerializer(command, args);\n } catch {\n return undefined;\n }\n}\n\n// Test-only helper.\nexport function _resetRedisDiagnosticChannelsForTesting(): void {\n subscribed = false;\n currentResponseHook = undefined;\n}\n\n// Suppress unused-import lint when only used in types.\nexport type { TracingChannelContextWithSpan };\n"],"names":["tracingChannel","startSpanManual","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","SEMANTIC_ATTRIBUTE_SENTRY_OP","ATTR_DB_SYSTEM","DB_SYSTEM_VALUE_REDIS","ATTR_DB_STATEMENT","ATTR_NET_PEER_NAME","ATTR_NET_PEER_PORT","SPAN_STATUS_ERROR","defaultDbStatementSerializer"],"mappings":";;;;;;;AAoBA,MAAM,eAAA,GAAkB,oBAAA;AACxB,MAAM,aAAA,GAAgB,kBAAA;AACtB,MAAM,eA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M,OAAA,EAAS,IAAA,EAA+C,MAAM,CAAA;AAAA,EAC3E,CAAA,CAAA,MAAQ;AAAA,EAER;AACF;AAEA,SAAS,aAAA,CAAc,SAAiB,IAAA,EAAkD;AACxF,EAAA,IAAI;AACF,IAAA,OAAOC,wCAAA,CAA6B,SAAS,IAAI,CAAA;AAAA,EACnD,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,MAAA;AAAA,EACT;AACF;;;;"}
@@ -1,149 +0,0 @@
1
- import { startSpanManual, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_STATUS_ERROR } from '@sentry/core';
2
- import { tracingChannel } from '@sentry/opentelemetry/tracing-channel';
3
- import { defaultDbStatementSerializer } from './vendored/redis-common.js';
4
- import { DB_SYSTEM_VALUE_REDIS, ATTR_NET_PEER_PORT, ATTR_NET_PEER_NAME, ATTR_DB_STATEMENT, ATTR_DB_SYSTEM } from './vendored/semconv.js';
5
-
6
- const CHANNEL_COMMAND = "node-redis:command";
7
- const CHANNEL_BATCH = "node-redis:batch";
8
- const CHANNEL_CONNECT = "node-redis:connect";
9
- const ORIGIN = "auto.db.redis.diagnostic_channel";
10
- const NOOP = () => {
11
- };
12
- let subscribed = false;
13
- let currentResponseHook;
14
- function subscribeRedisDiagnosticChannels(responseHook) {
15
- currentResponseHook = responseHook;
16
- if (subscribed) return;
17
- try {
18
- setupCommandChannel();
19
- setupBatchChannel();
20
- setupConnectChannel();
21
- subscribed = true;
22
- } catch {
23
- }
24
- }
25
- function setupCommandChannel() {
26
- const channel = tracingChannel(CHANNEL_COMMAND, (data) => {
27
- const actualArgs = data.args.slice(1);
28
- const statement = safeSerialize(data.command, actualArgs);
29
- return startSpanManual(
30
- {
31
- name: `redis-${data.command}`,
32
- attributes: {
33
- [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,
34
- [SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db.redis",
35
- [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,
36
- ...statement != null ? { [ATTR_DB_STATEMENT]: statement } : {},
37
- ...data.serverAddress != null ? { [ATTR_NET_PEER_NAME]: data.serverAddress } : {},
38
- ...data.serverPort != null ? { [ATTR_NET_PEER_PORT]: data.serverPort } : {}
39
- }
40
- },
41
- (span) => span
42
- );
43
- });
44
- channel.subscribe({
45
- start: NOOP,
46
- asyncStart: NOOP,
47
- end: NOOP,
48
- asyncEnd: (data) => {
49
- const span = data._sentrySpan;
50
- if (!span || data.error) return;
51
- runResponseHook(span, data.command, data.args.slice(1), data.result);
52
- span.end();
53
- },
54
- error: (data) => {
55
- const span = data._sentrySpan;
56
- if (!span) return;
57
- if (data.error) {
58
- span.setStatus({ code: SPAN_STATUS_ERROR, message: data.error.message });
59
- }
60
- span.end();
61
- }
62
- });
63
- }
64
- function setupBatchChannel() {
65
- const channel = tracingChannel(CHANNEL_BATCH, (data) => {
66
- const operationName = data.batchMode === "PIPELINE" ? "PIPELINE" : "MULTI";
67
- return startSpanManual(
68
- {
69
- name: operationName,
70
- attributes: {
71
- [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,
72
- [SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db.redis",
73
- [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,
74
- ...data.batchSize != null ? { "db.redis.batch_size": data.batchSize } : {},
75
- ...data.serverAddress != null ? { [ATTR_NET_PEER_NAME]: data.serverAddress } : {},
76
- ...data.serverPort != null ? { [ATTR_NET_PEER_PORT]: data.serverPort } : {}
77
- }
78
- },
79
- (span) => span
80
- );
81
- });
82
- channel.subscribe({
83
- start: NOOP,
84
- asyncStart: NOOP,
85
- end: NOOP,
86
- asyncEnd: (data) => {
87
- if (!data.error) data._sentrySpan?.end();
88
- },
89
- error: (data) => {
90
- const span = data._sentrySpan;
91
- if (!span) return;
92
- if (data.error) {
93
- span.setStatus({ code: SPAN_STATUS_ERROR, message: data.error.message });
94
- }
95
- span.end();
96
- }
97
- });
98
- }
99
- function setupConnectChannel() {
100
- const channel = tracingChannel(CHANNEL_CONNECT, (data) => {
101
- return startSpanManual(
102
- {
103
- name: "redis-connect",
104
- attributes: {
105
- [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,
106
- [SEMANTIC_ATTRIBUTE_SENTRY_OP]: "db.redis.connect",
107
- [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,
108
- ...data.serverAddress != null ? { [ATTR_NET_PEER_NAME]: data.serverAddress } : {},
109
- ...data.serverPort != null ? { [ATTR_NET_PEER_PORT]: data.serverPort } : {}
110
- }
111
- },
112
- (span) => span
113
- );
114
- });
115
- channel.subscribe({
116
- start: NOOP,
117
- asyncStart: NOOP,
118
- end: NOOP,
119
- asyncEnd: (data) => {
120
- if (!data.error) data._sentrySpan?.end();
121
- },
122
- error: (data) => {
123
- const span = data._sentrySpan;
124
- if (!span) return;
125
- if (data.error) {
126
- span.setStatus({ code: SPAN_STATUS_ERROR, message: data.error.message });
127
- }
128
- span.end();
129
- }
130
- });
131
- }
132
- function runResponseHook(span, command, args, result) {
133
- const hook = currentResponseHook;
134
- if (!hook) return;
135
- try {
136
- hook(span, command, args, result);
137
- } catch {
138
- }
139
- }
140
- function safeSerialize(command, args) {
141
- try {
142
- return defaultDbStatementSerializer(command, args);
143
- } catch {
144
- return void 0;
145
- }
146
- }
147
-
148
- export { subscribeRedisDiagnosticChannels };
149
- //# sourceMappingURL=redis-dc-subscriber.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"redis-dc-subscriber.js","sources":["../../../../../src/integrations/tracing/redis/redis-dc-subscriber.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SPAN_STATUS_ERROR,\n startSpanManual,\n} from '@sentry/core';\nimport { tracingChannel, type TracingChannelContextWithSpan } from '@sentry/opentelemetry/tracing-channel';\nimport { defaultDbStatementSerializer } from './vendored/redis-common';\nimport {\n ATTR_DB_STATEMENT,\n ATTR_DB_SYSTEM,\n ATTR_NET_PEER_NAME,\n ATTR_NET_PEER_PORT,\n DB_SYSTEM_VALUE_REDIS,\n} from './vendored/semconv';\nimport type { IORedisInstrumentationConfig } from './vendored/types';\n\n// Channel names as published by node-redis >= 5.12.0.\n// Hardcoded so we don't import `redis` at module-load time.\nconst CHANNEL_COMMAND = 'node-redis:command';\nconst CHANNEL_BATCH = 'node-redis:batch';\nconst CHANNEL_CONNECT = 'node-redis:connect';\n\nconst ORIGIN = 'auto.db.redis.diagnostic_channel';\n\ninterface CommandData {\n command: string;\n args: Array<string | Buffer>;\n database?: number;\n serverAddress?: string;\n serverPort?: number;\n result?: unknown;\n error?: Error;\n}\n\ninterface BatchData {\n batchMode?: 'MULTI' | 'PIPELINE';\n batchSize?: number;\n database?: number;\n clientId?: string | number;\n serverAddress?: string;\n serverPort?: number;\n result?: unknown[];\n error?: Error;\n}\n\ninterface ConnectData {\n serverAddress?: string;\n serverPort?: number;\n url?: string;\n error?: Error;\n}\n\nconst NOOP = (): void => {};\n\nlet subscribed = false;\nlet currentResponseHook: IORedisInstrumentationConfig['responseHook'] | undefined;\n\n/**\n * Subscribe Sentry handlers to node-redis diagnostics_channel events (>= 5.12.0).\n *\n * Uses `@sentry/opentelemetry/tracing-channel` so OTel AsyncLocalStorage context propagates\n * automatically via `bindStore` — without it, spans created in `start` would not become\n * the active context for subsequent operations.\n *\n * Safe on every runtime that exposes `node:diagnostics_channel` (Node, Bun, Deno, Workers).\n * In node-redis < 5.12.0 the channels are never published to, so subscribers are inert and\n * there is no double-instrumentation against the IITM-based patcher (gated to < 5.12.0).\n */\nexport function subscribeRedisDiagnosticChannels(responseHook?: IORedisInstrumentationConfig['responseHook']): void {\n currentResponseHook = responseHook;\n if (subscribed) return;\n\n try {\n setupCommandChannel();\n setupBatchChannel();\n setupConnectChannel();\n subscribed = true;\n } catch {\n // tracingChannel from @sentry/opentelemetry requires `node:diagnostics_channel`.\n // On runtimes where it isn't available, fail closed.\n }\n}\n\nfunction setupCommandChannel(): void {\n const channel = tracingChannel<CommandData>(CHANNEL_COMMAND, data => {\n // node-redis >= 5.12.0 includes the command name as args[0] in the DC payload.\n // Strip it so serialization and cache key extraction see only the actual arguments.\n const actualArgs = data.args.slice(1);\n const statement = safeSerialize(data.command, actualArgs);\n return startSpanManual(\n {\n name: `redis-${data.command}`,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db.redis',\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n ...(statement != null ? { [ATTR_DB_STATEMENT]: statement } : {}),\n ...(data.serverAddress != null ? { [ATTR_NET_PEER_NAME]: data.serverAddress } : {}),\n ...(data.serverPort != null ? { [ATTR_NET_PEER_PORT]: data.serverPort } : {}),\n },\n },\n span => span,\n ) as Span;\n });\n\n channel.subscribe({\n start: NOOP,\n asyncStart: NOOP,\n end: NOOP,\n asyncEnd: data => {\n const span = data._sentrySpan;\n // only end if error handler isn't going to\n if (!span || data.error) return;\n // Same slice: strip command name from args before passing to the response hook.\n runResponseHook(span, data.command, data.args.slice(1), data.result);\n span.end();\n },\n error: data => {\n const span = data._sentrySpan;\n if (!span) return;\n if (data.error) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: data.error.message });\n }\n span.end();\n },\n });\n}\n\nfunction setupBatchChannel(): void {\n const channel = tracingChannel<BatchData>(CHANNEL_BATCH, data => {\n const operationName = data.batchMode === 'PIPELINE' ? 'PIPELINE' : 'MULTI';\n\n return startSpanManual(\n {\n name: operationName,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db.redis',\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n ...(data.batchSize != null ? { 'db.redis.batch_size': data.batchSize } : {}),\n ...(data.serverAddress != null ? { [ATTR_NET_PEER_NAME]: data.serverAddress } : {}),\n ...(data.serverPort != null ? { [ATTR_NET_PEER_PORT]: data.serverPort } : {}),\n },\n },\n span => span,\n ) as Span;\n });\n\n channel.subscribe({\n start: NOOP,\n asyncStart: NOOP,\n end: NOOP,\n asyncEnd: data => {\n // only end if the error handler isn't going to\n if (!data.error) data._sentrySpan?.end();\n },\n error: data => {\n const span = data._sentrySpan;\n if (!span) return;\n if (data.error) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: data.error.message });\n }\n span.end();\n },\n });\n}\n\nfunction setupConnectChannel(): void {\n const channel = tracingChannel<ConnectData>(CHANNEL_CONNECT, data => {\n return startSpanManual(\n {\n name: 'redis-connect',\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: ORIGIN,\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db.redis.connect',\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n ...(data.serverAddress != null ? { [ATTR_NET_PEER_NAME]: data.serverAddress } : {}),\n ...(data.serverPort != null ? { [ATTR_NET_PEER_PORT]: data.serverPort } : {}),\n },\n },\n span => span,\n ) as Span;\n });\n\n channel.subscribe({\n start: NOOP,\n asyncStart: NOOP,\n end: NOOP,\n asyncEnd: data => {\n // only end if the error handler isn't going to\n if (!data.error) data._sentrySpan?.end();\n },\n error: data => {\n const span = data._sentrySpan;\n if (!span) return;\n if (data.error) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: data.error.message });\n }\n span.end();\n },\n });\n}\n\nfunction runResponseHook(span: Span, command: string, args: Array<string | Buffer>, result: unknown): void {\n const hook = currentResponseHook;\n if (!hook) return;\n try {\n hook(span, command, args as unknown as Parameters<typeof hook>[2], result);\n } catch {\n // never let user hooks break instrumentation\n }\n}\n\nfunction safeSerialize(command: string, args: Array<string | Buffer>): string | undefined {\n try {\n return defaultDbStatementSerializer(command, args);\n } catch {\n return undefined;\n }\n}\n\n// Test-only helper.\nexport function _resetRedisDiagnosticChannelsForTesting(): void {\n subscribed = false;\n currentResponseHook = undefined;\n}\n\n// Suppress unused-import lint when only used in types.\nexport type { TracingChannelContextWithSpan };\n"],"names":[],"mappings":";;;;;AAoBA,MAAM,eAAA,GAAkB,oBAAA;AACxB,MAAM,aAAA,GAAgB,kBAAA;AACtB,MAAM,eAAA,GAAkB,oBAAA;AAExB,MAAM,MAAA,GAAS,kCAAA;AA8Bf,MAAM,OAAO,MAAY;AAAC,CAAA;AAE1B,IAAI,UAAA,GAAa,KAAA;AACjB,IAAI,mBAAA;AAaG,SAAS,iCAAiC,YAAA,EAAmE;AAClH,EAAA,mBAAA,GAAsB,YAAA;AACtB,EAAA,IAAI,UAAA,EAAY;AAEhB,EAAA,IAAI;AACF,IAAA,mBAAA,EAAoB;AACpB,IAAA,iBAAA,EAAkB;AAClB,IAAA,mBAAA,EAAoB;AACpB,IAAA,UAAA,GAAa,IAAA;AAAA,EACf,CAAA,CAAA,MAAQ;AAAA,EAGR;AACF;AAEA,SAAS,mBAAA,GAA4B;AACnC,EAAA,MAAM,OAAA,GAAU,cAAA,CAA4B,eAAA,EAAiB,CAAA,IAAA,KAAQ;AAGnE,IAAA,MAAM,UAAA,GAAa,IAAA,CAAK,IAAA,CAAK,KAAA,CAAM,CAAC,CAAA;AACpC,IAAA,MAAM,SAAA,GAAY,aAAA,CAAc,IAAA,CAAK,OAAA,EAAS,UAAU,CAAA;AACxD,IAAA,OAAO,eAAA;AAAA,MACL;AAAA,QACE,IAAA,EAAM,CAAA,MAAA,EAAS,IAAA,CAAK,OAAO,CAAA,CAAA;AAAA,QAC3B,UAAA,EAAY;AAAA,UACV,CAAC,gCAAgC,GAAG,MAAA;AAAA,UACpC,CAAC,4BAA4B,GAAG,UAAA;AAAA,UAChC,CAAC,cAAc,GAAG,qBAAA;AAAA,UAClB,GAAI,aAAa,IAAA,GAAO,EA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IAAA,CAAK,GAAA,EAAI;AAAA,IACX;AAAA,GACD,CAAA;AACH;AAEA,SAAS,eAAA,CAAgB,IAAA,EAAY,OAAA,EAAiB,IAAA,EAA8B,MAAA,EAAuB;AACzG,EAAA,MAAM,IAAA,GAAO,mBAAA;AACb,EAAA,IAAI,CAAC,IAAA,EAAM;AACX,EAAA,IAAI;AACF,IAAA,IAAA,CAAK,IAAA,EAAM,OAAA,EAAS,IAAA,EAA+C,MAAM,CAAA;AAAA,EAC3E,CAAA,CAAA,MAAQ;AAAA,EAER;AACF;AAEA,SAAS,aAAA,CAAc,SAAiB,IAAA,EAAkD;AACxF,EAAA,IAAI;AACF,IAAA,OAAO,4BAAA,CAA6B,SAAS,IAAI,CAAA;AAAA,EACnD,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,MAAA;AAAA,EACT;AACF;;;;"}
@@ -1,17 +0,0 @@
1
- import { type TracingChannelContextWithSpan } from '@sentry/opentelemetry/tracing-channel';
2
- import type { IORedisInstrumentationConfig } from './vendored/types';
3
- /**
4
- * Subscribe Sentry handlers to node-redis diagnostics_channel events (>= 5.12.0).
5
- *
6
- * Uses `@sentry/opentelemetry/tracing-channel` so OTel AsyncLocalStorage context propagates
7
- * automatically via `bindStore` — without it, spans created in `start` would not become
8
- * the active context for subsequent operations.
9
- *
10
- * Safe on every runtime that exposes `node:diagnostics_channel` (Node, Bun, Deno, Workers).
11
- * In node-redis < 5.12.0 the channels are never published to, so subscribers are inert and
12
- * there is no double-instrumentation against the IITM-based patcher (gated to < 5.12.0).
13
- */
14
- export declare function subscribeRedisDiagnosticChannels(responseHook?: IORedisInstrumentationConfig['responseHook']): void;
15
- export declare function _resetRedisDiagnosticChannelsForTesting(): void;
16
- export type { TracingChannelContextWithSpan };
17
- //# sourceMappingURL=redis-dc-subscriber.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"redis-dc-subscriber.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/redis/redis-dc-subscriber.ts"],"names":[],"mappings":"AAOA,OAAO,EAAkB,KAAK,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAS3G,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AA2CrE;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAAC,YAAY,CAAC,EAAE,4BAA4B,CAAC,cAAc,CAAC,GAAG,IAAI,CAalH;AA6ID,wBAAgB,uCAAuC,IAAI,IAAI,CAG9D;AAGD,YAAY,EAAE,6BAA6B,EAAE,CAAC"}
@@ -1,17 +0,0 @@
1
- import { TracingChannelContextWithSpan } from '@sentry/opentelemetry/tracing-channel';
2
- import { IORedisInstrumentationConfig } from './vendored/types';
3
- /**
4
- * Subscribe Sentry handlers to node-redis diagnostics_channel events (>= 5.12.0).
5
- *
6
- * Uses `@sentry/opentelemetry/tracing-channel` so OTel AsyncLocalStorage context propagates
7
- * automatically via `bindStore` — without it, spans created in `start` would not become
8
- * the active context for subsequent operations.
9
- *
10
- * Safe on every runtime that exposes `node:diagnostics_channel` (Node, Bun, Deno, Workers).
11
- * In node-redis < 5.12.0 the channels are never published to, so subscribers are inert and
12
- * there is no double-instrumentation against the IITM-based patcher (gated to < 5.12.0).
13
- */
14
- export declare function subscribeRedisDiagnosticChannels(responseHook?: IORedisInstrumentationConfig['responseHook']): void;
15
- export declare function _resetRedisDiagnosticChannelsForTesting(): void;
16
- export { TracingChannelContextWithSpan };
17
- //# sourceMappingURL=redis-dc-subscriber.d.ts.map