@sentry/node 10.59.0 → 10.60.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 (85) hide show
  1. package/build/cjs/index.js +1 -0
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/integrations/node-fetch/index.js +7 -8
  4. package/build/cjs/integrations/node-fetch/index.js.map +1 -1
  5. package/build/cjs/integrations/node-fetch/vendored/semconv.js +28 -0
  6. package/build/cjs/integrations/node-fetch/vendored/semconv.js.map +1 -0
  7. package/build/cjs/integrations/node-fetch/vendored/undici.js +91 -127
  8. package/build/cjs/integrations/node-fetch/vendored/undici.js.map +1 -1
  9. package/build/cjs/integrations/tracing/kafka/index.js +1 -11
  10. package/build/cjs/integrations/tracing/kafka/index.js.map +1 -1
  11. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js +45 -247
  12. package/build/cjs/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
  13. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js +4 -8
  14. package/build/cjs/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
  15. package/build/cjs/integrations/tracing/kafka/vendored/utils.js +113 -0
  16. package/build/cjs/integrations/tracing/kafka/vendored/utils.js.map +1 -0
  17. package/build/cjs/sdk/initOtel.js +2 -1
  18. package/build/cjs/sdk/initOtel.js.map +1 -1
  19. package/build/esm/index.js +1 -1
  20. package/build/esm/integrations/node-fetch/index.js +8 -9
  21. package/build/esm/integrations/node-fetch/index.js.map +1 -1
  22. package/build/esm/integrations/node-fetch/vendored/semconv.js +15 -0
  23. package/build/esm/integrations/node-fetch/vendored/semconv.js.map +1 -0
  24. package/build/esm/integrations/node-fetch/vendored/undici.js +80 -116
  25. package/build/esm/integrations/node-fetch/vendored/undici.js.map +1 -1
  26. package/build/esm/integrations/tracing/kafka/index.js +2 -12
  27. package/build/esm/integrations/tracing/kafka/index.js.map +1 -1
  28. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js +47 -249
  29. package/build/esm/integrations/tracing/kafka/vendored/instrumentation.js.map +1 -1
  30. package/build/esm/integrations/tracing/kafka/vendored/semconv.js +3 -5
  31. package/build/esm/integrations/tracing/kafka/vendored/semconv.js.map +1 -1
  32. package/build/esm/integrations/tracing/kafka/vendored/utils.js +107 -0
  33. package/build/esm/integrations/tracing/kafka/vendored/utils.js.map +1 -0
  34. package/build/esm/package.json +1 -1
  35. package/build/esm/sdk/initOtel.js +2 -1
  36. package/build/esm/sdk/initOtel.js.map +1 -1
  37. package/build/types/index.d.ts +1 -1
  38. package/build/types/index.d.ts.map +1 -1
  39. package/build/types/integrations/node-fetch/index.d.ts.map +1 -1
  40. package/build/types/integrations/node-fetch/vendored/internal-types.d.ts.map +1 -1
  41. package/build/types/integrations/node-fetch/vendored/semconv.d.ts +13 -0
  42. package/build/types/integrations/node-fetch/vendored/semconv.d.ts.map +1 -0
  43. package/build/types/integrations/node-fetch/vendored/types.d.ts +2 -4
  44. package/build/types/integrations/node-fetch/vendored/types.d.ts.map +1 -1
  45. package/build/types/integrations/node-fetch/vendored/undici.d.ts +6 -7
  46. package/build/types/integrations/node-fetch/vendored/undici.d.ts.map +1 -1
  47. package/build/types/integrations/tracing/kafka/index.d.ts.map +1 -1
  48. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts +3 -13
  49. package/build/types/integrations/tracing/kafka/vendored/instrumentation.d.ts.map +1 -1
  50. package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +0 -32
  51. package/build/types/integrations/tracing/kafka/vendored/kafkajs-types.d.ts.map +1 -1
  52. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts +9 -28
  53. package/build/types/integrations/tracing/kafka/vendored/semconv.d.ts.map +1 -1
  54. package/build/types/integrations/tracing/kafka/vendored/utils.d.ts +29 -0
  55. package/build/types/integrations/tracing/kafka/vendored/utils.d.ts.map +1 -0
  56. package/build/types/sdk/initOtel.d.ts.map +1 -1
  57. package/build/types-ts3.8/index.d.ts +1 -1
  58. package/build/types-ts3.8/integrations/node-fetch/vendored/semconv.d.ts +13 -0
  59. package/build/types-ts3.8/integrations/node-fetch/vendored/types.d.ts +2 -4
  60. package/build/types-ts3.8/integrations/node-fetch/vendored/undici.d.ts +6 -7
  61. package/build/types-ts3.8/integrations/tracing/kafka/vendored/instrumentation.d.ts +3 -13
  62. package/build/types-ts3.8/integrations/tracing/kafka/vendored/kafkajs-types.d.ts +0 -32
  63. package/build/types-ts3.8/integrations/tracing/kafka/vendored/semconv.d.ts +9 -28
  64. package/build/types-ts3.8/integrations/tracing/kafka/vendored/utils.d.ts +29 -0
  65. package/package.json +5 -6
  66. package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js +0 -6
  67. package/build/cjs/integrations/tracing/kafka/vendored/internal-types.js.map +0 -1
  68. package/build/cjs/integrations/tracing/kafka/vendored/propagator.js +0 -22
  69. package/build/cjs/integrations/tracing/kafka/vendored/propagator.js.map +0 -1
  70. package/build/esm/integrations/tracing/kafka/vendored/internal-types.js +0 -4
  71. package/build/esm/integrations/tracing/kafka/vendored/internal-types.js.map +0 -1
  72. package/build/esm/integrations/tracing/kafka/vendored/propagator.js +0 -20
  73. package/build/esm/integrations/tracing/kafka/vendored/propagator.js.map +0 -1
  74. package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts +0 -9
  75. package/build/types/integrations/tracing/kafka/vendored/internal-types.d.ts.map +0 -1
  76. package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts +0 -3
  77. package/build/types/integrations/tracing/kafka/vendored/propagator.d.ts.map +0 -1
  78. package/build/types/integrations/tracing/kafka/vendored/types.d.ts +0 -26
  79. package/build/types/integrations/tracing/kafka/vendored/types.d.ts.map +0 -1
  80. package/build/types/integrations/tracing/utils/sql-common.d.ts +0 -3
  81. package/build/types/integrations/tracing/utils/sql-common.d.ts.map +0 -1
  82. package/build/types-ts3.8/integrations/tracing/kafka/vendored/internal-types.d.ts +0 -9
  83. package/build/types-ts3.8/integrations/tracing/kafka/vendored/propagator.d.ts +0 -3
  84. package/build/types-ts3.8/integrations/tracing/kafka/vendored/types.d.ts +0 -26
  85. package/build/types-ts3.8/integrations/tracing/utils/sql-common.d.ts +0 -3
