@sentry/node 10.57.0 → 10.58.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 (39) hide show
  1. package/build/cjs/integrations/tracing/dataloader/index.js +2 -22
  2. package/build/cjs/integrations/tracing/dataloader/index.js.map +1 -1
  3. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js +93 -120
  4. package/build/cjs/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -1
  5. package/build/cjs/integrations/tracing/genericPool/index.js +1 -1
  6. package/build/cjs/integrations/tracing/genericPool/index.js.map +1 -1
  7. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js +14 -26
  8. package/build/cjs/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -1
  9. package/build/cjs/integrations/tracing/redis/index.js +1 -1
  10. package/build/cjs/integrations/tracing/redis/index.js.map +1 -1
  11. package/build/esm/integrations/tracing/dataloader/index.js +4 -24
  12. package/build/esm/integrations/tracing/dataloader/index.js.map +1 -1
  13. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js +95 -122
  14. package/build/esm/integrations/tracing/dataloader/vendored/instrumentation.js.map +1 -1
  15. package/build/esm/integrations/tracing/genericPool/index.js +1 -1
  16. package/build/esm/integrations/tracing/genericPool/index.js.map +1 -1
  17. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js +15 -27
  18. package/build/esm/integrations/tracing/genericPool/vendored/instrumentation.js.map +1 -1
  19. package/build/esm/integrations/tracing/redis/index.js +1 -1
  20. package/build/esm/integrations/tracing/redis/index.js.map +1 -1
  21. package/build/esm/package.json +1 -1
  22. package/build/types/integrations/tracing/dataloader/index.d.ts.map +1 -1
  23. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts +2 -5
  24. package/build/types/integrations/tracing/dataloader/vendored/instrumentation.d.ts.map +1 -1
  25. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts +20 -8
  26. package/build/types/integrations/tracing/dataloader/vendored/types.d.ts.map +1 -1
  27. package/build/types/integrations/tracing/genericPool/index.d.ts.map +1 -1
  28. package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +1 -1
  29. package/build/types/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts.map +1 -1
  30. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts +2 -1
  31. package/build/types/integrations/tracing/genericPool/vendored/instrumentation.d.ts.map +1 -1
  32. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/instrumentation.d.ts +2 -5
  33. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/types.d.ts +20 -8
  34. package/build/types-ts3.8/integrations/tracing/genericPool/vendored/generic-pool-types.d.ts +1 -1
  35. package/build/types-ts3.8/integrations/tracing/genericPool/vendored/instrumentation.d.ts +2 -1
  36. package/package.json +5 -5
  37. package/build/types/integrations/tracing/dataloader/vendored/dataloader-types.d.ts +0 -14
  38. package/build/types/integrations/tracing/dataloader/vendored/dataloader-types.d.ts.map +0 -1
  39. package/build/types-ts3.8/integrations/tracing/dataloader/vendored/dataloader-types.d.ts +0 -14
@@ -1,5 +1,5 @@
1
1
  import { defineIntegration, spanToJSON, SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, SEMANTIC_ATTRIBUTE_CACHE_HIT, SEMANTIC_ATTRIBUTE_CACHE_KEY, SEMANTIC_ATTRIBUTE_SENTRY_OP, truncate } from '@sentry/core';
2
- import { subscribeRedisDiagnosticChannels } from '@sentry-internal/server-utils';
2
+ import { subscribeRedisDiagnosticChannels } from '@sentry/server-utils';
3
3
  import { generateInstrumentOnce } from '@sentry/node-core';
4
4
  import { tracingChannel } from '@sentry/opentelemetry/tracing-channel';
