@sentry/node 10.51.0 → 10.53.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.
- package/build/cjs/index.js +4 -4
- package/build/cjs/integrations/http.js +18 -145
- package/build/cjs/integrations/http.js.map +1 -1
- package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js +8 -8
- package/build/cjs/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/google-genai/instrumentation.js +9 -9
- package/build/cjs/integrations/tracing/google-genai/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/index.js +21 -22
- package/build/cjs/integrations/tracing/index.js.map +1 -1
- package/build/cjs/integrations/tracing/langchain/instrumentation.js +12 -12
- package/build/cjs/integrations/tracing/langchain/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/langgraph/instrumentation.js +12 -12
- package/build/cjs/integrations/tracing/langgraph/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/openai/instrumentation.js +11 -11
- package/build/cjs/integrations/tracing/openai/instrumentation.js.map +1 -1
- package/build/cjs/integrations/tracing/postgresjs.js +10 -10
- package/build/cjs/integrations/tracing/postgresjs.js.map +1 -1
- package/build/cjs/integrations/tracing/{redis.js → redis/index.js} +18 -10
- package/build/cjs/integrations/tracing/redis/index.js.map +1 -0
- package/build/cjs/integrations/tracing/redis/redis-dc-subscriber.js +186 -0
- package/build/cjs/integrations/tracing/redis/redis-dc-subscriber.js.map +1 -0
- package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js +255 -0
- package/build/cjs/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/redis/vendored/redis-common.js +74 -0
- package/build/cjs/integrations/tracing/redis/vendored/redis-common.js.map +1 -0
- package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js +685 -0
- package/build/cjs/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -0
- package/build/cjs/integrations/tracing/redis/vendored/semconv.js +47 -0
- package/build/cjs/integrations/tracing/redis/vendored/semconv.js.map +1 -0
- package/build/cjs/utils/redisCache.js.map +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/integrations/http.js +21 -146
- package/build/esm/integrations/http.js.map +1 -1
- package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js +8 -8
- package/build/esm/integrations/tracing/anthropic-ai/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/google-genai/instrumentation.js +9 -9
- package/build/esm/integrations/tracing/google-genai/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/index.js +2 -3
- package/build/esm/integrations/tracing/index.js.map +1 -1
- package/build/esm/integrations/tracing/langchain/instrumentation.js +12 -12
- package/build/esm/integrations/tracing/langchain/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/langgraph/instrumentation.js +12 -12
- package/build/esm/integrations/tracing/langgraph/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/openai/instrumentation.js +11 -11
- package/build/esm/integrations/tracing/openai/instrumentation.js.map +1 -1
- package/build/esm/integrations/tracing/postgresjs.js +10 -10
- package/build/esm/integrations/tracing/postgresjs.js.map +1 -1
- package/build/esm/integrations/tracing/{redis.js → redis/index.js} +17 -9
- package/build/esm/integrations/tracing/redis/index.js.map +1 -0
- package/build/esm/integrations/tracing/redis/redis-dc-subscriber.js +184 -0
- package/build/esm/integrations/tracing/redis/redis-dc-subscriber.js.map +1 -0
- package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js +253 -0
- package/build/esm/integrations/tracing/redis/vendored/ioredis-instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/redis/vendored/redis-common.js +72 -0
- package/build/esm/integrations/tracing/redis/vendored/redis-common.js.map +1 -0
- package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js +683 -0
- package/build/esm/integrations/tracing/redis/vendored/redis-instrumentation.js.map +1 -0
- package/build/esm/integrations/tracing/redis/vendored/semconv.js +39 -0
- package/build/esm/integrations/tracing/redis/vendored/semconv.js.map +1 -0
- package/build/esm/package.json +1 -1
- package/build/esm/utils/redisCache.js.map +1 -1
- package/build/types/integrations/http.d.ts +8 -15
- package/build/types/integrations/http.d.ts.map +1 -1
- package/build/types/integrations/tracing/index.d.ts.map +1 -1
- package/build/types/integrations/tracing/{redis.d.ts → redis/index.d.ts} +3 -3
- package/build/types/integrations/tracing/redis/index.d.ts.map +1 -0
- package/build/types/integrations/tracing/redis/redis-dc-subscriber.d.ts +17 -0
- package/build/types/integrations/tracing/redis/redis-dc-subscriber.d.ts.map +1 -0
- package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +15 -0
- package/build/types/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/redis/vendored/redis-common.d.ts +6 -0
- package/build/types/integrations/tracing/redis/vendored/redis-common.d.ts.map +1 -0
- package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts +16 -0
- package/build/types/integrations/tracing/redis/vendored/redis-instrumentation.d.ts.map +1 -0
- package/build/types/integrations/tracing/redis/vendored/semconv.d.ts +8 -0
- package/build/types/integrations/tracing/redis/vendored/semconv.d.ts.map +1 -0
- package/build/types/integrations/tracing/redis/vendored/types.d.ts +58 -0
- package/build/types/integrations/tracing/redis/vendored/types.d.ts.map +1 -0
- package/build/types/utils/redisCache.d.ts +1 -1
- package/build/types/utils/redisCache.d.ts.map +1 -1
- package/build/types-ts3.8/integrations/http.d.ts +8 -15
- package/build/types-ts3.8/integrations/tracing/{redis.d.ts → redis/index.d.ts} +3 -3
- package/build/types-ts3.8/integrations/tracing/redis/redis-dc-subscriber.d.ts +17 -0
- package/build/types-ts3.8/integrations/tracing/redis/vendored/ioredis-instrumentation.d.ts +15 -0
- package/build/types-ts3.8/integrations/tracing/redis/vendored/redis-common.d.ts +6 -0
- package/build/types-ts3.8/integrations/tracing/redis/vendored/redis-instrumentation.d.ts +16 -0
- package/build/types-ts3.8/integrations/tracing/redis/vendored/semconv.d.ts +8 -0
- package/build/types-ts3.8/integrations/tracing/redis/vendored/types.d.ts +58 -0
- package/build/types-ts3.8/utils/redisCache.d.ts +1 -1
- package/package.json +4 -6
- package/build/cjs/integrations/tracing/redis.js.map +0 -1
- package/build/esm/integrations/tracing/redis.js.map +0 -1
- package/build/types/integrations/tracing/redis.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis-instrumentation.js","sources":["../../../../../../src/integrations/tracing/redis/vendored/redis-instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/instrumentation-redis-v0.62.0/packages/instrumentation-redis\n * - Upstream version: @opentelemetry/instrumentation-redis@0.62.0\n * - Minor TypeScript adjustments for this repository's compiler settings\n */\n/* eslint-disable -- vendored @opentelemetry/instrumentation-redis */\n\nimport { context, SpanKind, SpanStatusCode, trace } from '@opentelemetry/api';\nimport type { DiagLogger, Span, TracerProvider } from '@opentelemetry/api';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';\nimport {\n InstrumentationBase,\n InstrumentationNodeModuleDefinition,\n InstrumentationNodeModuleFile,\n isWrapped,\n safeExecuteInTheMiddle,\n SemconvStability,\n semconvStabilityFromStr,\n} from '@opentelemetry/instrumentation';\nimport {\n ATTR_DB_OPERATION_NAME,\n ATTR_DB_QUERY_TEXT,\n ATTR_DB_SYSTEM_NAME,\n ATTR_SERVER_ADDRESS,\n ATTR_SERVER_PORT,\n} from '@opentelemetry/semantic-conventions';\n\nimport { defaultDbStatementSerializer } from './redis-common';\nimport {\n ATTR_DB_CONNECTION_STRING,\n ATTR_DB_STATEMENT,\n ATTR_DB_SYSTEM,\n ATTR_NET_PEER_NAME,\n ATTR_NET_PEER_PORT,\n DB_SYSTEM_NAME_VALUE_REDIS,\n DB_SYSTEM_VALUE_REDIS,\n} from './semconv';\nimport type { RedisInstrumentationConfig } from './types';\n\nconst PACKAGE_NAME = '@opentelemetry/instrumentation-redis';\nconst PACKAGE_VERSION = '0.62.0';\n\n// ---- Internal types ----\n\ninterface RedisPluginClientTypes {\n connection_options?: {\n port?: string | number;\n host?: string;\n };\n address?: string;\n}\n\ninterface RedisCommand {\n command: string;\n args: string[];\n buffer_args: boolean;\n callback: (err: Error | null, reply: unknown) => void;\n call_on_write: boolean;\n}\n\ninterface MultiErrorReply extends Error {\n replies: unknown[];\n errorIndexes: Array<number>;\n}\n\ninterface OpenSpanInfo {\n span: Span;\n commandName: string;\n commandArgs: Array<string | Buffer>;\n}\n\nconst OTEL_OPEN_SPANS = Symbol('opentelemetry.instrumentation.redis.open_spans');\nconst MULTI_COMMAND_OPTIONS = Symbol('opentelemetry.instrumentation.redis.multi_command_options');\n\n// ---- v4-v5 utils ----\n\nfunction removeCredentialsFromDBConnectionStringAttribute(\n diagLogger: DiagLogger,\n url: string | undefined,\n): string | undefined {\n if (typeof url !== 'string' || !url) {\n return undefined;\n }\n try {\n const u = new URL(url);\n u.searchParams.delete('user_pwd');\n u.username = '';\n u.password = '';\n return u.href;\n } catch (err) {\n diagLogger.error('failed to sanitize redis connection url', err);\n }\n return undefined;\n}\n\nfunction getClientAttributes(\n diagLogger: DiagLogger,\n options: any,\n semconvStability: SemconvStability,\n): Record<string, any> {\n const attributes: Record<string, any> = {};\n if (semconvStability & SemconvStability.OLD) {\n Object.assign(attributes, {\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n [ATTR_NET_PEER_NAME]: options?.socket?.host,\n [ATTR_NET_PEER_PORT]: options?.socket?.port,\n [ATTR_DB_CONNECTION_STRING]: removeCredentialsFromDBConnectionStringAttribute(diagLogger, options?.url),\n });\n }\n if (semconvStability & SemconvStability.STABLE) {\n Object.assign(attributes, {\n [ATTR_DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_REDIS,\n [ATTR_SERVER_ADDRESS]: options?.socket?.host,\n [ATTR_SERVER_PORT]: options?.socket?.port,\n });\n }\n return attributes;\n}\n\n// ---- v2-v3 utils ----\n\nfunction endSpanV2(span: Span, err: Error | null | undefined): void {\n if (err) {\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: err.message,\n });\n }\n span.end();\n}\n\nfunction getTracedCreateClient(original: Function): Function {\n return function createClientTrace(this: any) {\n const client = original.apply(this, arguments);\n return context.bind(context.active(), client);\n };\n}\n\nfunction getTracedCreateStreamTrace(original: Function): Function {\n return function create_stream_trace(this: any) {\n if (!Object.prototype.hasOwnProperty.call(this, 'stream')) {\n Object.defineProperty(this, 'stream', {\n get() {\n return this._patched_redis_stream;\n },\n set(val: any) {\n context.bind(context.active(), val);\n this._patched_redis_stream = val;\n },\n });\n }\n return original.apply(this, arguments);\n };\n}\n\n// ---- RedisInstrumentationV2_V3 ----\n\nclass RedisInstrumentationV2_V3 extends InstrumentationBase<RedisInstrumentationConfig> {\n static COMPONENT = 'redis';\n _semconvStability: SemconvStability;\n\n constructor(config: RedisInstrumentationConfig = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, config);\n this._semconvStability = config.semconvStability\n ? config.semconvStability\n : semconvStabilityFromStr('database', process.env['OTEL_SEMCONV_STABILITY_OPT_IN']);\n }\n\n override setConfig(config: RedisInstrumentationConfig = {}): void {\n super.setConfig(config);\n this._semconvStability = config.semconvStability\n ? config.semconvStability\n : semconvStabilityFromStr('database', process.env['OTEL_SEMCONV_STABILITY_OPT_IN']);\n }\n\n init() {\n return [\n new InstrumentationNodeModuleDefinition(\n 'redis',\n ['>=2.6.0 <4'],\n (moduleExports: any) => {\n if (isWrapped(moduleExports.RedisClient.prototype['internal_send_command'])) {\n this._unwrap(moduleExports.RedisClient.prototype, 'internal_send_command');\n }\n this._wrap(moduleExports.RedisClient.prototype, 'internal_send_command', this._getPatchInternalSendCommand());\n if (isWrapped(moduleExports.RedisClient.prototype['create_stream'])) {\n this._unwrap(moduleExports.RedisClient.prototype, 'create_stream');\n }\n this._wrap(moduleExports.RedisClient.prototype, 'create_stream', this._getPatchCreateStream());\n if (isWrapped(moduleExports.createClient)) {\n this._unwrap(moduleExports, 'createClient');\n }\n this._wrap(moduleExports, 'createClient', this._getPatchCreateClient());\n return moduleExports;\n },\n (moduleExports: any) => {\n if (moduleExports === undefined) return;\n this._unwrap(moduleExports.RedisClient.prototype, 'internal_send_command');\n this._unwrap(moduleExports.RedisClient.prototype, 'create_stream');\n this._unwrap(moduleExports, 'createClient');\n },\n ),\n ];\n }\n\n private _getPatchInternalSendCommand() {\n const instrumentation = this;\n return function internal_send_command(original: Function) {\n return function internal_send_command_trace(this: RedisPluginClientTypes, cmd: RedisCommand) {\n if (arguments.length !== 1 || typeof cmd !== 'object') {\n return original.apply(this, arguments);\n }\n const config = instrumentation.getConfig();\n const hasNoParentSpan = trace.getSpan(context.active()) === undefined;\n if (config.requireParentSpan === true && hasNoParentSpan) {\n return original.apply(this, arguments);\n }\n const dbStatementSerializer = config?.dbStatementSerializer || defaultDbStatementSerializer;\n const attributes: Record<string, any> = {};\n if (instrumentation._semconvStability & SemconvStability.OLD) {\n Object.assign(attributes, {\n [ATTR_DB_SYSTEM]: DB_SYSTEM_VALUE_REDIS,\n [ATTR_DB_STATEMENT]: dbStatementSerializer(cmd.command, cmd.args),\n });\n }\n if (instrumentation._semconvStability & SemconvStability.STABLE) {\n Object.assign(attributes, {\n [ATTR_DB_SYSTEM_NAME]: DB_SYSTEM_NAME_VALUE_REDIS,\n [ATTR_DB_OPERATION_NAME]: cmd.command,\n [ATTR_DB_QUERY_TEXT]: dbStatementSerializer(cmd.command, cmd.args),\n });\n }\n attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = 'auto.db.otel.redis';\n const span = instrumentation.tracer.startSpan(`${RedisInstrumentationV2_V3.COMPONENT}-${cmd.command}`, {\n kind: SpanKind.CLIENT,\n attributes,\n });\n if (this.connection_options) {\n const connectionAttributes: Record<string, any> = {};\n if (instrumentation._semconvStability & SemconvStability.OLD) {\n Object.assign(connectionAttributes, {\n [ATTR_NET_PEER_NAME]: this.connection_options.host,\n [ATTR_NET_PEER_PORT]: this.connection_options.port,\n });\n }\n if (instrumentation._semconvStability & SemconvStability.STABLE) {\n Object.assign(connectionAttributes, {\n [ATTR_SERVER_ADDRESS]: this.connection_options.host,\n [ATTR_SERVER_PORT]: this.connection_options.port,\n });\n }\n span.setAttributes(connectionAttributes);\n }\n if (this.address && instrumentation._semconvStability & SemconvStability.OLD) {\n span.setAttribute(ATTR_DB_CONNECTION_STRING, `redis://${this.address}`);\n }\n const originalCallback = arguments[0].callback;\n if (originalCallback) {\n const originalContext = context.active();\n arguments[0].callback = function callback(this: any, err: Error | null, reply: unknown) {\n if (config?.responseHook) {\n const responseHook = config.responseHook;\n safeExecuteInTheMiddle(\n () => {\n responseHook(span, cmd.command, cmd.args, reply);\n },\n (e: Error | undefined) => {\n if (e) {\n instrumentation._diag.error('Error executing responseHook', e);\n }\n },\n true,\n );\n }\n endSpanV2(span, err);\n return context.with(originalContext, originalCallback, this, ...arguments);\n };\n }\n try {\n return original.apply(this, arguments);\n } catch (rethrow) {\n endSpanV2(span, rethrow as Error);\n throw rethrow;\n }\n };\n };\n }\n\n private _getPatchCreateClient() {\n return function createClient(original: Function) {\n return getTracedCreateClient(original);\n };\n }\n\n private _getPatchCreateStream() {\n return function createReadStream(original: Function) {\n return getTracedCreateStreamTrace(original);\n };\n }\n}\n\n// ---- RedisInstrumentationV4_V5 ----\n\nclass RedisInstrumentationV4_V5 extends InstrumentationBase<RedisInstrumentationConfig> {\n static COMPONENT = 'redis';\n _semconvStability: SemconvStability;\n\n constructor(config: RedisInstrumentationConfig = {}) {\n super(PACKAGE_NAME, PACKAGE_VERSION, config);\n this._semconvStability = config.semconvStability\n ? config.semconvStability\n : semconvStabilityFromStr('database', process.env['OTEL_SEMCONV_STABILITY_OPT_IN']);\n }\n\n override setConfig(config: RedisInstrumentationConfig = {}): void {\n super.setConfig(config);\n this._semconvStability = config.semconvStability\n ? config.semconvStability\n : semconvStabilityFromStr('database', process.env['OTEL_SEMCONV_STABILITY_OPT_IN']);\n }\n\n init() {\n return [\n this._getInstrumentationNodeModuleDefinition('@redis/client'),\n this._getInstrumentationNodeModuleDefinition('@node-redis/client'),\n ];\n }\n\n private _getInstrumentationNodeModuleDefinition(basePackageName: string) {\n const commanderModuleFile = new InstrumentationNodeModuleFile(\n `${basePackageName}/dist/lib/commander.js`,\n ['^1.0.0'],\n (moduleExports: any, moduleVersion?: string) => {\n const transformCommandArguments = moduleExports.transformCommandArguments;\n if (!transformCommandArguments) {\n this._diag.error('internal instrumentation error, missing transformCommandArguments function');\n return moduleExports;\n }\n const functionToPatch = moduleVersion?.startsWith('1.0.') ? 'extendWithCommands' : 'attachCommands';\n if (isWrapped(moduleExports?.[functionToPatch])) {\n this._unwrap(moduleExports, functionToPatch);\n }\n this._wrap(moduleExports, functionToPatch, this._getPatchExtendWithCommands(transformCommandArguments));\n return moduleExports;\n },\n (moduleExports: any) => {\n if (isWrapped(moduleExports?.extendWithCommands)) {\n this._unwrap(moduleExports, 'extendWithCommands');\n }\n if (isWrapped(moduleExports?.attachCommands)) {\n this._unwrap(moduleExports, 'attachCommands');\n }\n },\n );\n\n const multiCommanderModule = new InstrumentationNodeModuleFile(\n `${basePackageName}/dist/lib/client/multi-command.js`,\n ['^1.0.0', '>=5.0.0 <5.12.0'],\n (moduleExports: any) => {\n const redisClientMultiCommandPrototype = moduleExports?.default?.prototype;\n if (isWrapped(redisClientMultiCommandPrototype?.exec)) {\n this._unwrap(redisClientMultiCommandPrototype, 'exec');\n }\n this._wrap(redisClientMultiCommandPrototype, 'exec', this._getPatchMultiCommandsExec(false));\n if (isWrapped(redisClientMultiCommandPrototype?.execAsPipeline)) {\n this._unwrap(redisClientMultiCommandPrototype, 'execAsPipeline');\n }\n this._wrap(redisClientMultiCommandPrototype, 'execAsPipeline', this._getPatchMultiCommandsExec(true));\n if (isWrapped(redisClientMultiCommandPrototype?.addCommand)) {\n this._unwrap(redisClientMultiCommandPrototype, 'addCommand');\n }\n this._wrap(redisClientMultiCommandPrototype, 'addCommand', this._getPatchMultiCommandsAddCommand());\n return moduleExports;\n },\n (moduleExports: any) => {\n const redisClientMultiCommandPrototype = moduleExports?.default?.prototype;\n if (isWrapped(redisClientMultiCommandPrototype?.exec)) {\n this._unwrap(redisClientMultiCommandPrototype, 'exec');\n }\n if (isWrapped(redisClientMultiCommandPrototype?.execAsPipeline)) {\n this._unwrap(redisClientMultiCommandPrototype, 'execAsPipeline');\n }\n if (isWrapped(redisClientMultiCommandPrototype?.addCommand)) {\n this._unwrap(redisClientMultiCommandPrototype, 'addCommand');\n }\n },\n );\n\n const clientIndexModule = new InstrumentationNodeModuleFile(\n `${basePackageName}/dist/lib/client/index.js`,\n ['^1.0.0', '>=5.0.0 <5.12.0'],\n (moduleExports: any) => {\n const redisClientPrototype = moduleExports?.default?.prototype;\n if (redisClientPrototype?.multi) {\n if (isWrapped(redisClientPrototype?.multi)) {\n this._unwrap(redisClientPrototype, 'multi');\n }\n this._wrap(redisClientPrototype, 'multi', this._getPatchRedisClientMulti());\n }\n if (redisClientPrototype?.MULTI) {\n if (isWrapped(redisClientPrototype?.MULTI)) {\n this._unwrap(redisClientPrototype, 'MULTI');\n }\n this._wrap(redisClientPrototype, 'MULTI', this._getPatchRedisClientMulti());\n }\n if (isWrapped(redisClientPrototype?.sendCommand)) {\n this._unwrap(redisClientPrototype, 'sendCommand');\n }\n this._wrap(redisClientPrototype, 'sendCommand', this._getPatchRedisClientSendCommand());\n if (isWrapped(redisClientPrototype?.connect)) {\n this._unwrap(redisClientPrototype, 'connect');\n }\n this._wrap(redisClientPrototype, 'connect', this._getPatchedClientConnect());\n return moduleExports;\n },\n (moduleExports: any) => {\n const redisClientPrototype = moduleExports?.default?.prototype;\n if (isWrapped(redisClientPrototype?.multi)) {\n this._unwrap(redisClientPrototype, 'multi');\n }\n if (isWrapped(redisClientPrototype?.MULTI)) {\n this._unwrap(redisClientPrototype, 'MULTI');\n }\n if (isWrapped(redisClientPrototype?.sendCommand)) {\n this._unwrap(redisClientPrototype, 'sendCommand');\n }\n if (isWrapped(redisClientPrototype?.connect)) {\n this._unwrap(redisClientPrototype, 'connect');\n }\n },\n );\n\n return new InstrumentationNodeModuleDefinition(\n basePackageName,\n ['^1.0.0', '>=5.0.0 <5.12.0'],\n (moduleExports: any) => moduleExports,\n () => {},\n [commanderModuleFile, multiCommanderModule, clientIndexModule],\n );\n }\n\n private _getPatchExtendWithCommands(transformCommandArguments: Function) {\n const plugin = this;\n return function extendWithCommandsPatchWrapper(original: Function) {\n return function extendWithCommandsPatch(this: any, config: any) {\n if (config?.BaseClass?.name !== 'RedisClient') {\n return original.apply(this, arguments);\n }\n const origExecutor = config.executor;\n config.executor = function (this: any, command: any, args: any) {\n const redisCommandArguments = transformCommandArguments(command, args).args;\n return plugin._traceClientCommand(origExecutor, this, arguments, redisCommandArguments);\n };\n return original.apply(this, arguments);\n };\n };\n }\n\n private _getPatchMultiCommandsExec(isPipeline: boolean) {\n const plugin = this;\n return function execPatchWrapper(original: Function) {\n return function execPatch(this: any) {\n const execRes = original.apply(this, arguments);\n if (typeof execRes?.then !== 'function') {\n plugin._diag.error('non-promise result when patching exec/execAsPipeline');\n return execRes;\n }\n return execRes\n .then((redisRes: unknown[]) => {\n const openSpans: OpenSpanInfo[] = this[OTEL_OPEN_SPANS];\n plugin._endSpansWithRedisReplies(openSpans, redisRes, isPipeline);\n return redisRes;\n })\n .catch((err: any) => {\n const openSpans: OpenSpanInfo[] = this[OTEL_OPEN_SPANS];\n if (!openSpans) {\n plugin._diag.error('cannot find open spans to end for multi/pipeline');\n } else {\n const replies =\n err.constructor.name === 'MultiErrorReply'\n ? (err as MultiErrorReply).replies\n : new Array(openSpans.length).fill(err);\n plugin._endSpansWithRedisReplies(openSpans, replies, isPipeline);\n }\n return Promise.reject(err);\n });\n };\n };\n }\n\n private _getPatchMultiCommandsAddCommand() {\n const plugin = this;\n return function addCommandWrapper(original: Function) {\n return function addCommandPatch(this: any, args: any) {\n return plugin._traceClientCommand(original, this, arguments, args);\n };\n };\n }\n\n private _getPatchRedisClientMulti() {\n return function multiPatchWrapper(original: Function) {\n return function multiPatch(this: any) {\n const multiRes: any = original.apply(this, arguments);\n multiRes[MULTI_COMMAND_OPTIONS] = this.options;\n return multiRes;\n };\n };\n }\n\n private _getPatchRedisClientSendCommand() {\n const plugin = this;\n return function sendCommandWrapper(original: Function) {\n return function sendCommandPatch(this: any, args: any) {\n return plugin._traceClientCommand(original, this, arguments, args);\n };\n };\n }\n\n private _getPatchedClientConnect() {\n const plugin = this;\n return function connectWrapper(original: Function) {\n return function patchedConnect(this: any) {\n const options = this.options;\n const attributes = getClientAttributes(plugin._diag, options, plugin._semconvStability);\n attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = 'auto.db.otel.redis';\n const span = plugin.tracer.startSpan(`${RedisInstrumentationV4_V5.COMPONENT}-connect`, {\n kind: SpanKind.CLIENT,\n attributes,\n });\n const res = context.with(trace.setSpan(context.active(), span), () => {\n return original.apply(this);\n });\n return res\n .then((result: any) => {\n span.end();\n return result;\n })\n .catch((error: Error) => {\n span.recordException(error);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n span.end();\n return Promise.reject(error);\n });\n };\n };\n }\n\n _traceClientCommand(\n origFunction: Function,\n origThis: any,\n origArguments: IArguments,\n redisCommandArguments: Array<string | Buffer>,\n ): any {\n const hasNoParentSpan = trace.getSpan(context.active()) === undefined;\n if (hasNoParentSpan && this.getConfig().requireParentSpan) {\n return origFunction.apply(origThis, origArguments);\n }\n const clientOptions = origThis.options || origThis[MULTI_COMMAND_OPTIONS];\n const commandName = redisCommandArguments[0] as string;\n const commandArgs = redisCommandArguments.slice(1);\n const dbStatementSerializer = this.getConfig().dbStatementSerializer || defaultDbStatementSerializer;\n const attributes = getClientAttributes(this._diag, clientOptions, this._semconvStability);\n if (this._semconvStability & SemconvStability.STABLE) {\n attributes[ATTR_DB_OPERATION_NAME] = commandName;\n }\n try {\n const dbStatement = dbStatementSerializer(commandName, commandArgs);\n if (dbStatement != null) {\n if (this._semconvStability & SemconvStability.OLD) {\n attributes[ATTR_DB_STATEMENT] = dbStatement;\n }\n if (this._semconvStability & SemconvStability.STABLE) {\n attributes[ATTR_DB_QUERY_TEXT] = dbStatement;\n }\n }\n } catch (e) {\n this._diag.error('dbStatementSerializer throw an exception', e, { commandName });\n }\n attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] = 'auto.db.otel.redis';\n const span = this.tracer.startSpan(`${RedisInstrumentationV4_V5.COMPONENT}-${commandName}`, {\n kind: SpanKind.CLIENT,\n attributes,\n });\n const res = context.with(trace.setSpan(context.active(), span), () => {\n return origFunction.apply(origThis, origArguments);\n });\n if (typeof res?.then === 'function') {\n res.then(\n (redisRes: unknown) => {\n this._endSpanWithResponse(span, commandName, commandArgs, redisRes, undefined);\n },\n (err: Error) => {\n this._endSpanWithResponse(span, commandName, commandArgs, null, err);\n },\n );\n } else {\n const redisClientMultiCommand: any = res;\n redisClientMultiCommand[OTEL_OPEN_SPANS] = redisClientMultiCommand[OTEL_OPEN_SPANS] || [];\n redisClientMultiCommand[OTEL_OPEN_SPANS].push({\n span,\n commandName,\n commandArgs,\n });\n }\n return res;\n }\n\n _endSpansWithRedisReplies(openSpans: OpenSpanInfo[] | undefined, replies: unknown[], isPipeline = false): void {\n if (!openSpans) {\n return this._diag.error('cannot find open spans to end for redis multi/pipeline');\n }\n if (replies.length !== openSpans.length) {\n return this._diag.error('number of multi command spans does not match response from redis');\n }\n const allCommands = openSpans.map(s => s.commandName);\n const allSameCommand = allCommands.every(cmd => cmd === allCommands[0]);\n const operationName = allSameCommand\n ? (isPipeline ? 'PIPELINE ' : 'MULTI ') + allCommands[0]\n : isPipeline\n ? 'PIPELINE'\n : 'MULTI';\n for (let i = 0; i < openSpans.length; i++) {\n const { span, commandArgs } = openSpans[i]!;\n const currCommandRes = replies[i];\n const [res, err] = currCommandRes instanceof Error ? [null, currCommandRes] : [currCommandRes, undefined];\n if (this._semconvStability & SemconvStability.STABLE) {\n span.setAttribute(ATTR_DB_OPERATION_NAME, operationName);\n }\n this._endSpanWithResponse(span, allCommands[i]!, commandArgs, res, err);\n }\n }\n\n _endSpanWithResponse(\n span: Span,\n commandName: string,\n commandArgs: Array<string | Buffer>,\n response: unknown,\n error: Error | null | undefined,\n ): void {\n const { responseHook } = this.getConfig();\n if (!error && responseHook) {\n try {\n responseHook(span, commandName, commandArgs, response);\n } catch (err) {\n this._diag.error('responseHook throw an exception', err);\n }\n }\n if (error) {\n span.recordException(error);\n span.setStatus({ code: SpanStatusCode.ERROR, message: error?.message });\n }\n span.end();\n }\n}\n\n// ---- RedisInstrumentation (wrapper) ----\n\nconst DEFAULT_CONFIG: RedisInstrumentationConfig = {\n requireParentSpan: false,\n};\n\nexport class RedisInstrumentation extends InstrumentationBase<RedisInstrumentationConfig> {\n private instrumentationV2_V3: RedisInstrumentationV2_V3;\n private instrumentationV4_V5: RedisInstrumentationV4_V5;\n private initialized = false;\n\n constructor(config: RedisInstrumentationConfig = {}) {\n const resolvedConfig = { ...DEFAULT_CONFIG, ...config };\n super(PACKAGE_NAME, PACKAGE_VERSION, resolvedConfig);\n this.instrumentationV2_V3 = new RedisInstrumentationV2_V3(this.getConfig());\n this.instrumentationV4_V5 = new RedisInstrumentationV4_V5(this.getConfig());\n this.initialized = true;\n }\n\n override setConfig(config: RedisInstrumentationConfig = {}): void {\n const newConfig = { ...DEFAULT_CONFIG, ...config };\n super.setConfig(newConfig);\n if (!this.initialized) {\n return;\n }\n this.instrumentationV2_V3.setConfig(newConfig);\n this.instrumentationV4_V5.setConfig(newConfig);\n }\n\n init() {}\n\n override getModuleDefinitions() {\n return [...this.instrumentationV2_V3.getModuleDefinitions(), ...this.instrumentationV4_V5.getModuleDefinitions()];\n }\n\n override setTracerProvider(tracerProvider: TracerProvider): void {\n super.setTracerProvider(tracerProvider);\n if (!this.initialized) {\n return;\n }\n this.instrumentationV2_V3.setTracerProvider(tracerProvider);\n this.instrumentationV4_V5.setTracerProvider(tracerProvider);\n }\n\n override enable(): void {\n super.enable();\n if (!this.initialized) {\n return;\n }\n this.instrumentationV2_V3.enable();\n this.instrumentationV4_V5.enable();\n }\n\n override disable(): void {\n super.disable();\n if (!this.initialized) {\n return;\n }\n this.instrumentationV2_V3.disable();\n this.instrumentationV4_V5.disable();\n }\n}\n"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAkCA,MAAM,YAAA,GAAe,sCAAsC;AAC3D,MAAM,eAAA,GAAkB,QAAQ;;AAEhC;;AA6BA,MAAM,eAAA,GAAkB,MAAM,CAAC,gDAAgD,CAAC;AAChF,MAAM,qBAAA,GAAwB,MAAM,CAAC,2DAA2D,CAAC;;AAEjG;;AAEA,SAAS,gDAAgD;AACzD,EAAE,UAAU;AACZ,EAAE,GAAG;AACL,EAAsB;AACtB,EAAE,IAAI,OAAO,GAAA,KAAQ,QAAA,IAAY,CAAC,GAAG,EAAE;AACvC,IAAI,OAAO,SAAS;AACpB,EAAE;AACF,EAAE,IAAI;AACN,IAAI,MAAM,CAAA,GAAI,IAAI,GAAG,CAAC,GAAG,CAAC;AAC1B,IAAI,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC;AACrC,IAAI,CAAC,CAAC,QAAA,GAAW,EAAE;AACnB,IAAI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CAAA;AACA,EAAA;;AAEA,EAAA,IAAA,GAAA,CAAA;;AAEA,GAAA,oBAAA,GAAA;AACA,IAAA,OAAA,CAAA,GAAA,IAAA,CAAA,oBAAA,CAAA,oBAAA,EAAA,EAAA,GAAA,IAAA,CAAA,oBAAA,CAAA,oBAAA,EAAA,CAAA;AACA,EAAA;;AAEA,GAAA,iBAAA,CAAA,cAAA,EAAA;AACA,IAAA,KAAA,CAAA,iBAAA,CAAA,cAAA,CAAA;AACA,IAAA,IAAA,CAAA,IAAA,CAAA,WAAA,EAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA,IAAA,CAAA,oBAAA,CAAA,iBAAA,CAAA,cAAA,CAAA;AACA,IAAA,IAAA,CAAA,oBAAA,CAAA,iBAAA,CAAA,cAAA,CAAA;AACA,EAAA;;AAEA,GAAA,MAAA,GAAA;AACA,IAAA,KAAA,CAAA,MAAA,EAAA;AACA,IAAA,IAAA,CAAA,IAAA,CAAA,WAAA,EAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA,IAAA,CAAA,oBAAA,CAAA,MAAA,EAAA;AACA,IAAA,IAAA,CAAA,oBAAA,CAAA,MAAA,EAAA;AACA,EAAA;;AAEA,GAAA,OAAA,GAAA;AACA,IAAA,KAAA,CAAA,OAAA,EAAA;AACA,IAAA,IAAA,CAAA,IAAA,CAAA,WAAA,EAAA;AACA,MAAA;AACA,IAAA;AACA,IAAA,IAAA,CAAA,oBAAA,CAAA,OAAA,EAAA;AACA,IAAA,IAAA,CAAA,oBAAA,CAAA,OAAA,EAAA;AACA,EAAA;AACA;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright The OpenTelemetry Authors
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*
|
|
16
|
+
* NOTICE from the Sentry authors:
|
|
17
|
+
* - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/instrumentation-redis-v0.62.0/packages/instrumentation-redis
|
|
18
|
+
* - Upstream version: @opentelemetry/instrumentation-redis@0.62.0
|
|
19
|
+
* - Minor TypeScript adjustments for this repository's compiler settings
|
|
20
|
+
*/
|
|
21
|
+
/* eslint-disable -- vendored @opentelemetry/instrumentation-redis */
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
* This file contains a copy of unstable semantic convention definitions
|
|
25
|
+
* used by the vendored redis/ioredis instrumentations.
|
|
26
|
+
* @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
// Deprecated constants kept for backwards compatibility with older semconv
|
|
30
|
+
const ATTR_DB_CONNECTION_STRING = 'db.connection_string';
|
|
31
|
+
const ATTR_DB_STATEMENT = 'db.statement';
|
|
32
|
+
const ATTR_DB_SYSTEM = 'db.system';
|
|
33
|
+
const ATTR_NET_PEER_NAME = 'net.peer.name';
|
|
34
|
+
const ATTR_NET_PEER_PORT = 'net.peer.port';
|
|
35
|
+
const DB_SYSTEM_NAME_VALUE_REDIS = 'redis';
|
|
36
|
+
const DB_SYSTEM_VALUE_REDIS = 'redis';
|
|
37
|
+
|
|
38
|
+
export { ATTR_DB_CONNECTION_STRING, ATTR_DB_STATEMENT, ATTR_DB_SYSTEM, ATTR_NET_PEER_NAME, ATTR_NET_PEER_PORT, DB_SYSTEM_NAME_VALUE_REDIS, DB_SYSTEM_VALUE_REDIS };
|
|
39
|
+
//# sourceMappingURL=semconv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semconv.js","sources":["../../../../../../src/integrations/tracing/redis/vendored/semconv.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/instrumentation-redis-v0.62.0/packages/instrumentation-redis\n * - Upstream version: @opentelemetry/instrumentation-redis@0.62.0\n * - Minor TypeScript adjustments for this repository's compiler settings\n */\n/* eslint-disable -- vendored @opentelemetry/instrumentation-redis */\n\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by the vendored redis/ioredis instrumentations.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n\n// Deprecated constants kept for backwards compatibility with older semconv\nexport const ATTR_DB_CONNECTION_STRING = 'db.connection_string';\nexport const ATTR_DB_STATEMENT = 'db.statement';\nexport const ATTR_DB_SYSTEM = 'db.system';\nexport const ATTR_NET_PEER_NAME = 'net.peer.name';\nexport const ATTR_NET_PEER_PORT = 'net.peer.port';\nexport const DB_SYSTEM_NAME_VALUE_REDIS = 'redis';\nexport const DB_SYSTEM_VALUE_REDIS = 'redis';\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACO,MAAM,yBAAA,GAA4B;AAClC,MAAM,iBAAA,GAAoB;AAC1B,MAAM,cAAA,GAAiB;AACvB,MAAM,kBAAA,GAAqB;AAC3B,MAAM,kBAAA,GAAqB;AAC3B,MAAM,0BAAA,GAA6B;AACnC,MAAM,qBAAA,GAAwB;;;;"}
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"10.
|
|
1
|
+
{"type":"module","version":"10.53.0","sideEffects":false}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redisCache.js","sources":["../../../src/utils/redisCache.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"redisCache.js","sources":["../../../src/utils/redisCache.ts"],"sourcesContent":["export type IORedisCommandArgs = Array<string | Buffer | number | unknown[]>;\n\nconst SINGLE_ARG_COMMANDS = ['get', 'set', 'setex'];\n\nexport const GET_COMMANDS = ['get', 'mget'];\nexport const SET_COMMANDS = ['set', 'setex'];\n// todo: del, expire\n\n/** Checks if a given command is in the list of redis commands.\n * Useful because commands can come in lowercase or uppercase (depending on the library). */\nexport function isInCommands(redisCommands: string[], command: string): boolean {\n return redisCommands.includes(command.toLowerCase());\n}\n\n/** Determine cache operation based on redis statement */\nexport function getCacheOperation(\n command: string,\n): 'cache.get' | 'cache.put' | 'cache.remove' | 'cache.flush' | undefined {\n if (isInCommands(GET_COMMANDS, command)) {\n return 'cache.get';\n } else if (isInCommands(SET_COMMANDS, command)) {\n return 'cache.put';\n } else {\n return undefined;\n }\n}\n\nfunction keyHasPrefix(key: string, prefixes: string[]): boolean {\n return prefixes.some(prefix => key.startsWith(prefix));\n}\n\n/** Safely converts a redis key to a string (comma-separated if there are multiple keys) */\nexport function getCacheKeySafely(redisCommand: string, cmdArgs: IORedisCommandArgs): string[] | undefined {\n try {\n if (cmdArgs.length === 0) {\n return undefined;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const processArg = (arg: string | Buffer | number | any[]): string[] => {\n if (typeof arg === 'string' || typeof arg === 'number' || Buffer.isBuffer(arg)) {\n return [arg.toString()];\n } else if (Array.isArray(arg)) {\n return flatten(arg.map(arg => processArg(arg)));\n } else {\n return ['<unknown>'];\n }\n };\n\n const firstArg = cmdArgs[0];\n if (isInCommands(SINGLE_ARG_COMMANDS, redisCommand) && firstArg != null) {\n return processArg(firstArg);\n }\n\n return flatten(cmdArgs.map(arg => processArg(arg)));\n } catch {\n return undefined;\n }\n}\n\n/** Determines whether a redis operation should be considered as \"cache operation\" by checking if a key is prefixed.\n * We only support certain commands (such as 'set', 'get', 'mget'). */\nexport function shouldConsiderForCache(redisCommand: string, keys: string[], prefixes: string[]): boolean {\n if (!getCacheOperation(redisCommand)) {\n return false;\n }\n\n for (const key of keys) {\n if (keyHasPrefix(key, prefixes)) {\n return true;\n }\n }\n return false;\n}\n\n/** Calculates size based on the cache response value */\nexport function calculateCacheItemSize(response: unknown): number | undefined {\n const getSize = (value: unknown): number | undefined => {\n try {\n if (Buffer.isBuffer(value)) return value.byteLength;\n else if (typeof value === 'string') return value.length;\n else if (typeof value === 'number') return value.toString().length;\n else if (value === null || value === undefined) return 0;\n return JSON.stringify(value).length;\n } catch {\n return undefined;\n }\n };\n\n return Array.isArray(response)\n ? response.reduce((acc: number | undefined, curr) => {\n const size = getSize(curr);\n return typeof size === 'number' ? (acc !== undefined ? acc + size : size) : acc;\n }, 0)\n : getSize(response);\n}\n\ntype NestedArray<T> = Array<NestedArray<T> | T>;\n\nfunction flatten<T>(input: NestedArray<T>): T[] {\n const result: T[] = [];\n\n const flattenHelper = (input: NestedArray<T>): void => {\n input.forEach((el: T | NestedArray<T>) => {\n if (Array.isArray(el)) {\n flattenHelper(el);\n } else {\n result.push(el);\n }\n });\n };\n\n flattenHelper(input);\n return result;\n}\n"],"names":[],"mappings":"AAEA,MAAM,mBAAA,GAAsB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC;;MAEtC,YAAA,GAAe,CAAC,KAAK,EAAE,MAAM;MAC7B,YAAA,GAAe,CAAC,KAAK,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CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,MAAM;AACzC,IAAI,EAAE,MAAM;AACZ,MAAM,OAAO,SAAS;AACtB,IAAI;AACJ,EAAE,CAAC;;AAEH,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ;AAC/B,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAsB,IAAI,KAAK;AACzD,QAAQ,MAAM,IAAA,GAAO,OAAO,CAAC,IAAI,CAAC;AAClC,QAAQ,OAAO,OAAO,IAAA,KAAS,QAAA,IAAY,GAAA,KAAQ,SAAA,GAAY,MAAM,IAAA,GAAO,IAAI,IAAI,GAAG;AACvF,MAAM,CAAC,EAAE,CAAC;AACV,MAAM,OAAO,CAAC,QAAQ,CAAC;AACvB;;AAIA,SAAS,OAAO,CAAI,KAAK,EAAuB;AAChD,EAAE,MAAM,MAAM,GAAQ,EAAE;;AAExB,EAAE,MAAM,aAAA,GAAgB,CAAC,KAAK,KAA2B;AACzD,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,KAAyB;AAC9C,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE;AAC7B,QAAQ,aAAa,CAAC,EAAE,CAAC;AACzB,MAAM,OAAO;AACb,QAAQ,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;AACvB,MAAM;AACN,IAAI,CAAC,CAAC;AACN,EAAE,CAAC;;AAEH,EAAE,aAAa,CAAC,KAAK,CAAC;AACtB,EAAE,OAAO,MAAM;AACf;;;;"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type { HTTPModuleRequestIncomingMessage, SentryHttpInstrumentationOptions } from '@sentry/node-core';
|
|
5
|
-
import type { NodeClientOptions } from '../types';
|
|
1
|
+
import type { RequestOptions } from 'node:http';
|
|
2
|
+
import type { HttpClientRequest, HttpIncomingMessage, HttpServerResponse, Span } from '@sentry/core';
|
|
3
|
+
import type { SentryHttpInstrumentationOptions } from '@sentry/node-core';
|
|
6
4
|
interface HttpOptions {
|
|
7
5
|
/**
|
|
8
6
|
* Whether breadcrumbs should be recorded for outgoing requests.
|
|
@@ -61,12 +59,12 @@ interface HttpOptions {
|
|
|
61
59
|
* The `request` param contains the original {@type IncomingMessage} object of the incoming request.
|
|
62
60
|
* You can use it to filter on additional properties like method, headers, etc.
|
|
63
61
|
*/
|
|
64
|
-
ignoreIncomingRequests?: (urlPath: string, request:
|
|
62
|
+
ignoreIncomingRequests?: (urlPath: string, request: HttpIncomingMessage) => boolean;
|
|
65
63
|
/**
|
|
66
64
|
* A hook that can be used to mutate the span for incoming requests.
|
|
67
65
|
* This is triggered after the span is created, but before it is recorded.
|
|
68
66
|
*/
|
|
69
|
-
incomingRequestSpanHook?: (span: Span, request:
|
|
67
|
+
incomingRequestSpanHook?: (span: Span, request: HttpIncomingMessage, response: HttpServerResponse) => void;
|
|
70
68
|
/**
|
|
71
69
|
* Whether to automatically ignore common static asset requests like favicon.ico, robots.txt, etc.
|
|
72
70
|
* This helps reduce noise in your transactions.
|
|
@@ -114,19 +112,14 @@ interface HttpOptions {
|
|
|
114
112
|
* Additional instrumentation options that are passed to the underlying HttpInstrumentation.
|
|
115
113
|
*/
|
|
116
114
|
instrumentation?: {
|
|
117
|
-
requestHook?: (span: Span, req:
|
|
118
|
-
responseHook?: (span: Span, response:
|
|
119
|
-
applyCustomAttributesOnSpan?: (span: Span, request:
|
|
115
|
+
requestHook?: (span: Span, req: HttpIncomingMessage | HttpClientRequest) => void;
|
|
116
|
+
responseHook?: (span: Span, response: HttpIncomingMessage | HttpServerResponse) => void;
|
|
117
|
+
applyCustomAttributesOnSpan?: (span: Span, request: HttpIncomingMessage | HttpClientRequest, response: HttpIncomingMessage | HttpServerResponse) => void;
|
|
120
118
|
};
|
|
121
119
|
}
|
|
122
120
|
export declare const instrumentSentryHttp: ((options?: SentryHttpInstrumentationOptions | undefined) => import("@opentelemetry/instrumentation").Instrumentation<import("@opentelemetry/instrumentation").InstrumentationConfig>) & {
|
|
123
121
|
id: string;
|
|
124
122
|
};
|
|
125
|
-
export declare const instrumentOtelHttp: ((options?: HttpInstrumentationConfig | undefined) => import("@opentelemetry/instrumentation").Instrumentation<import("@opentelemetry/instrumentation").InstrumentationConfig>) & {
|
|
126
|
-
id: string;
|
|
127
|
-
};
|
|
128
|
-
/** Exported only for tests. */
|
|
129
|
-
export declare function _shouldUseOtelHttpInstrumentation(options: HttpOptions, clientOptions?: Partial<NodeClientOptions>): boolean;
|
|
130
123
|
/**
|
|
131
124
|
* The http integration instruments Node's internal http and https modules.
|
|
132
125
|
* It creates breadcrumbs and spans for outgoing HTTP requests which will be attached to the currently active span.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/integrations/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/integrations/http.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAQrG,OAAO,KAAK,EAEV,gCAAgC,EAGjC,MAAM,mBAAmB,CAAC;AAY3B,UAAU,WAAW;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;;;;OAKG;IACH,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAE1C;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;;;;;;;OAQG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;;;;;OASG;IACH,sBAAsB,CAAC,EAAE,CAAC,GAAG,EAAE,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2EAuE1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA8BhD;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,WAAW,EAAE,CAgC9D;AAED;;GAEG;AAEH,wBAAgB,wCAAwC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AA8BhD;;GAEG;AACH,wBAAgB,8BAA8B,IAAI,WAAW,EAAE,CAgC9D;AAED;;GAEG;AAEH,wBAAgB,wCAAwC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,EAAE,CAgCzG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IORedisResponseCustomAttributeFunction } from './vendored/types';
|
|
2
2
|
interface RedisOptions {
|
|
3
3
|
/**
|
|
4
4
|
* Define cache prefixes for cache keys that should be captured as a cache span.
|
|
@@ -16,7 +16,7 @@ interface RedisOptions {
|
|
|
16
16
|
maxCacheKeyLength?: number;
|
|
17
17
|
}
|
|
18
18
|
export declare let _redisOptions: RedisOptions;
|
|
19
|
-
export declare const cacheResponseHook:
|
|
19
|
+
export declare const cacheResponseHook: IORedisResponseCustomAttributeFunction;
|
|
20
20
|
/** To be able to preload all Redis OTel instrumentations with just one ID ("Redis"), all the instrumentations are generated in this one function */
|
|
21
21
|
export declare const instrumentRedis: (() => void) & {
|
|
22
22
|
id: string;
|
|
@@ -38,4 +38,4 @@ export declare const instrumentRedis: (() => void) & {
|
|
|
38
38
|
*/
|
|
39
39
|
export declare const redisIntegration: (options?: RedisOptions | undefined) => import("@sentry/core").Integration;
|
|
40
40
|
export {};
|
|
41
|
-
//# sourceMappingURL=
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/redis/index.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,kBAAkB,CAAC;AAK/E,UAAU,YAAY;IACpB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAKD,eAAO,IAAI,aAAa,EAAE,YAAiB,CAAC;AAG5C,eAAO,MAAM,iBAAiB,EAAE,sCAoD/B,CAAC;AAcF,qJAAqJ;AACrJ,eAAO,MAAM,eAAe,SACtB,IAAI;;CAaT,CAAC;AAYF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,gBAAgB,4EAAuC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InstrumentationBase, InstrumentationNodeModuleDefinition, SemconvStability } from '@opentelemetry/instrumentation';
|
|
2
|
+
import type { IORedisInstrumentationConfig } from './types';
|
|
3
|
+
export declare class IORedisInstrumentation extends InstrumentationBase<IORedisInstrumentationConfig> {
|
|
4
|
+
_netSemconvStability: SemconvStability;
|
|
5
|
+
_dbSemconvStability: SemconvStability;
|
|
6
|
+
constructor(config?: IORedisInstrumentationConfig);
|
|
7
|
+
_setSemconvStabilityFromEnv(): void;
|
|
8
|
+
setConfig(config?: IORedisInstrumentationConfig): void;
|
|
9
|
+
init(): InstrumentationNodeModuleDefinition[];
|
|
10
|
+
private _patchSendCommand;
|
|
11
|
+
private _patchConnection;
|
|
12
|
+
private _traceSendCommand;
|
|
13
|
+
private _traceConnection;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=ioredis-instrumentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ioredis-instrumentation.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/redis/vendored/ioredis-instrumentation.ts"],"names":[],"mappings":"AAyBA,OAAO,EACL,mBAAmB,EACnB,mCAAmC,EAGnC,gBAAgB,EAEjB,MAAM,gCAAgC,CAAC;AAkBxC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAwB5D,qBAAa,sBAAuB,SAAQ,mBAAmB,CAAC,4BAA4B,CAAC;IAC3F,oBAAoB,EAAG,gBAAgB,CAAC;IACxC,mBAAmB,EAAG,gBAAgB,CAAC;gBAE3B,MAAM,GAAE,4BAAiC;IAKrD,2BAA2B,IAAI,IAAI;IAK1B,SAAS,CAAC,MAAM,GAAE,4BAAiC,GAAG,IAAI;IAInE,IAAI;IAiCJ,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,iBAAiB;IAmFzB,OAAO,CAAC,gBAAgB;CAqDzB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given the redis command name and arguments, return a combination of the
|
|
3
|
+
* command name + the allowed arguments according to `serializationSubsets`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const defaultDbStatementSerializer: (cmdName: string, cmdArgs: Array<string | Buffer | number | any[]>) => string;
|
|
6
|
+
//# sourceMappingURL=redis-common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis-common.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/redis/vendored/redis-common.ts"],"names":[],"mappings":"AAkDA;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GACvC,SAAS,MAAM,EACf,SAAS,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,GAAG,EAAE,CAAC,KAC/C,MAWF,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { TracerProvider } from '@opentelemetry/api';
|
|
2
|
+
import { InstrumentationBase } from '@opentelemetry/instrumentation';
|
|
3
|
+
import type { RedisInstrumentationConfig } from './types';
|
|
4
|
+
export declare class RedisInstrumentation extends InstrumentationBase<RedisInstrumentationConfig> {
|
|
5
|
+
private instrumentationV2_V3;
|
|
6
|
+
private instrumentationV4_V5;
|
|
7
|
+
private initialized;
|
|
8
|
+
constructor(config?: RedisInstrumentationConfig);
|
|
9
|
+
setConfig(config?: RedisInstrumentationConfig): void;
|
|
10
|
+
init(): void;
|
|
11
|
+
getModuleDefinitions(): import("@opentelemetry/instrumentation").InstrumentationModuleDefinition[];
|
|
12
|
+
setTracerProvider(tracerProvider: TracerProvider): void;
|
|
13
|
+
enable(): void;
|
|
14
|
+
disable(): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=redis-instrumentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redis-instrumentation.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/redis/vendored/redis-instrumentation.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAoB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE3E,OAAO,EACL,mBAAmB,EAOpB,MAAM,gCAAgC,CAAC;AAmBxC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAC;AAmnB1D,qBAAa,oBAAqB,SAAQ,mBAAmB,CAAC,0BAA0B,CAAC;IACvF,OAAO,CAAC,oBAAoB,CAA4B;IACxD,OAAO,CAAC,oBAAoB,CAA4B;IACxD,OAAO,CAAC,WAAW,CAAS;gBAEhB,MAAM,GAAE,0BAA+B;IAQ1C,SAAS,CAAC,MAAM,GAAE,0BAA+B,GAAG,IAAI;IAUjE,IAAI;IAEK,oBAAoB;IAIpB,iBAAiB,CAAC,cAAc,EAAE,cAAc,GAAG,IAAI;IASvD,MAAM,IAAI,IAAI;IASd,OAAO,IAAI,IAAI;CAQzB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const ATTR_DB_CONNECTION_STRING = "db.connection_string";
|
|
2
|
+
export declare const ATTR_DB_STATEMENT = "db.statement";
|
|
3
|
+
export declare const ATTR_DB_SYSTEM = "db.system";
|
|
4
|
+
export declare const ATTR_NET_PEER_NAME = "net.peer.name";
|
|
5
|
+
export declare const ATTR_NET_PEER_PORT = "net.peer.port";
|
|
6
|
+
export declare const DB_SYSTEM_NAME_VALUE_REDIS = "redis";
|
|
7
|
+
export declare const DB_SYSTEM_VALUE_REDIS = "redis";
|
|
8
|
+
//# sourceMappingURL=semconv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semconv.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/redis/vendored/semconv.ts"],"names":[],"mappings":"AA6BA,eAAO,MAAM,yBAAyB,yBAAyB,CAAC;AAChE,eAAO,MAAM,iBAAiB,iBAAiB,CAAC;AAChD,eAAO,MAAM,cAAc,cAAc,CAAC;AAC1C,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAClD,eAAO,MAAM,kBAAkB,kBAAkB,CAAC;AAClD,eAAO,MAAM,0BAA0B,UAAU,CAAC;AAClD,eAAO,MAAM,qBAAqB,UAAU,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { Span } from '@opentelemetry/api';
|
|
2
|
+
import type { InstrumentationConfig, SemconvStability } from '@opentelemetry/instrumentation';
|
|
3
|
+
/**
|
|
4
|
+
* Function that can be used to serialize db.statement tag
|
|
5
|
+
* @param cmdName - The name of the command (eg. set, get, mset)
|
|
6
|
+
* @param cmdArgs - Array of arguments passed to the command
|
|
7
|
+
* @returns serialized string that will be used as the db.statement attribute.
|
|
8
|
+
*/
|
|
9
|
+
export type DbStatementSerializer = (cmdName: string, cmdArgs: Array<string | Buffer>) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Function that can be used to add custom attributes to span on response from redis server
|
|
12
|
+
*/
|
|
13
|
+
export interface RedisResponseCustomAttributeFunction {
|
|
14
|
+
(span: Span, cmdName: string, cmdArgs: Array<string | Buffer>, response: unknown): void;
|
|
15
|
+
}
|
|
16
|
+
export interface RedisInstrumentationConfig extends InstrumentationConfig {
|
|
17
|
+
/** Custom serializer function for the db.statement tag */
|
|
18
|
+
dbStatementSerializer?: DbStatementSerializer;
|
|
19
|
+
/** Function for adding custom attributes on db response */
|
|
20
|
+
responseHook?: RedisResponseCustomAttributeFunction;
|
|
21
|
+
/** Require parent to create redis span, default when unset is false */
|
|
22
|
+
requireParentSpan?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Controls which semantic-convention attributes are emitted on spans.
|
|
25
|
+
* Default: 'OLD'.
|
|
26
|
+
*/
|
|
27
|
+
semconvStability?: SemconvStability;
|
|
28
|
+
}
|
|
29
|
+
export type CommandArgs = Array<string | Buffer | number | any[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Function that can be used to serialize db.statement tag for ioredis
|
|
32
|
+
*/
|
|
33
|
+
export type IORedisDbStatementSerializer = (cmdName: string, cmdArgs: CommandArgs) => string;
|
|
34
|
+
export interface IORedisRequestHookInformation {
|
|
35
|
+
moduleVersion?: string;
|
|
36
|
+
cmdName: string;
|
|
37
|
+
cmdArgs: CommandArgs;
|
|
38
|
+
}
|
|
39
|
+
export interface RedisRequestCustomAttributeFunction {
|
|
40
|
+
(span: Span, requestInfo: IORedisRequestHookInformation): void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Function that can be used to add custom attributes to span on response from redis server (ioredis)
|
|
44
|
+
*/
|
|
45
|
+
export interface IORedisResponseCustomAttributeFunction {
|
|
46
|
+
(span: Span, cmdName: string, cmdArgs: CommandArgs, response: unknown): void;
|
|
47
|
+
}
|
|
48
|
+
export interface IORedisInstrumentationConfig extends InstrumentationConfig {
|
|
49
|
+
/** Custom serializer function for the db.statement tag */
|
|
50
|
+
dbStatementSerializer?: IORedisDbStatementSerializer;
|
|
51
|
+
/** Function for adding custom attributes on db request */
|
|
52
|
+
requestHook?: RedisRequestCustomAttributeFunction;
|
|
53
|
+
/** Function for adding custom attributes on db response */
|
|
54
|
+
responseHook?: IORedisResponseCustomAttributeFunction;
|
|
55
|
+
/** Require parent to create ioredis span, default when unset is true */
|
|
56
|
+
requireParentSpan?: boolean;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/redis/vendored/types.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAI9F;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAC;AAEjG;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACnD,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;CACzF;AAED,MAAM,WAAW,0BAA2B,SAAQ,qBAAqB;IACvE,0DAA0D;IAC1D,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,2DAA2D;IAC3D,YAAY,CAAC,EAAE,oCAAoC,CAAC;IACpD,uEAAuE;IACvE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC;AAID,MAAM,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,GAAG,EAAE,CAAC,CAAC;AAElE;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,KAAK,MAAM,CAAC;AAE7F,MAAM,WAAW,6BAA6B;IAC5C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,mCAAmC;IAClD,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,6BAA6B,GAAG,IAAI,CAAC;CAChE;AAED;;GAEG;AACH,MAAM,WAAW,sCAAsC;IACrD,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9E;AAED,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IACzE,0DAA0D;IAC1D,qBAAqB,CAAC,EAAE,4BAA4B,CAAC;IACrD,0DAA0D;IAC1D,WAAW,CAAC,EAAE,mCAAmC,CAAC;IAClD,2DAA2D;IAC3D,YAAY,CAAC,EAAE,sCAAsC,CAAC;IACtD,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export type IORedisCommandArgs = Array<string | Buffer | number | unknown[]>;
|
|
2
2
|
export declare const GET_COMMANDS: string[];
|
|
3
3
|
export declare const SET_COMMANDS: string[];
|
|
4
4
|
/** Checks if a given command is in the list of redis commands.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redisCache.d.ts","sourceRoot":"","sources":["../../../src/utils/redisCache.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"redisCache.d.ts","sourceRoot":"","sources":["../../../src/utils/redisCache.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,EAAE,CAAC,CAAC;AAI7E,eAAO,MAAM,YAAY,UAAkB,CAAC;AAC5C,eAAO,MAAM,YAAY,UAAmB,CAAC;AAG7C;6FAC6F;AAC7F,wBAAgB,YAAY,CAAC,aAAa,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAE9E;AAED,yDAAyD;AACzD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,GACd,WAAW,GAAG,WAAW,GAAG,cAAc,GAAG,aAAa,GAAG,SAAS,CAQxE;AAMD,2FAA2F;AAC3F,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,MAAM,EAAE,GAAG,SAAS,CA0BzG;AAED;uEACuE;AACvE,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAWxG;AAED,wDAAwD;AACxD,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAmB5E"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { HTTPModuleRequestIncomingMessage, SentryHttpInstrumentationOptions } from '@sentry/node-core';
|
|
5
|
-
import { NodeClientOptions } from '../types';
|
|
1
|
+
import { RequestOptions } from 'node:http';
|
|
2
|
+
import { HttpClientRequest, HttpIncomingMessage, HttpServerResponse, Span } from '@sentry/core';
|
|
3
|
+
import { SentryHttpInstrumentationOptions } from '@sentry/node-core';
|
|
6
4
|
interface HttpOptions {
|
|
7
5
|
/**
|
|
8
6
|
* Whether breadcrumbs should be recorded for outgoing requests.
|
|
@@ -61,12 +59,12 @@ interface HttpOptions {
|
|
|
61
59
|
* The `request` param contains the original {@type IncomingMessage} object of the incoming request.
|
|
62
60
|
* You can use it to filter on additional properties like method, headers, etc.
|
|
63
61
|
*/
|
|
64
|
-
ignoreIncomingRequests?: (urlPath: string, request:
|
|
62
|
+
ignoreIncomingRequests?: (urlPath: string, request: HttpIncomingMessage) => boolean;
|
|
65
63
|
/**
|
|
66
64
|
* A hook that can be used to mutate the span for incoming requests.
|
|
67
65
|
* This is triggered after the span is created, but before it is recorded.
|
|
68
66
|
*/
|
|
69
|
-
incomingRequestSpanHook?: (span: Span, request:
|
|
67
|
+
incomingRequestSpanHook?: (span: Span, request: HttpIncomingMessage, response: HttpServerResponse) => void;
|
|
70
68
|
/**
|
|
71
69
|
* Whether to automatically ignore common static asset requests like favicon.ico, robots.txt, etc.
|
|
72
70
|
* This helps reduce noise in your transactions.
|
|
@@ -117,19 +115,14 @@ interface HttpOptions {
|
|
|
117
115
|
* Additional instrumentation options that are passed to the underlying HttpInstrumentation.
|
|
118
116
|
*/
|
|
119
117
|
instrumentation?: {
|
|
120
|
-
requestHook?: (span: Span, req:
|
|
121
|
-
responseHook?: (span: Span, response:
|
|
122
|
-
applyCustomAttributesOnSpan?: (span: Span, request:
|
|
118
|
+
requestHook?: (span: Span, req: HttpIncomingMessage | HttpClientRequest) => void;
|
|
119
|
+
responseHook?: (span: Span, response: HttpIncomingMessage | HttpServerResponse) => void;
|
|
120
|
+
applyCustomAttributesOnSpan?: (span: Span, request: HttpIncomingMessage | HttpClientRequest, response: HttpIncomingMessage | HttpServerResponse) => void;
|
|
123
121
|
};
|
|
124
122
|
}
|
|
125
123
|
export declare const instrumentSentryHttp: ((options?: SentryHttpInstrumentationOptions | undefined) => import("@opentelemetry/instrumentation").Instrumentation<import("@opentelemetry/instrumentation").InstrumentationConfig>) & {
|
|
126
124
|
id: string;
|
|
127
125
|
};
|
|
128
|
-
export declare const instrumentOtelHttp: ((options?: HttpInstrumentationConfig | undefined) => import("@opentelemetry/instrumentation").Instrumentation<import("@opentelemetry/instrumentation").InstrumentationConfig>) & {
|
|
129
|
-
id: string;
|
|
130
|
-
};
|
|
131
|
-
/** Exported only for tests. */
|
|
132
|
-
export declare function _shouldUseOtelHttpInstrumentation(options: HttpOptions, clientOptions?: Partial<NodeClientOptions>): boolean;
|
|
133
126
|
/**
|
|
134
127
|
* The http integration instruments Node's internal http and https modules.
|
|
135
128
|
* It creates breadcrumbs and spans for outgoing HTTP requests which will be attached to the currently active span.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IORedisResponseCustomAttributeFunction } from './vendored/types';
|
|
2
2
|
interface RedisOptions {
|
|
3
3
|
/**
|
|
4
4
|
* Define cache prefixes for cache keys that should be captured as a cache span.
|
|
@@ -16,7 +16,7 @@ interface RedisOptions {
|
|
|
16
16
|
maxCacheKeyLength?: number;
|
|
17
17
|
}
|
|
18
18
|
export declare let _redisOptions: RedisOptions;
|
|
19
|
-
export declare const cacheResponseHook:
|
|
19
|
+
export declare const cacheResponseHook: IORedisResponseCustomAttributeFunction;
|
|
20
20
|
/** To be able to preload all Redis OTel instrumentations with just one ID ("Redis"), all the instrumentations are generated in this one function */
|
|
21
21
|
export declare const instrumentRedis: (() => void) & {
|
|
22
22
|
id: string;
|
|
@@ -38,4 +38,4 @@ export declare const instrumentRedis: (() => void) & {
|
|
|
38
38
|
*/
|
|
39
39
|
export declare const redisIntegration: (options?: RedisOptions | undefined) => import("@sentry/core").Integration;
|
|
40
40
|
export {};
|
|
41
|
-
//# sourceMappingURL=
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InstrumentationBase, InstrumentationNodeModuleDefinition, SemconvStability } from '@opentelemetry/instrumentation';
|
|
2
|
+
import { IORedisInstrumentationConfig } from './types';
|
|
3
|
+
export declare class IORedisInstrumentation extends InstrumentationBase<IORedisInstrumentationConfig> {
|
|
4
|
+
_netSemconvStability: SemconvStability;
|
|
5
|
+
_dbSemconvStability: SemconvStability;
|
|
6
|
+
constructor(config?: IORedisInstrumentationConfig);
|
|
7
|
+
_setSemconvStabilityFromEnv(): void;
|
|
8
|
+
setConfig(config?: IORedisInstrumentationConfig): void;
|
|
9
|
+
init(): InstrumentationNodeModuleDefinition[];
|
|
10
|
+
private _patchSendCommand;
|
|
11
|
+
private _patchConnection;
|
|
12
|
+
private _traceSendCommand;
|
|
13
|
+
private _traceConnection;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=ioredis-instrumentation.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Given the redis command name and arguments, return a combination of the
|
|
3
|
+
* command name + the allowed arguments according to `serializationSubsets`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const defaultDbStatementSerializer: (cmdName: string, cmdArgs: Array<string | Buffer | number | any[]>) => string;
|
|
6
|
+
//# sourceMappingURL=redis-common.d.ts.map
|