@@ -1,14 +1,13 @@
1
- import { InstrumentationBase } from '@opentelemetry/instrumentation';
2
1
  import { UndiciInstrumentationConfig } from './types';
3
- export declare class UndiciInstrumentation extends InstrumentationBase<UndiciInstrumentationConfig> {
2
+ export declare class UndiciInstrumentation {
4
3
  private _channelSubs;
5
- private _recordFromReq;
6
- private _httpClientDurationHistogram;
4
+ private _spanFromReq;
5
+ private _propagationDecisionMap;
6
+ private _config;
7
7
  constructor(config?: UndiciInstrumentationConfig);
8
- protected init(): undefined;
9
8
  disable(): void;
9
+ /** Subscribe to the undici diagnostics channels (idempotent). */
10
10
  enable(): void;
11
- protected _updateMetricInstruments(): void;
12
11
  private subscribeToChannel;
13
12
  private parseRequestHeaders;
14
13
  private onRequestCreated;
@@ -16,7 +15,7 @@ export declare class UndiciInstrumentation extends InstrumentationBase<UndiciIns
16
15
  private onResponseHeaders;
17
16
  private onDone;
18
17
  private onError;
19
- private recordRequestDuration;
18
+ private injectTracePropagationHeaders;
20
19
  private getRequestMethod;
21
20
  }
22
21
  //# sourceMappingURL=undici.d.ts.map
@@ -1,16 +1,9 @@
1
+ import { InstrumentationConfig } from '@opentelemetry/instrumentation';
1
2
  import { InstrumentationBase, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
2
- import { KafkaJsInstrumentationConfig } from './types';
3
- export declare class KafkaJsInstrumentation extends InstrumentationBase<KafkaJsInstrumentationConfig> {
4
- private _clientDuration;
5
- private _sentMessages;
6
- private _consumedMessages;
7
- private _processDuration;
8
- constructor(config?: KafkaJsInstrumentationConfig);
9
- _updateMetricInstruments(): void;
3
+ export declare class KafkaJsInstrumentation extends InstrumentationBase<InstrumentationConfig> {
4
+ constructor(config?: InstrumentationConfig);
10
5
  protected init(): InstrumentationNodeModuleDefinition;
11
6
  private _getConsumerPatch;
12
- private _setKafkaEventListeners;
13
- private _recordClientDurationMetric;
14
7
  private _getProducerPatch;
15
8
  private _getConsumerRunPatch;
16
9
  private _getConsumerEachMessagePatch;
@@ -18,8 +11,5 @@ export declare class KafkaJsInstrumentation extends InstrumentationBase<KafkaJsI
18
11
  private _getProducerTransactionPatch;
19
12
  private _getSendBatchPatch;
20
13
  private _getSendPatch;
21
- private _endSpansOnPromise;
22
- private _startConsumerSpan;
23
- private _startProducerSpan;
24
14
  }
25
15
  //# sourceMappingURL=instrumentation.d.ts.map
@@ -1,31 +1,3 @@
1
- export interface InstrumentationEvent<T> {
2
- id: string;
3
- type: string;
4
- timestamp: number;
5
- payload: T;
6
- }
7
- export type RequestEvent = InstrumentationEvent<{
8
- apiKey: number;
9
- apiName: string;
10
- apiVersion: number;
11
- broker: string;
12
- clientId: string;
13
- correlationId: number;
14
- createdAt: number;
15
- duration: number;
16
- pendingDuration: number;
17
- sentAt: number;
18
- size: number;
19
- }>;
20
- export type RemoveInstrumentationEventListener<_T> = () => void;
21
- export type ConsumerEvents = {
22
- REQUEST: 'consumer.network.request';
23
- [key: string]: string;
24
- };
25
- export type ProducerEvents = {
26
- REQUEST: 'producer.network.request';
27
- [key: string]: string;
28
- };
29
1
  type Sender = {
30
2
  send(record: any): Promise<any>;
31
3
  sendBatch(batch: any): Promise<any>;
@@ -34,8 +6,6 @@ export type Producer = Sender & {
34
6
  connect(): Promise<void>;
35
7
  disconnect(): Promise<void>;
36
8
  isIdempotent(): boolean;
37
- readonly events: ProducerEvents;
38
- on(eventName: string, listener: (...args: any[]) => void): RemoveInstrumentationEventListener<any>;
39
9
  transaction(): Promise<Transaction>;
40
10
  [key: string]: any;
41
11
  };
@@ -50,8 +20,6 @@ export type Consumer = {
50
20
  disconnect(): Promise<void>;
51
21
  subscribe(subscription: any): Promise<void>;
52
22
  run(config?: any): Promise<void>;
53
- readonly events: ConsumerEvents;
54
- on(eventName: string, listener: (...args: any[]) => void): RemoveInstrumentationEventListener<any>;
55
23
  [key: string]: any;
56
24
  };
57
25
  export declare class Kafka {
@@ -96,36 +96,17 @@ export declare const MESSAGING_OPERATION_TYPE_VALUE_SEND: "send";
96
96
  */
97
97
  export declare const MESSAGING_SYSTEM_VALUE_KAFKA: "kafka";
98
98
  /**
99
- * Number of messages that were delivered to the application.
99
+ * Describes a class of error the operation ended with.
100
100
  *
101
- * @note Records the number of messages pulled from the broker or number of messages dispatched to the application in push-based scenarios.
102
- * The metric **SHOULD** be reported once per message delivery. For example, if receiving and processing operations are both instrumented for a single message delivery, this counter is incremented when the message is received and not reported when it is processed.
103
- *
104
- * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
105
- */
106
- export declare const METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES: "messaging.client.consumed.messages";
107
- /**
108
- * Duration of messaging operation initiated by a producer or consumer client.
109
- *
110
- * @note This metric **SHOULD NOT** be used to report processing duration - processing duration is reported in `messaging.process.duration` metric.
111
- *
112
- * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
101
+ * @example timeout
102
+ * @example java.net.UnknownHostException
103
+ * @example server_certificate_invalid
104
+ * @example 500
113
105
  */
114
- export declare const METRIC_MESSAGING_CLIENT_OPERATION_DURATION: "messaging.client.operation.duration";
106
+ export declare const ATTR_ERROR_TYPE: "error.type";
115
107
  /**
116
- * Number of messages producer attempted to send to the broker.
117
- *
118
- * @note This metric **MUST NOT** count messages that were created but haven't yet been sent.
119
- *
120
- * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
121
- */
122
- export declare const METRIC_MESSAGING_CLIENT_SENT_MESSAGES: "messaging.client.sent.messages";
123
- /**
124
- * Duration of processing operation.
125
- *
126
- * @note This metric **MUST** be reported for operations with `messaging.operation.type` that matches `process`.
127
- *
128
- * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.
108
+ * Enum value "_OTHER" for attribute {@link ATTR_ERROR_TYPE}. A fallback error value to be used when
109
+ * the instrumentation doesn't define a custom value.
129
110
  */
130
- export declare const METRIC_MESSAGING_PROCESS_DURATION: "messaging.process.duration";
111
+ export declare const ERROR_TYPE_VALUE_OTHER: "_OTHER";
131
112
  //# sourceMappingURL=semconv.d.ts.map
@@ -0,0 +1,29 @@
1
+ import { Span, SpanAttributes, SpanLink } from '@sentry/core';
2
+ import { KafkaMessage, Message } from './kafkajs-types';
3
+ export interface ConsumerSpanOptions {
4
+ topic: string;
5
+ message: KafkaMessage | undefined;
6
+ operationType: string;
7
+ attributes: SpanAttributes;
8
+ links?: SpanLink[];
9
+ }
10
+ /**
11
+ * Reads a header value off a kafkajs message as a string. kafkajs delivers headers as `Buffer`s (or
12
+ * arrays of them), so we normalize to a string before handing them to Sentry's trace helpers.
13
+ */
14
+ export declare function getHeaderAsString(headers: KafkaMessage['headers'], key: string): string | undefined;
15
+ /**
16
+ * Builds a span link to the producer span carried in the message headers, mirroring the upstream
17
+ * behavior of linking each batch-processed message to its originating producer span.
18
+ */
19
+ export declare function getLinksFromHeaders(headers: KafkaMessage['headers']): SpanLink[] | undefined;
20
+ /** Starts an inactive consumer (process/receive) span carrying the kafkajs messaging attributes. */
21
+ export declare function startConsumerSpan({ topic, message, operationType, links, attributes }: ConsumerSpanOptions): Span;
22
+ /** Starts an inactive producer span and propagates its trace into the message headers. */
23
+ export declare function startProducerSpan(topic: string, message: Message): Span;
24
+ /**
25
+ * Resolves once `sendPromise` settles, ending all `spans` and, on failure, marking them with the
26
+ * error status and `error.type` before re-throwing.
27
+ */
28
+ export declare function endSpansOnPromise<T>(spans: Span[], sendPromise: Promise<T>): Promise<T>;
29
+ //# sourceMappingURL=utils.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/node",
3
- "version": "10.59.0",
3
+ "version": "10.60.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",
@@ -66,14 +66,13 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@opentelemetry/api": "^1.9.1",
69
- "@opentelemetry/core": "^2.6.1",
70
69
  "@opentelemetry/instrumentation": "^0.214.0",
71
70
  "@opentelemetry/sdk-trace-base": "^2.6.1",
72
71
  "@opentelemetry/semantic-conventions": "^1.40.0",
73
- "@sentry/core": "10.59.0",
74
- "@sentry/node-core": "10.59.0",
75
- "@sentry/opentelemetry": "10.59.0",
76
- "@sentry/server-utils": "10.59.0",
72
+ "@sentry/core": "10.60.0",
73
+ "@sentry/node-core": "10.60.0",
74
+ "@sentry/opentelemetry": "10.60.0",
75
+ "@sentry/server-utils": "10.60.0",
77
76
  "import-in-the-middle": "^3.0.0"
78
77
  },
79
78
  "devDependencies": {
@@ -1,6 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const EVENT_LISTENERS_SET = /* @__PURE__ */ Symbol("opentelemetry.instrumentation.kafkajs.eventListenersSet");
4
-
5
- exports.EVENT_LISTENERS_SET = EVENT_LISTENERS_SET;
6
- //# sourceMappingURL=internal-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"internal-types.js","sources":["../../../../../../src/integrations/tracing/kafka/vendored/internal-types.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors, Aspecto\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-kafkajs\n * - Upstream version: @opentelemetry/instrumentation-kafkajs@0.27.0\n * - Some types vendored from kafkajs with simplifications\n */\n/* eslint-disable */\n\nimport type { Consumer, Producer } from './kafkajs-types';\n\nexport const EVENT_LISTENERS_SET = Symbol('opentelemetry.instrumentation.kafkajs.eventListenersSet');\n\nexport interface ConsumerExtended extends Consumer {\n [EVENT_LISTENERS_SET]?: boolean; // flag to identify if the event listeners for instrumentation have been set\n}\n\nexport interface ProducerExtended extends Producer {\n [EVENT_LISTENERS_SET]?: boolean; // flag to identify if the event listeners for instrumentation have been set\n}\n"],"names":[],"mappings":";;AAaO,MAAM,mBAAA,0BAA6B,yDAAyD;;;;"}
@@ -1,22 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const bufferTextMapGetter = {
4
- get(carrier, key) {
5
- if (!carrier) {
6
- return void 0;
7
- }
8
- const keys = Object.keys(carrier);
9
- for (const carrierKey of keys) {
10
- if (carrierKey === key || carrierKey.toLowerCase() === key) {
11
- return carrier[carrierKey]?.toString();
12
- }
13
- }
14
- return void 0;
15
- },
16
- keys(carrier) {
17
- return carrier ? Object.keys(carrier) : [];
18
- }
19
- };
20
-
21
- exports.bufferTextMapGetter = bufferTextMapGetter;
22
- //# sourceMappingURL=propagator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"propagator.js","sources":["../../../../../../src/integrations/tracing/kafka/vendored/propagator.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors, Aspecto\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-kafkajs\n * - Upstream version: @opentelemetry/instrumentation-kafkajs@0.27.0\n */\n/* eslint-disable */\n\nimport type { TextMapGetter } from '@opentelemetry/api';\n\n/*\nsame as open telemetry's `defaultTextMapGetter`,\nbut also handle case where header is buffer,\nadding toString() to make sure string is returned\n*/\nexport const bufferTextMapGetter: TextMapGetter = {\n get(carrier, key) {\n if (!carrier) {\n return undefined;\n }\n\n const keys = Object.keys(carrier);\n\n for (const carrierKey of keys) {\n if (carrierKey === key || carrierKey.toLowerCase() === key) {\n return carrier[carrierKey]?.toString();\n }\n }\n\n return undefined;\n },\n\n keys(carrier) {\n return carrier ? Object.keys(carrier) : [];\n },\n};\n"],"names":[],"mappings":";;AAiBO,MAAM,mBAAA,GAAqC;AAAA,EAChD,GAAA,CAAI,SAAS,GAAA,EAAK;AAChB,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,OAAO,MAAA;AAAA,IACT;AAEA,IAAA,MAAM,IAAA,GAAO,MAAA,CAAO,IAAA,CAAK,OAAO,CAAA;AAEhC,IAAA,KAAA,MAAW,cAAc,IAAA,EAAM;AAC7B,MAAA,IAAI,UAAA,KAAe,GAAA,IAAO,UAAA,CAAW,WAAA,OAAkB,GAAA,EAAK;AAC1D,QAAA,OAAO,OAAA,CAAQ,UAAU,CAAA,EAAG,QAAA,EAAS;AAAA,MACvC;AAAA,IACF;AAEA,IAAA,OAAO,MAAA;AAAA,EACT,CAAA;AAAA,EAEA,KAAK,OAAA,EAAS;AACZ,IAAA,OAAO,OAAA,GAAU,MAAA,CAAO,IAAA,CAAK,OAAO,IAAI,EAAC;AAAA,EAC3C;AACF;;;;"}
@@ -1,4 +0,0 @@
1
- const EVENT_LISTENERS_SET = /* @__PURE__ */ Symbol("opentelemetry.instrumentation.kafkajs.eventListenersSet");
2
-
3
- export { EVENT_LISTENERS_SET };
4
- //# sourceMappingURL=internal-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"internal-types.js","sources":["../../../../../../src/integrations/tracing/kafka/vendored/internal-types.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors, Aspecto\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-kafkajs\n * - Upstream version: @opentelemetry/instrumentation-kafkajs@0.27.0\n * - Some types vendored from kafkajs with simplifications\n */\n/* eslint-disable */\n\nimport type { Consumer, Producer } from './kafkajs-types';\n\nexport const EVENT_LISTENERS_SET = Symbol('opentelemetry.instrumentation.kafkajs.eventListenersSet');\n\nexport interface ConsumerExtended extends Consumer {\n [EVENT_LISTENERS_SET]?: boolean; // flag to identify if the event listeners for instrumentation have been set\n}\n\nexport interface ProducerExtended extends Producer {\n [EVENT_LISTENERS_SET]?: boolean; // flag to identify if the event listeners for instrumentation have been set\n}\n"],"names":[],"mappings":"AAaO,MAAM,mBAAA,0BAA6B,yDAAyD;;;;"}
@@ -1,20 +0,0 @@
1
- const bufferTextMapGetter = {
2
- get(carrier, key) {
3
- if (!carrier) {
4
- return void 0;
5
- }
6
- const keys = Object.keys(carrier);
7
- for (const carrierKey of keys) {
8
- if (carrierKey === key || carrierKey.toLowerCase() === key) {
9
- return carrier[carrierKey]?.toString();
10
- }
11
- }
12
- return void 0;
13
- },
14
- keys(carrier) {
15
- return carrier ? Object.keys(carrier) : [];
16
- }
17
- };
18
-
19
- export { bufferTextMapGetter };
20
- //# sourceMappingURL=propagator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"propagator.js","sources":["../../../../../../src/integrations/tracing/kafka/vendored/propagator.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors, Aspecto\n * SPDX-License-Identifier: Apache-2.0\n *\n * NOTICE from the Sentry authors:\n * - Vendored from: https://github.com/open-telemetry/opentelemetry-js-contrib/tree/15ef7506553f631ea4181391e0c5725a56f0d082/packages/instrumentation-kafkajs\n * - Upstream version: @opentelemetry/instrumentation-kafkajs@0.27.0\n */\n/* eslint-disable */\n\nimport type { TextMapGetter } from '@opentelemetry/api';\n\n/*\nsame as open telemetry's `defaultTextMapGetter`,\nbut also handle case where header is buffer,\nadding toString() to make sure string is returned\n*/\nexport const bufferTextMapGetter: TextMapGetter = {\n get(carrier, key) {\n if (!carrier) {\n return undefined;\n }\n\n const keys = Object.keys(carrier);\n\n for (const carrierKey of keys) {\n if (carrierKey === key || carrierKey.toLowerCase() === key) {\n return carrier[carrierKey]?.toString();\n }\n }\n\n return undefined;\n },\n\n keys(carrier) {\n return carrier ? Object.keys(carrier) : [];\n },\n};\n"],"names":[],"mappings":"AAiBO,MAAM,mBAAA,GAAqC;AAAA,EAChD,GAAA,CAAI,SAAS,GAAA,EAAK;AAChB,IAAA,IAAI,CAAC,OAAA,EAAS;AACZ,MAAA,OAAO,MAAA;AAAA,IACT;AAEA,IAAA,MAAM,IAAA,GAAO,MAAA,CAAO,IAAA,CAAK,OAAO,CAAA;AAEhC,IAAA,KAAA,MAAW,cAAc,IAAA,EAAM;AAC7B,MAAA,IAAI,UAAA,KAAe,GAAA,IAAO,UAAA,CAAW,WAAA,OAAkB,GAAA,EAAK;AAC1D,QAAA,OAAO,OAAA,CAAQ,UAAU,CAAA,EAAG,QAAA,EAAS;AAAA,MACvC;AAAA,IACF;AAEA,IAAA,OAAO,MAAA;AAAA,EACT,CAAA;AAAA,EAEA,KAAK,OAAA,EAAS;AACZ,IAAA,OAAO,OAAA,GAAU,MAAA,CAAO,IAAA,CAAK,OAAO,IAAI,EAAC;AAAA,EAC3C;AACF;;;;"}
@@ -1,9 +0,0 @@
1
- import type { Consumer, Producer } from './kafkajs-types';
2
- export declare const EVENT_LISTENERS_SET: unique symbol;
3
- export interface ConsumerExtended extends Consumer {
4
- [EVENT_LISTENERS_SET]?: boolean;
5
- }
6
- export interface ProducerExtended extends Producer {
7
- [EVENT_LISTENERS_SET]?: boolean;
8
- }
9
- //# sourceMappingURL=internal-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/kafka/vendored/internal-types.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE1D,eAAO,MAAM,mBAAmB,eAAoE,CAAC;AAErG,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IAChD,CAAC,mBAAmB,CAAC,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IAChD,CAAC,mBAAmB,CAAC,CAAC,EAAE,OAAO,CAAC;CACjC"}
@@ -1,3 +0,0 @@
1
- import type { TextMapGetter } from '@opentelemetry/api';
2
- export declare const bufferTextMapGetter: TextMapGetter;
3
- //# sourceMappingURL=propagator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"propagator.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/kafka/vendored/propagator.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAOxD,eAAO,MAAM,mBAAmB,EAAE,aAoBjC,CAAC"}
@@ -1,26 +0,0 @@
1
- import { Span } from '@opentelemetry/api';
2
- import { InstrumentationConfig } from '@opentelemetry/instrumentation';
3
- export interface KafkajsMessage {
4
- key?: Buffer | string | null;
5
- value: Buffer | string | null;
6
- partition?: number;
7
- headers?: Record<string, Buffer | string | (Buffer | string)[] | undefined>;
8
- timestamp?: string;
9
- }
10
- export interface MessageInfo<T = KafkajsMessage> {
11
- topic: string;
12
- message: T;
13
- }
14
- export interface KafkaProducerCustomAttributeFunction<T = KafkajsMessage> {
15
- (span: Span, info: MessageInfo<T>): void;
16
- }
17
- export interface KafkaConsumerCustomAttributeFunction<T = KafkajsMessage> {
18
- (span: Span, info: MessageInfo<T>): void;
19
- }
20
- export interface KafkaJsInstrumentationConfig extends InstrumentationConfig {
21
- /** hook for adding custom attributes before producer message is sent */
22
- producerHook?: KafkaProducerCustomAttributeFunction;
23
- /** hook for adding custom attributes before consumer message is processed */
24
- consumerHook?: KafkaConsumerCustomAttributeFunction;
25
- }
26
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/integrations/tracing/kafka/vendored/types.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,cAAc;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,CAAC;CACZ;AAED,MAAM,WAAW,oCAAoC,CAAC,CAAC,GAAG,cAAc;IACtE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CAC1C;AAED,MAAM,WAAW,oCAAoC,CAAC,CAAC,GAAG,cAAc;IACtE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;CAC1C;AAED,MAAM,WAAW,4BAA6B,SAAQ,qBAAqB;IACzE,wEAAwE;IACxE,YAAY,CAAC,EAAE,oCAAoC,CAAC;IAEpD,6EAA6E;IAC7E,YAAY,CAAC,EAAE,oCAAoC,CAAC;CACrD"}
@@ -1,3 +0,0 @@
1
- import type { Span } from '@opentelemetry/api';
2
- export declare function addSqlCommenterComment(span: Span, query: string): string;
3
- //# sourceMappingURL=sql-common.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sql-common.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/utils/sql-common.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AA+B/C,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CA8BxE"}
@@ -1,9 +0,0 @@
1
- import { Consumer, Producer } from './kafkajs-types';
2
- export declare const EVENT_LISTENERS_SET: unique symbol;
3
- export interface ConsumerExtended extends Consumer {
4
- [EVENT_LISTENERS_SET]?: boolean;
5
- }
6
- export interface ProducerExtended extends Producer {
7
- [EVENT_LISTENERS_SET]?: boolean;
8
- }
9
- //# sourceMappingURL=internal-types.d.ts.map
@@ -1,3 +0,0 @@
1
- import { TextMapGetter } from '@opentelemetry/api';
2
- export declare const bufferTextMapGetter: TextMapGetter;
3
- //# sourceMappingURL=propagator.d.ts.map
@@ -1,26 +0,0 @@
1
- import { Span } from '@opentelemetry/api';
2
- import { InstrumentationConfig } from '@opentelemetry/instrumentation';
3
- export interface KafkajsMessage {
4
- key?: Buffer | string | null;
5
- value: Buffer | string | null;
6
- partition?: number;
7
- headers?: Record<string, Buffer | string | (Buffer | string)[] | undefined>;
8
- timestamp?: string;
9
- }
10
- export interface MessageInfo<T = KafkajsMessage> {
11
- topic: string;
12
- message: T;
13
- }
14
- export interface KafkaProducerCustomAttributeFunction<T = KafkajsMessage> {
15
- (span: Span, info: MessageInfo<T>): void;
16
- }
17
- export interface KafkaConsumerCustomAttributeFunction<T = KafkajsMessage> {
18
- (span: Span, info: MessageInfo<T>): void;
19
- }
20
- export interface KafkaJsInstrumentationConfig extends InstrumentationConfig {
21
- /** hook for adding custom attributes before producer message is sent */
22
- producerHook?: KafkaProducerCustomAttributeFunction;
23
- /** hook for adding custom attributes before consumer message is processed */
24
- consumerHook?: KafkaConsumerCustomAttributeFunction;
25
- }
26
- //# sourceMappingURL=types.d.ts.map
@@ -1,3 +0,0 @@
1
- import { Span } from '@opentelemetry/api';
2
- export declare function addSqlCommenterComment(span: Span, query: string): string;
3
- //# sourceMappingURL=sql-common.d.ts.map