5
5
  import { getCacheKeySafely, getCacheOperation, shouldConsiderForCache, calculateCacheItemSize, isInCommands, GET_COMMANDS } from '../../../utils/redisCache.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/redis/index.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { IntegrationFn } from '@sentry/core';\nimport {\n defineIntegration,\n SEMANTIC_ATTRIBUTE_CACHE_HIT,\n SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE,\n SEMANTIC_ATTRIBUTE_CACHE_KEY,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n spanToJSON,\n truncate,\n} from '@sentry/core';\nimport { subscribeRedisDiagnosticChannels } from '@sentry-internal/server-utils';\nimport { generateInstrumentOnce } from '@sentry/node-core';\nimport { tracingChannel as otelTracingChannel } from '@sentry/opentelemetry/tracing-channel';\nimport type { IORedisCommandArgs } from '../../../utils/redisCache';\nimport {\n calculateCacheItemSize,\n GET_COMMANDS,\n getCacheKeySafely,\n getCacheOperation,\n isInCommands,\n shouldConsiderForCache,\n} from '../../../utils/redisCache';\nimport type { IORedisResponseCustomAttributeFunction } from './vendored/types';\nimport { IORedisInstrumentation } from './vendored/ioredis-instrumentation';\nimport { RedisInstrumentation } from './vendored/redis-instrumentation';\n\ninterface RedisOptions {\n /**\n * Define cache prefixes for cache keys that should be captured as a cache span.\n *\n * Setting this to, for example, `['user:']` will capture cache keys that start with `user:`.\n */\n cachePrefixes?: string[];\n /**\n * Maximum length of the cache key added to the span description. If the key exceeds this length, it will be truncated.\n *\n * Passing `0` will use the full cache key without truncation.\n *\n * By default, the full cache key is used.\n */\n maxCacheKeyLength?: number;\n}\n\nconst INTEGRATION_NAME = 'Redis';\n\n/* Only exported for testing purposes */\nexport let _redisOptions: RedisOptions = {};\n\n/* Only exported for testing purposes */\nexport const cacheResponseHook: IORedisResponseCustomAttributeFunction = (\n span: Span,\n redisCommand: string,\n cmdArgs: IORedisCommandArgs,\n response: unknown,\n) => {\n const safeKey = getCacheKeySafely(redisCommand, cmdArgs);\n const cacheOperation = getCacheOperation(redisCommand);\n\n if (\n !safeKey ||\n !cacheOperation ||\n !_redisOptions.cachePrefixes ||\n !shouldConsiderForCache(redisCommand, safeKey, _redisOptions.cachePrefixes)\n ) {\n // not relevant for cache\n return;\n }\n\n // otel/ioredis seems to be using the old standard, as there was a change to those params: https://github.com/open-telemetry/opentelemetry-specification/issues/3199\n // We are using params based on the docs: https://opentelemetry.io/docs/specs/semconv/attributes-registry/network/\n // Fall back to stable semconv attributes (server.address/server.port) when\n // old-semconv ones are absent, eg OTEL_SEMCONV_STABILITY_OPT_IN=database\n // set for node-redis v4/v5.\n const spanData = spanToJSON(span).data;\n const networkPeerAddress = spanData['net.peer.name'] ?? spanData['server.address'];\n const networkPeerPort = spanData['net.peer.port'] ?? spanData['server.port'];\n if (networkPeerPort && networkPeerAddress) {\n span.setAttributes({ 'network.peer.address': networkPeerAddress, 'network.peer.port': networkPeerPort });\n }\n\n const cacheItemSize = calculateCacheItemSize(response);\n\n if (cacheItemSize) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, cacheItemSize);\n }\n\n if (isInCommands(GET_COMMANDS, redisCommand) && cacheItemSize !== undefined) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_HIT, cacheItemSize > 0);\n }\n\n span.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: cacheOperation,\n [SEMANTIC_ATTRIBUTE_CACHE_KEY]: safeKey,\n });\n\n // todo: change to string[] once EAP supports it\n const spanDescription = safeKey.join(', ');\n\n span.updateName(\n _redisOptions.maxCacheKeyLength ? truncate(spanDescription, _redisOptions.maxCacheKeyLength) : spanDescription,\n );\n};\n\nconst instrumentIORedis = generateInstrumentOnce(`${INTEGRATION_NAME}.IORedis`, () => {\n return new IORedisInstrumentation({\n responseHook: cacheResponseHook,\n });\n});\n\nconst instrumentRedisModule = generateInstrumentOnce(`${INTEGRATION_NAME}.Redis`, () => {\n return new RedisInstrumentation({\n responseHook: cacheResponseHook,\n });\n});\n\n/**\n * To be able to preload all Redis OTel instrumentations with just one ID\n * (\"Redis\"), all the instrumentations are generated in this one function\n */\nexport const instrumentRedis = Object.assign(\n (): void => {\n instrumentIORedis();\n instrumentRedisModule();\n // node-redis >= 5.12.0 and ioredis >= 5.11.0 publish via diagnostics_channel.\n // We pass `@sentry/opentelemetry/tracing-channel` as the factory so the span\n // becomes the active OTel context via `bindStore`. That factory needs the\n // Sentry OTel context manager to be registered, which `initOpenTelemetry()`\n // does after integration `setupOnce`, so defer to the next tick.\n void Promise.resolve().then(() => subscribeRedisDiagnosticChannels(otelTracingChannel, cacheResponseHook));\n\n // todo: implement them gradually\n // new LegacyRedisInstrumentation({}),\n },\n { id: INTEGRATION_NAME },\n);\n\nconst _redisIntegration = ((options: RedisOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n _redisOptions = options;\n instrumentRedis();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [redis](https://www.npmjs.com/package/redis) and\n * [ioredis](https://www.npmjs.com/package/ioredis) libraries.\n *\n * For more information, see the [`redisIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/redis/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.redisIntegration()],\n * });\n * ```\n */\nexport const redisIntegration = defineIntegration(_redisIntegration);\n"],"names":["otelTracingChannel"],"mappings":";;;;;;;;AA4CA,MAAM,gBAAA,GAAmB,OAAA;AAGlB,IAAI,gBAA8B;AAGlC,MAAM,iBAAA,GAA4D,CACvE,IAAA,EACA,YAAA,EACA,SACA,QAAA,KACG;AACH,EAAA,MAAM,OAAA,GAAU,iBAAA,CAAkB,YAAA,EAAc,OAAO,CAAA;AACvD,EAAA,MAAM,cAAA,GAAiB,kBAAkB,YAAY,CAAA;AAErD,EAAA,IACE,CAAC,OAAA,IACD,CAAC,cAAA,IACD,CAAC,aAAA,CAAc,aAAA,IACf,CAAC,sBAAA,CAAuB,YAAA,EAAc,OAAA,EAAS,aAAA,CAAc,aAAa,CAAA,EAC1E;AAEA,IAAA;AAAA,EACF;AAOA,EAAA,M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AAG,gBAAgB,UAAU,MAAM;AACtF,EAAA,OAAO,IAAI,oBAAA,CAAqB;AAAA,IAC9B,YAAA,EAAc;AAAA,GACf,CAAA;AACH,CAAC,CAAA;AAMM,MAAM,kBAAkB,MAAA,CAAO,MAAA;AAAA,EACpC,MAAY;AACV,IAAA,iBAAA,EAAkB;AAClB,IAAA,qBAAA,EAAsB;AAMtB,IAAA,KAAK,OAAA,CAAQ,SAAQ,CAAE,IAAA,CAAK,MAAM,gCAAA,CAAiCA,cAAA,EAAoB,iBAAiB,CAAC,CAAA;AAAA,EAI3G,CAAA;AAAA,EACA,EAAE,IAAI,gBAAA;AACR;AAEA,MAAM,iBAAA,IAAqB,CAAC,OAAA,GAAwB,EAAC,KAAM;AACzD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,aAAA,GAAgB,OAAA;AAChB,MAAA,eAAA,EAAgB;AAAA,IAClB;AAAA,GACF;AACF,CAAA,CAAA;AAiBO,MAAM,gBAAA,GAAmB,kBAAkB,iBAAiB;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/redis/index.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { IntegrationFn } from '@sentry/core';\nimport {\n defineIntegration,\n SEMANTIC_ATTRIBUTE_CACHE_HIT,\n SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE,\n SEMANTIC_ATTRIBUTE_CACHE_KEY,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n spanToJSON,\n truncate,\n} from '@sentry/core';\nimport { subscribeRedisDiagnosticChannels } from '@sentry/server-utils';\nimport { generateInstrumentOnce } from '@sentry/node-core';\nimport { tracingChannel as otelTracingChannel } from '@sentry/opentelemetry/tracing-channel';\nimport type { IORedisCommandArgs } from '../../../utils/redisCache';\nimport {\n calculateCacheItemSize,\n GET_COMMANDS,\n getCacheKeySafely,\n getCacheOperation,\n isInCommands,\n shouldConsiderForCache,\n} from '../../../utils/redisCache';\nimport type { IORedisResponseCustomAttributeFunction } from './vendored/types';\nimport { IORedisInstrumentation } from './vendored/ioredis-instrumentation';\nimport { RedisInstrumentation } from './vendored/redis-instrumentation';\n\ninterface RedisOptions {\n /**\n * Define cache prefixes for cache keys that should be captured as a cache span.\n *\n * Setting this to, for example, `['user:']` will capture cache keys that start with `user:`.\n */\n cachePrefixes?: string[];\n /**\n * Maximum length of the cache key added to the span description. If the key exceeds this length, it will be truncated.\n *\n * Passing `0` will use the full cache key without truncation.\n *\n * By default, the full cache key is used.\n */\n maxCacheKeyLength?: number;\n}\n\nconst INTEGRATION_NAME = 'Redis';\n\n/* Only exported for testing purposes */\nexport let _redisOptions: RedisOptions = {};\n\n/* Only exported for testing purposes */\nexport const cacheResponseHook: IORedisResponseCustomAttributeFunction = (\n span: Span,\n redisCommand: string,\n cmdArgs: IORedisCommandArgs,\n response: unknown,\n) => {\n const safeKey = getCacheKeySafely(redisCommand, cmdArgs);\n const cacheOperation = getCacheOperation(redisCommand);\n\n if (\n !safeKey ||\n !cacheOperation ||\n !_redisOptions.cachePrefixes ||\n !shouldConsiderForCache(redisCommand, safeKey, _redisOptions.cachePrefixes)\n ) {\n // not relevant for cache\n return;\n }\n\n // otel/ioredis seems to be using the old standard, as there was a change to those params: https://github.com/open-telemetry/opentelemetry-specification/issues/3199\n // We are using params based on the docs: https://opentelemetry.io/docs/specs/semconv/attributes-registry/network/\n // Fall back to stable semconv attributes (server.address/server.port) when\n // old-semconv ones are absent, eg OTEL_SEMCONV_STABILITY_OPT_IN=database\n // set for node-redis v4/v5.\n const spanData = spanToJSON(span).data;\n const networkPeerAddress = spanData['net.peer.name'] ?? spanData['server.address'];\n const networkPeerPort = spanData['net.peer.port'] ?? spanData['server.port'];\n if (networkPeerPort && networkPeerAddress) {\n span.setAttributes({ 'network.peer.address': networkPeerAddress, 'network.peer.port': networkPeerPort });\n }\n\n const cacheItemSize = calculateCacheItemSize(response);\n\n if (cacheItemSize) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE, cacheItemSize);\n }\n\n if (isInCommands(GET_COMMANDS, redisCommand) && cacheItemSize !== undefined) {\n span.setAttribute(SEMANTIC_ATTRIBUTE_CACHE_HIT, cacheItemSize > 0);\n }\n\n span.setAttributes({\n [SEMANTIC_ATTRIBUTE_SENTRY_OP]: cacheOperation,\n [SEMANTIC_ATTRIBUTE_CACHE_KEY]: safeKey,\n });\n\n // todo: change to string[] once EAP supports it\n const spanDescription = safeKey.join(', ');\n\n span.updateName(\n _redisOptions.maxCacheKeyLength ? truncate(spanDescription, _redisOptions.maxCacheKeyLength) : spanDescription,\n );\n};\n\nconst instrumentIORedis = generateInstrumentOnce(`${INTEGRATION_NAME}.IORedis`, () => {\n return new IORedisInstrumentation({\n responseHook: cacheResponseHook,\n });\n});\n\nconst instrumentRedisModule = generateInstrumentOnce(`${INTEGRATION_NAME}.Redis`, () => {\n return new RedisInstrumentation({\n responseHook: cacheResponseHook,\n });\n});\n\n/**\n * To be able to preload all Redis OTel instrumentations with just one ID\n * (\"Redis\"), all the instrumentations are generated in this one function\n */\nexport const instrumentRedis = Object.assign(\n (): void => {\n instrumentIORedis();\n instrumentRedisModule();\n // node-redis >= 5.12.0 and ioredis >= 5.11.0 publish via diagnostics_channel.\n // We pass `@sentry/opentelemetry/tracing-channel` as the factory so the span\n // becomes the active OTel context via `bindStore`. That factory needs the\n // Sentry OTel context manager to be registered, which `initOpenTelemetry()`\n // does after integration `setupOnce`, so defer to the next tick.\n void Promise.resolve().then(() => subscribeRedisDiagnosticChannels(otelTracingChannel, cacheResponseHook));\n\n // todo: implement them gradually\n // new LegacyRedisInstrumentation({}),\n },\n { id: INTEGRATION_NAME },\n);\n\nconst _redisIntegration = ((options: RedisOptions = {}) => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n _redisOptions = options;\n instrumentRedis();\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for the [redis](https://www.npmjs.com/package/redis) and\n * [ioredis](https://www.npmjs.com/package/ioredis) libraries.\n *\n * For more information, see the [`redisIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/redis/).\n *\n * @example\n * ```javascript\n * const Sentry = require('@sentry/node');\n *\n * Sentry.init({\n * integrations: [Sentry.redisIntegration()],\n * });\n * ```\n */\nexport const redisIntegration = defineIntegration(_redisIntegration);\n"],"names":["otelTracingChannel"],"mappings":";;;;;;;;AA4CA,MAAM,gBAAA,GAAmB,OAAA;AAGlB,IAAI,gBAA8B;AAGlC,MAAM,iBAAA,GAA4D,CACvE,IAAA,EACA,YAAA,EACA,SACA,QAAA,KACG;AACH,EAAA,MAAM,OAAA,GAAU,iBAAA,CAAkB,YAAA,EAAc,OAAO,CAAA;AACvD,EAAA,MAAM,cAAA,GAAiB,kBAAkB,YAAY,CAAA;AAErD,EAAA,IACE,CAAC,OAAA,IACD,CAAC,cAAA,IACD,CAAC,aAAA,CAAc,aAAA,IACf,CAAC,sBAAA,CAAuB,YAAA,EAAc,OAAA,EAAS,aAAA,CAAc,aAAa,CAAA,EAC1E;AAEA,IAAA;AAAA,EACF;AAOA,EAAA,MAAM,QAAA,GAAW,UAAA,CAAW,IAAI,CAAA,CAAE,IAAA;AAClC,EAAA,MAAM,kBAAA,GAAqB,QAAA,CAAS,eAAe,CAAA,IAAK,SAAS,gBAAgB,CAAA;AACjF,EAAA,MAAM,eAAA,GAAkB,QAAA,CAAS,eAAe,CAAA,IAAK,SAAS,aAAa,CAAA;AAC3E,EAAA,IAAI,mBAAmB,kBAAA,EAAoB;AACzC,IAAA,IAAA,CAAK,cAAc,EAAE,sBAAA,EAAwB,kBAAA,EAAoB,mBAAA,EAAqB,iBAAiB,CAAA;AAAA,EACzG;AAEA,EAAA,MAAM,aAAA,GAAgB,uBAAuB,QAAQ,CAAA;AAErD,EAAA,IAAI,aAAA,EAAe;AACjB,IAAA,IAAA,CAAK,YAAA,CAAa,oCAAoC,aAAa,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gBAAA;AAAA,IACN,SAAA,GAAY;AACV,MAAA,aAAA,GAAgB,OAAA;AAChB,MAAA,eAAA,EAAgB;AAAA,IAClB;AAAA,GACF;AACF,CAAA,CAAA;AAiBO,MAAM,gBAAA,GAAmB,kBAAkB,iBAAiB;;;;"}
