@sentry/opentelemetry 9.30.0 → 9.31.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 +62 -73
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.js +63 -74
- package/build/esm/index.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/types/propagator.d.ts +6 -2
- package/build/types/propagator.d.ts.map +1 -1
- package/build/types/spanExporter.d.ts +18 -22
- package/build/types/spanExporter.d.ts.map +1 -1
- package/build/types/utils/getTraceData.d.ts +4 -2
- package/build/types/utils/getTraceData.d.ts.map +1 -1
- package/build/types-ts3.8/propagator.d.ts +6 -2
- package/build/types-ts3.8/spanExporter.d.ts +18 -22
- package/build/types-ts3.8/utils/getTraceData.d.ts +4 -2
- package/package.json +2 -2
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"9.
|
|
1
|
+
{"type":"module","version":"9.31.0","sideEffects":false}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Context, TextMapGetter, TextMapSetter } from '@opentelemetry/api';
|
|
2
2
|
import { W3CBaggagePropagator } from '@opentelemetry/core';
|
|
3
|
-
import type { continueTrace, DynamicSamplingContext, Options } from '@sentry/core';
|
|
3
|
+
import type { Client, continueTrace, DynamicSamplingContext, Options, Scope } from '@sentry/core';
|
|
4
4
|
import { LRUMap } from '@sentry/core';
|
|
5
5
|
/**
|
|
6
6
|
* Injects and extracts `sentry-trace` and `baggage` headers from carriers.
|
|
@@ -30,8 +30,12 @@ export declare class SentryPropagator extends W3CBaggagePropagator {
|
|
|
30
30
|
export declare function shouldPropagateTraceForUrl(url: string | undefined, tracePropagationTargets: Options['tracePropagationTargets'], decisionMap?: LRUMap<string, boolean>): boolean;
|
|
31
31
|
/**
|
|
32
32
|
* Get propagation injection data for the given context.
|
|
33
|
+
* The additional options can be passed to override the scope and client that is otherwise derived from the context.
|
|
33
34
|
*/
|
|
34
|
-
export declare function getInjectionData(context: Context
|
|
35
|
+
export declare function getInjectionData(context: Context, options?: {
|
|
36
|
+
scope?: Scope;
|
|
37
|
+
client?: Client;
|
|
38
|
+
}): {
|
|
35
39
|
dynamicSamplingContext: Partial<DynamicSamplingContext> | undefined;
|
|
36
40
|
traceId: string | undefined;
|
|
37
41
|
spanId: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propagator.d.ts","sourceRoot":"","sources":["../../src/propagator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,OAAO,EAAqB,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE5G,OAAO,EAAuB,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhF,OAAO,KAAK,EAAE,aAAa,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"propagator.d.ts","sourceRoot":"","sources":["../../src/propagator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,OAAO,EAAqB,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE5G,OAAO,EAAuB,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhF,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,sBAAsB,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAClG,OAAO,EAQL,MAAM,EAMP,MAAM,cAAc,CAAC;AAQtB;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,oBAAoB;IACxD,8FAA8F;IAC9F,OAAO,CAAC,qBAAqB,CAA0B;;IAUvD;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI;IAmD9E;;OAEG;IACI,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO;IAelF;;OAEG;IACI,MAAM,IAAI,MAAM,EAAE;CAG1B;AAKD;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,uBAAuB,EAAE,OAAO,CAAC,yBAAyB,CAAC,EAC3D,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACpC,OAAO,CAgBT;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/C;IACD,sBAAsB,EAAE,OAAO,CAAC,sBAAsB,CAAC,GAAG,SAAS,CAAC;IACpE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;CAC9B,CA2CA;AA0BD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EACzC,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,EAC5C,QAAQ,EAAE,MAAM,CAAC,GAChB,CAAC,CAIH"}
|
|
@@ -1,44 +1,35 @@
|
|
|
1
1
|
import type { ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
2
2
|
import type { TransactionEvent } from '@sentry/core';
|
|
3
|
-
import type { SpanNode } from './utils/groupSpansWithParents';
|
|
4
|
-
type SpanNodeCompleted = SpanNode & {
|
|
5
|
-
span: ReadableSpan;
|
|
6
|
-
};
|
|
7
3
|
/**
|
|
8
4
|
* A Sentry-specific exporter that converts OpenTelemetry Spans to Sentry Spans & Transactions.
|
|
9
5
|
*/
|
|
10
6
|
export declare class SentrySpanExporter {
|
|
11
|
-
private _flushTimeout;
|
|
12
7
|
private _finishedSpanBuckets;
|
|
13
8
|
private _finishedSpanBucketSize;
|
|
14
9
|
private _spansToBucketEntry;
|
|
15
10
|
private _lastCleanupTimestampInS;
|
|
16
11
|
private _sentSpans;
|
|
12
|
+
private _debouncedFlush;
|
|
17
13
|
constructor(options?: {
|
|
18
14
|
/** Lower bound of time in seconds until spans that are buffered but have not been sent as part of a transaction get cleared from memory. */
|
|
19
15
|
timeout?: number;
|
|
20
16
|
});
|
|
21
17
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* @param spanId The span id to check.
|
|
25
|
-
* @returns Whether the span is already sent in the past X seconds.
|
|
18
|
+
* Export a single span.
|
|
19
|
+
* This is called by the span processor whenever a span is ended.
|
|
26
20
|
*/
|
|
27
|
-
isSpanAlreadySent(spanId: string): boolean;
|
|
28
|
-
/** Remove "expired" span id entries from the _sentSpans cache. */
|
|
29
|
-
flushSentSpanCache(): void;
|
|
30
|
-
/** Check if a node is a completed root node or a node whose parent has already been sent */
|
|
31
|
-
nodeIsCompletedRootNode(node: SpanNode): node is SpanNodeCompleted;
|
|
32
|
-
/** Get all completed root nodes from a list of nodes */
|
|
33
|
-
getCompletedRootNodes(nodes: SpanNode[]): SpanNodeCompleted[];
|
|
34
|
-
/** Export a single span. */
|
|
35
21
|
export(span: ReadableSpan): void;
|
|
36
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Try to flush any pending spans immediately.
|
|
24
|
+
* This is called internally by the exporter (via _debouncedFlush),
|
|
25
|
+
* but can also be triggered externally if we force-flush.
|
|
26
|
+
*/
|
|
37
27
|
flush(): void;
|
|
38
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Clear the exporter.
|
|
30
|
+
* This is called when the span processor is shut down.
|
|
31
|
+
*/
|
|
39
32
|
clear(): void;
|
|
40
|
-
/** Clear the flush timeout. */
|
|
41
|
-
private _clearTimeout;
|
|
42
33
|
/**
|
|
43
34
|
* Send the given spans, but only if they are part of a finished transaction.
|
|
44
35
|
*
|
|
@@ -49,8 +40,13 @@ export declare class SentrySpanExporter {
|
|
|
49
40
|
* In this case, we'll eventually need to clean this up.
|
|
50
41
|
*/
|
|
51
42
|
private _maybeSend;
|
|
43
|
+
/** Remove "expired" span id entries from the _sentSpans cache. */
|
|
44
|
+
private _flushSentSpanCache;
|
|
45
|
+
/** Check if a node is a completed root node or a node whose parent has already been sent */
|
|
46
|
+
private _nodeIsCompletedRootNodeOrHasSentParent;
|
|
47
|
+
/** Get all completed root nodes from a list of nodes */
|
|
48
|
+
private _getCompletedRootNodes;
|
|
52
49
|
}
|
|
53
50
|
/** Exported only for tests. */
|
|
54
51
|
export declare function createTransactionForOtelSpan(span: ReadableSpan): TransactionEvent;
|
|
55
|
-
export {};
|
|
56
52
|
//# sourceMappingURL=spanExporter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spanExporter.d.ts","sourceRoot":"","sources":["../../src/spanExporter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,KAAK,EAKV,gBAAgB,EAEjB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"spanExporter.d.ts","sourceRoot":"","sources":["../../src/spanExporter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,KAAK,EAKV,gBAAgB,EAEjB,MAAM,cAAc,CAAC;AAoCtB;;GAEG;AACH,qBAAa,kBAAkB;IAiB7B,OAAO,CAAC,oBAAoB,CAAqC;IACjE,OAAO,CAAC,uBAAuB,CAAS;IACxC,OAAO,CAAC,mBAAmB,CAA4C;IACvE,OAAO,CAAC,wBAAwB,CAAS;IAGzC,OAAO,CAAC,UAAU,CAAsB;IAExC,OAAO,CAAC,eAAe,CAA8B;gBAElC,OAAO,CAAC,EAAE;QAC3B,4IAA4I;QAC5I,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IASD;;;OAGG;IACI,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;IAoCvC;;;;OAIG;IACI,KAAK,IAAI,IAAI;IA4BpB;;;OAGG;IACI,KAAK,IAAI,IAAI;IAMpB;;;;;;;;OAQG;IACH,OAAO,CAAC,UAAU;IAoClB,kEAAkE;IAClE,OAAO,CAAC,mBAAmB;IAU3B,4FAA4F;IAC5F,OAAO,CAAC,uCAAuC;IAI/C,wDAAwD;IACxD,OAAO,CAAC,sBAAsB;CAK/B;AAYD,+BAA+B;AAC/B,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,YAAY,GAAG,gBAAgB,CAoEjF"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type { SerializedTraceData, Span } from '@sentry/core';
|
|
1
|
+
import type { Client, Scope, SerializedTraceData, Span } from '@sentry/core';
|
|
2
2
|
/**
|
|
3
3
|
* Otel-specific implementation of `getTraceData`.
|
|
4
4
|
* @see `@sentry/core` version of `getTraceData` for more information
|
|
5
5
|
*/
|
|
6
|
-
export declare function getTraceData({ span }?: {
|
|
6
|
+
export declare function getTraceData({ span, scope, client, }?: {
|
|
7
7
|
span?: Span;
|
|
8
|
+
scope?: Scope;
|
|
9
|
+
client?: Client;
|
|
8
10
|
}): SerializedTraceData;
|
|
9
11
|
//# sourceMappingURL=getTraceData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTraceData.d.ts","sourceRoot":"","sources":["../../../src/utils/getTraceData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"getTraceData.d.ts","sourceRoot":"","sources":["../../../src/utils/getTraceData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAS7E;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,KAAK,EACL,MAAM,GACP,GAAE;IAAE,IAAI,CAAC,EAAE,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,mBAAmB,CAe5E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Context, TextMapGetter, TextMapSetter } from '@opentelemetry/api';
|
|
2
2
|
import { W3CBaggagePropagator } from '@opentelemetry/core';
|
|
3
|
-
import { continueTrace, DynamicSamplingContext, Options } from '@sentry/core';
|
|
3
|
+
import { Client, continueTrace, DynamicSamplingContext, Options, Scope } from '@sentry/core';
|
|
4
4
|
import { LRUMap } from '@sentry/core';
|
|
5
5
|
/**
|
|
6
6
|
* Injects and extracts `sentry-trace` and `baggage` headers from carriers.
|
|
@@ -30,8 +30,12 @@ export declare class SentryPropagator extends W3CBaggagePropagator {
|
|
|
30
30
|
export declare function shouldPropagateTraceForUrl(url: string | undefined, tracePropagationTargets: Options['tracePropagationTargets'], decisionMap?: LRUMap<string, boolean>): boolean;
|
|
31
31
|
/**
|
|
32
32
|
* Get propagation injection data for the given context.
|
|
33
|
+
* The additional options can be passed to override the scope and client that is otherwise derived from the context.
|
|
33
34
|
*/
|
|
34
|
-
export declare function getInjectionData(context: Context
|
|
35
|
+
export declare function getInjectionData(context: Context, options?: {
|
|
36
|
+
scope?: Scope;
|
|
37
|
+
client?: Client;
|
|
38
|
+
}): {
|
|
35
39
|
dynamicSamplingContext: Partial<DynamicSamplingContext> | undefined;
|
|
36
40
|
traceId: string | undefined;
|
|
37
41
|
spanId: string | undefined;
|
|
@@ -1,44 +1,35 @@
|
|
|
1
1
|
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
2
2
|
import { TransactionEvent } from '@sentry/core';
|
|
3
|
-
import { SpanNode } from './utils/groupSpansWithParents';
|
|
4
|
-
type SpanNodeCompleted = SpanNode & {
|
|
5
|
-
span: ReadableSpan;
|
|
6
|
-
};
|
|
7
3
|
/**
|
|
8
4
|
* A Sentry-specific exporter that converts OpenTelemetry Spans to Sentry Spans & Transactions.
|
|
9
5
|
*/
|
|
10
6
|
export declare class SentrySpanExporter {
|
|
11
|
-
private _flushTimeout;
|
|
12
7
|
private _finishedSpanBuckets;
|
|
13
8
|
private _finishedSpanBucketSize;
|
|
14
9
|
private _spansToBucketEntry;
|
|
15
10
|
private _lastCleanupTimestampInS;
|
|
16
11
|
private _sentSpans;
|
|
12
|
+
private _debouncedFlush;
|
|
17
13
|
constructor(options?: {
|
|
18
14
|
/** Lower bound of time in seconds until spans that are buffered but have not been sent as part of a transaction get cleared from memory. */
|
|
19
15
|
timeout?: number;
|
|
20
16
|
});
|
|
21
17
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* @param spanId The span id to check.
|
|
25
|
-
* @returns Whether the span is already sent in the past X seconds.
|
|
18
|
+
* Export a single span.
|
|
19
|
+
* This is called by the span processor whenever a span is ended.
|
|
26
20
|
*/
|
|
27
|
-
isSpanAlreadySent(spanId: string): boolean;
|
|
28
|
-
/** Remove "expired" span id entries from the _sentSpans cache. */
|
|
29
|
-
flushSentSpanCache(): void;
|
|
30
|
-
/** Check if a node is a completed root node or a node whose parent has already been sent */
|
|
31
|
-
nodeIsCompletedRootNode(node: SpanNode): node is SpanNodeCompleted;
|
|
32
|
-
/** Get all completed root nodes from a list of nodes */
|
|
33
|
-
getCompletedRootNodes(nodes: SpanNode[]): SpanNodeCompleted[];
|
|
34
|
-
/** Export a single span. */
|
|
35
21
|
export(span: ReadableSpan): void;
|
|
36
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Try to flush any pending spans immediately.
|
|
24
|
+
* This is called internally by the exporter (via _debouncedFlush),
|
|
25
|
+
* but can also be triggered externally if we force-flush.
|
|
26
|
+
*/
|
|
37
27
|
flush(): void;
|
|
38
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Clear the exporter.
|
|
30
|
+
* This is called when the span processor is shut down.
|
|
31
|
+
*/
|
|
39
32
|
clear(): void;
|
|
40
|
-
/** Clear the flush timeout. */
|
|
41
|
-
private _clearTimeout;
|
|
42
33
|
/**
|
|
43
34
|
* Send the given spans, but only if they are part of a finished transaction.
|
|
44
35
|
*
|
|
@@ -49,8 +40,13 @@ export declare class SentrySpanExporter {
|
|
|
49
40
|
* In this case, we'll eventually need to clean this up.
|
|
50
41
|
*/
|
|
51
42
|
private _maybeSend;
|
|
43
|
+
/** Remove "expired" span id entries from the _sentSpans cache. */
|
|
44
|
+
private _flushSentSpanCache;
|
|
45
|
+
/** Check if a node is a completed root node or a node whose parent has already been sent */
|
|
46
|
+
private _nodeIsCompletedRootNodeOrHasSentParent;
|
|
47
|
+
/** Get all completed root nodes from a list of nodes */
|
|
48
|
+
private _getCompletedRootNodes;
|
|
52
49
|
}
|
|
53
50
|
/** Exported only for tests. */
|
|
54
51
|
export declare function createTransactionForOtelSpan(span: ReadableSpan): TransactionEvent;
|
|
55
|
-
export {};
|
|
56
52
|
//# sourceMappingURL=spanExporter.d.ts.map
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { SerializedTraceData, Span } from '@sentry/core';
|
|
1
|
+
import { Client, Scope, SerializedTraceData, Span } from '@sentry/core';
|
|
2
2
|
/**
|
|
3
3
|
* Otel-specific implementation of `getTraceData`.
|
|
4
4
|
* @see `@sentry/core` version of `getTraceData` for more information
|
|
5
5
|
*/
|
|
6
|
-
export declare function getTraceData({ span }?: {
|
|
6
|
+
export declare function getTraceData({ span, scope, client, }?: {
|
|
7
7
|
span?: Span;
|
|
8
|
+
scope?: Scope;
|
|
9
|
+
client?: Client;
|
|
8
10
|
}): SerializedTraceData;
|
|
9
11
|
//# sourceMappingURL=getTraceData.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/opentelemetry",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.31.0",
|
|
4
4
|
"description": "Official Sentry utilities for OpenTelemetry",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/opentelemetry",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@sentry/core": "9.
|
|
42
|
+
"@sentry/core": "9.31.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@opentelemetry/api": "^1.9.0",
|