@@ -1 +1 @@
1
- {"type":"module","version":"10.57.0","sideEffects":false}
1
+ {"type":"module","version":"10.58.0","sideEffects":false}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/dataloader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAYvE,eAAO,MAAM,oBAAoB;;CAMhC,CAAC;AAuCF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB,0CAA4C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/dataloader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAOvE,eAAO,MAAM,oBAAoB;;CAAkF,CAAC;AAWpH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB,0CAA4C,CAAC"}
@@ -1,10 +1,7 @@
1
1
  import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
2
- import { DataloaderInstrumentationConfig } from './types';
3
- export declare class DataloaderInstrumentation extends InstrumentationBase<DataloaderInstrumentationConfig> {
4
- constructor(config?: DataloaderInstrumentationConfig);
2
+ export declare class DataloaderInstrumentation extends InstrumentationBase {
3
+ constructor(config?: {});
5
4
  protected init(): InstrumentationNodeModuleDefinition[];
6
- private shouldCreateSpans;
7
- private getSpanName;
8
5
  private _wrapBatchLoadFn;
9
6
  private _getPatchedConstructor;
10
7
  private _patchLoad;
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/dataloader/vendored/instrumentation.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAa,MAAM,gCAAgC,CAAC;AAErH,OAAO,EAAE,+BAA+B,EAAE,MAAM,SAAS,CAAC;AAyB1D,qBAAa,yBAA0B,SAAQ,mBAAmB,CAAC,+BAA+B,CAAC;gBACrF,MAAM,GAAE,+BAAoC;IAIxD,SAAS,CAAC,IAAI;IA2Bd,OAAO,CAAC,iBAAiB;IAMzB,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,gBAAgB;IAuCxB,OAAO,CAAC,sBAAsB;IA0B9B,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,eAAe;IA+CvB,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,mBAAmB;IA0B3B,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,cAAc;IAQtB,OAAO,CAAC,mBAAmB;CAwB5B"}
1
+ {"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/dataloader/vendored/instrumentation.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAa,MAAM,gCAAgC,CAAC;AA8CrH,qBAAa,yBAA0B,SAAQ,mBAAmB;gBACpD,MAAM,KAAK;IAIvB,SAAS,CAAC,IAAI;IA2Bd,OAAO,CAAC,gBAAgB;IAwBxB,OAAO,CAAC,sBAAsB;IA4B9B,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,eAAe;IA6BvB,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,mBAAmB;IAiB3B,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,gBAAgB;IAiBxB,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,gBAAgB;IAiBxB,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,mBAAmB;CAgB5B"}
@@ -1,10 +1,22 @@
1
- import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
2
- export interface DataloaderInstrumentationConfig extends InstrumentationConfig {
3
- /**
4
- * Whether the instrumentation requires a parent span, if set to true
5
- * and there is no parent span, no additional spans are created
6
- * (default: true)
7
- */
8
- requireParentSpan?: boolean;
1
+ import type { SpanLink } from '@sentry/core';
2
+ export type BatchLoadFn<K, V> = (keys: ReadonlyArray<K>) => PromiseLike<ArrayLike<V | Error>>;
3
+ /** A `DataLoader` instance. */
4
+ export interface DataLoader<K = unknown, V = unknown> {
5
+ _batchLoadFn: BatchLoadFn<K, V>;
6
+ _batch: {
7
+ spanLinks?: SpanLink[];
8
+ } | null;
9
+ load(key: K): Promise<V>;
10
+ loadMany(keys: ArrayLike<K>): Promise<Array<V | Error>>;
11
+ prime(key: K, value: V | Error): this;
12
+ clear(key: K): this;
13
+ clearAll(): this;
14
+ name: string | undefined;
15
+ [key: string]: any;
16
+ }
17
+ /** The `DataLoader` class/constructor. */
18
+ export interface DataLoaderConstructor {
19
+ new <K, V>(batchLoadFn: BatchLoadFn<K, V>, options?: any): DataLoader<K, V>;
20
+ prototype: DataLoader<unknown, unknown>;
9
21
  }
10
22
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/dataloader/vendored/types.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E,MAAM,WAAW,+BAAgC,SAAQ,qBAAqB;IAC5E;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/dataloader/vendored/types.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAI7C,MAAM,MAAM,WAAW,CAAC,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B,EAAE,MAAM,4BAA4B,CAAC;AAOxE,eAAO,MAAM,qBAAqB;;CAAqF,CAAC;AAgCxH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,0CAA6C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/genericPool/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAOxE,eAAO,MAAM,qBAAqB;;CAAqF,CAAC;AA4BxH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,sBAAsB,0CAA6C,CAAC"}
@@ -1,5 +1,5 @@
1
1
  export declare class Pool<T> {
2
2
  acquire(priority?: number): PromiseLike<T>;
3
- [key: string]: any;
3
+ [key: string]: unknown;
4
4
  }
5
5
  //# sourceMappingURL=generic-pool-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generic-pool-types.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/genericPool/vendored/generic-pool-types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,OAAO,IAAI,CAAC,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC;IAC1C,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB"}
1
+ {"version":3,"file":"generic-pool-types.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/genericPool/vendored/generic-pool-types.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,OAAO,IAAI,CAAC,CAAC;IACzB,OAAO,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC;IAC1C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
@@ -1,4 +1,5 @@
1
- import { InstrumentationBase, InstrumentationConfig, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
1
+ import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
2
+ import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
2
3
  export declare class GenericPoolInstrumentation extends InstrumentationBase {
3
4
  private _isDisabled;
4
5
  constructor(config?: InstrumentationConfig);
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/genericPool/vendored/instrumentation.ts"],"names":[],"mappings":"AAuBA,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,mCAAmC,EAEpC,MAAM,gCAAgC,CAAC;AASxC,qBAAa,0BAA2B,SAAQ,mBAAmB;IAEjE,OAAO,CAAC,WAAW,CAAS;gBAEhB,MAAM,GAAE,qBAA0B;IAI9C,IAAI;IAyDJ,OAAO,CAAC,eAAe;IAsBvB,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,4BAA4B;CA0BrC"}
1
+ {"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/genericPool/vendored/instrumentation.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,mCAAmC,EAAa,MAAM,gCAAgC,CAAC;AAerH,qBAAa,0BAA2B,SAAQ,mBAAmB;IAEjE,OAAO,CAAC,WAAW,CAAS;gBAEhB,MAAM,GAAE,qBAA0B;IAI9C,IAAI;IAyDJ,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,4BAA4B;CAgCrC"}
@@ -1,10 +1,7 @@
1
1
  import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
2
- import { DataloaderInstrumentationConfig } from './types';
3
- export declare class DataloaderInstrumentation extends InstrumentationBase<DataloaderInstrumentationConfig> {
4
- constructor(config?: DataloaderInstrumentationConfig);
2
+ export declare class DataloaderInstrumentation extends InstrumentationBase {
3
+ constructor(config?: {});
5
4
  protected init(): InstrumentationNodeModuleDefinition[];
6
- private shouldCreateSpans;
7
- private getSpanName;
8
5
  private _wrapBatchLoadFn;
9
6
  private _getPatchedConstructor;
10
7
  private _patchLoad;
@@ -1,10 +1,22 @@
1
- import { InstrumentationConfig } from '@opentelemetry/instrumentation';
2
- export interface DataloaderInstrumentationConfig extends InstrumentationConfig {
3
- /**
4
- * Whether the instrumentation requires a parent span, if set to true
5
- * and there is no parent span, no additional spans are created
6
- * (default: true)
7
- */
8
- requireParentSpan?: boolean;
1
+ import { SpanLink } from '@sentry/core';
2
+ export type BatchLoadFn<K, V> = (keys: ReadonlyArray<K>) => PromiseLike<ArrayLike<V | Error>>;
3
+ /** A `DataLoader` instance. */
4
+ export interface DataLoader<K = unknown, V = unknown> {
5
+ _batchLoadFn: BatchLoadFn<K, V>;
6
+ _batch: {
7
+ spanLinks?: SpanLink[];
8
+ } | null;
9
+ load(key: K): Promise<V>;
10
+ loadMany(keys: ArrayLike<K>): Promise<Array<V | Error>>;
11
+ prime(key: K, value: V | Error): this;
12
+ clear(key: K): this;
13
+ clearAll(): this;
14
+ name: string | undefined;
15
+ [key: string]: any;
16
+ }
17
+ /** The `DataLoader` class/constructor. */
18
+ export interface DataLoaderConstructor {
19
+ new <K, V>(batchLoadFn: BatchLoadFn<K, V>, options?: any): DataLoader<K, V>;
20
+ prototype: DataLoader<unknown, unknown>;
9
21
  }
10
22
  //# sourceMappingURL=types.d.ts.map
@@ -1,5 +1,5 @@
1
1
  export declare class Pool<T> {
2
2
  acquire(priority?: number): PromiseLike<T>;
3
- [key: string]: any;
3
+ [key: string]: unknown;
4
4
  }
5
5
  //# sourceMappingURL=generic-pool-types.d.ts.map
@@ -1,4 +1,5 @@
1
- import { InstrumentationBase, InstrumentationConfig, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
1
+ import { InstrumentationConfig } from '@opentelemetry/instrumentation';
2
+ import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
2
3
  export declare class GenericPoolInstrumentation extends InstrumentationBase {
3
4
  private _isDisabled;
4
5
  constructor(config?: InstrumentationConfig);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/node",
3
- "version": "10.57.0",
3
+ "version": "10.58.0",
4
4
  "description": "Sentry Node SDK using OpenTelemetry for performance instrumentation",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/node",
@@ -70,10 +70,10 @@
70
70
  "@opentelemetry/instrumentation": "^0.214.0",
71
71
  "@opentelemetry/sdk-trace-base": "^2.6.1",
72
72
  "@opentelemetry/semantic-conventions": "^1.40.0",
73
- "@sentry-internal/server-utils": "10.57.0",
74
- "@sentry/core": "10.57.0",
75
- "@sentry/node-core": "10.57.0",
76
- "@sentry/opentelemetry": "10.57.0",
73
+ "@sentry/core": "10.58.0",
74
+ "@sentry/node-core": "10.58.0",
75
+ "@sentry/opentelemetry": "10.58.0",
76
+ "@sentry/server-utils": "10.58.0",
77
77
  "import-in-the-middle": "^3.0.0"
78
78
  },
79
79
  "devDependencies": {
@@ -1,14 +0,0 @@
1
- declare class DataLoader<K, V, _C = K> {
2
- constructor(batchLoadFn: DataLoader.BatchLoadFn<K, V>, options?: any);
3
- load(key: K): Promise<V>;
4
- loadMany(keys: ArrayLike<K>): Promise<Array<V | Error>>;
5
- prime(key: K, value: V | Error): this;
6
- clear(key: K): this;
7
- clearAll(): this;
8
- [key: string]: any;
9
- }
10
- declare namespace DataLoader {
11
- type BatchLoadFn<K, V> = (keys: ReadonlyArray<K>) => PromiseLike<ArrayLike<V | Error>>;
12
- }
13
- export = DataLoader;
14
- //# sourceMappingURL=dataloader-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dataloader-types.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/dataloader/vendored/dataloader-types.ts"],"names":[],"mappings":"AAIA,OAAO,OAAO,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC;gBACvB,WAAW,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,GAAG;IACpE,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;IACvD,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI;IACrC,KAAK,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI;IACnB,QAAQ,IAAI,IAAI;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,OAAO,WAAW,UAAU,CAAC;IAC3B,KAAK,WAAW,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,KAAK,WAAW,CAAC,SAAS,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;CACxF;AAED,SAAS,UAAU,CAAC"}
@@ -1,14 +0,0 @@
1
- declare class DataLoader<K, V, _C = K> {
2
- constructor(batchLoadFn: DataLoader.BatchLoadFn<K, V>, options?: any);
3
- load(key: K): Promise<V>;
4
- loadMany(keys: ArrayLike<K>): Promise<Array<V | Error>>;
5
- prime(key: K, value: V | Error): this;
6
- clear(key: K): this;
7
- clearAll(): this;
8
- [key: string]: any;
9
- }
10
- declare namespace DataLoader {
11
- type BatchLoadFn<K, V> = (keys: ReadonlyArray<K>) => PromiseLike<ArrayLike<V | Error>>;
12
- }
13
- export = DataLoader;
14
- //# sourceMappingURL=dataloader-types.d.ts.map