@sentry/opentelemetry 8.0.0-alpha.5 → 8.0.0-alpha.7
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/cjs/index.js +152 -80
- package/cjs/index.js.map +1 -1
- package/esm/index.js +156 -84
- package/esm/index.js.map +1 -1
- package/package.json +4 -4
- package/types/propagator.d.ts +4 -0
- package/types/propagator.d.ts.map +1 -1
- package/types/spanExporter.d.ts +16 -10
- package/types/spanExporter.d.ts.map +1 -1
- package/types/spanProcessor.d.ts +12 -9
- package/types/spanProcessor.d.ts.map +1 -1
- package/types/trace.d.ts +9 -8
- package/types/trace.d.ts.map +1 -1
- package/types/utils/groupSpansWithParents.d.ts +4 -0
- package/types/utils/groupSpansWithParents.d.ts.map +1 -1
- package/types-ts3.8/propagator.d.ts +4 -0
- package/types-ts3.8/spanExporter.d.ts +16 -10
- package/types-ts3.8/spanProcessor.d.ts +12 -9
- package/types-ts3.8/trace.d.ts +9 -8
- package/types-ts3.8/utils/groupSpansWithParents.d.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/opentelemetry",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.7",
|
|
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",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@sentry/core": "8.0.0-alpha.
|
|
46
|
-
"@sentry/types": "8.0.0-alpha.
|
|
47
|
-
"@sentry/utils": "8.0.0-alpha.
|
|
45
|
+
"@sentry/core": "8.0.0-alpha.7",
|
|
46
|
+
"@sentry/types": "8.0.0-alpha.7",
|
|
47
|
+
"@sentry/utils": "8.0.0-alpha.7"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"@opentelemetry/api": "^1.0.0",
|
package/types/propagator.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ export declare function getPropagationContextFromSpanContext(spanContext: SpanCo
|
|
|
8
8
|
* Injects and extracts `sentry-trace` and `baggage` headers from carriers.
|
|
9
9
|
*/
|
|
10
10
|
export declare class SentryPropagator extends W3CBaggagePropagator {
|
|
11
|
+
/** A map of URLs that have already been checked for if they match tracePropagationTargets. */
|
|
12
|
+
private _urlMatchesTargetsMap;
|
|
11
13
|
constructor();
|
|
12
14
|
/**
|
|
13
15
|
* @inheritDoc
|
|
@@ -21,6 +23,8 @@ export declare class SentryPropagator extends W3CBaggagePropagator {
|
|
|
21
23
|
* @inheritDoc
|
|
22
24
|
*/
|
|
23
25
|
fields(): string[];
|
|
26
|
+
/** If we want to inject trace data for a given URL. */
|
|
27
|
+
private _shouldInjectTraceData;
|
|
24
28
|
}
|
|
25
29
|
/** Exported for tests. */
|
|
26
30
|
export declare function makeTraceState({ parentSpanId, dsc, sampled, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propagator.d.ts","sourceRoot":"","sources":["../../src/propagator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGtG,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAuB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"propagator.d.ts","sourceRoot":"","sources":["../../src/propagator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGtG,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAuB,MAAM,qBAAqB,CAAC;AAE5F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAGlD,OAAO,KAAK,EAAE,sBAAsB,EAAW,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAuBzF,8DAA8D;AAC9D,wBAAgB,oCAAoC,CAAC,WAAW,EAAE,WAAW,GAAG,kBAAkB,CAgBjG;AAED;;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;IAqC9E;;OAEG;IACI,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO;IA0BlF;;OAEG;IACI,MAAM,IAAI,MAAM,EAAE;IAIzB,uDAAuD;IACvD,OAAO,CAAC,sBAAsB;CAc/B;AAED,0BAA0B;AAC1B,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,GAAG,EACH,OAAO,GACR,EAAE;IACD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,UAAU,GAAG,SAAS,CAiBzB;AAyGD;;;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;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,GAAG,SAAS,CA6BjF"}
|
package/types/spanExporter.d.ts
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
1
|
+
import type { ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
3
2
|
/**
|
|
4
3
|
* A Sentry-specific exporter that converts OpenTelemetry Spans to Sentry Spans & Transactions.
|
|
5
4
|
*/
|
|
6
|
-
export declare class SentrySpanExporter
|
|
5
|
+
export declare class SentrySpanExporter {
|
|
6
|
+
private _flushTimeout;
|
|
7
7
|
private _finishedSpans;
|
|
8
|
-
private _stopped;
|
|
9
8
|
constructor();
|
|
10
|
-
/**
|
|
11
|
-
export(
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
|
|
9
|
+
/** Export a single span. */
|
|
10
|
+
export(span: ReadableSpan): void;
|
|
11
|
+
/** Try to flush any pending spans immediately. */
|
|
12
|
+
flush(): void;
|
|
13
|
+
/** Clear the exporter. */
|
|
14
|
+
clear(): void;
|
|
15
|
+
/** Clear the flush timeout. */
|
|
16
|
+
private _clearTimeout;
|
|
17
|
+
/**
|
|
18
|
+
* Remove any span that is older than 5min.
|
|
19
|
+
* We do this to avoid leaking memory.
|
|
20
|
+
*/
|
|
21
|
+
private _cleanupOldSpans;
|
|
16
22
|
}
|
|
17
23
|
//# sourceMappingURL=spanExporter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spanExporter.d.ts","sourceRoot":"","sources":["../../src/spanExporter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"spanExporter.d.ts","sourceRoot":"","sources":["../../src/spanExporter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AA2BlE;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,aAAa,CAA4C;IACjE,OAAO,CAAC,cAAc,CAAiB;;IAMvC,4BAA4B;IACrB,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;IAoBvC,kDAAkD;IAC3C,KAAK,IAAI,IAAI;IAgBpB,0BAA0B;IACnB,KAAK,IAAI,IAAI;IAKpB,+BAA+B;IAC/B,OAAO,CAAC,aAAa;IAOrB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;CAazB"}
|
package/types/spanProcessor.d.ts
CHANGED
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import type { Context } from '@opentelemetry/api';
|
|
2
|
-
import type { Span, SpanProcessor as SpanProcessorInterface } from '@opentelemetry/sdk-trace-base';
|
|
3
|
-
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
2
|
+
import type { ReadableSpan, Span, SpanProcessor as SpanProcessorInterface } from '@opentelemetry/sdk-trace-base';
|
|
4
3
|
/**
|
|
5
4
|
* Converts OpenTelemetry Spans to Sentry Spans and sends them to Sentry via
|
|
6
5
|
* the Sentry SDK.
|
|
7
6
|
*/
|
|
8
|
-
export declare class SentrySpanProcessor
|
|
7
|
+
export declare class SentrySpanProcessor implements SpanProcessorInterface {
|
|
8
|
+
private _exporter;
|
|
9
9
|
constructor();
|
|
10
10
|
/**
|
|
11
11
|
* @inheritDoc
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
|
|
13
|
+
forceFlush(): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
17
|
+
shutdown(): Promise<void>;
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
18
|
-
* If you return `false` here, the span will not be passed to the exporter and thus not be sent.
|
|
19
|
+
* @inheritDoc
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
|
+
onStart(span: Span, parentContext: Context): void;
|
|
22
|
+
/** @inheritDoc */
|
|
23
|
+
onEnd(span: ReadableSpan): void;
|
|
21
24
|
}
|
|
22
25
|
//# sourceMappingURL=spanProcessor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spanProcessor.d.ts","sourceRoot":"","sources":["../../src/spanProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,IAAI,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"spanProcessor.d.ts","sourceRoot":"","sources":["../../src/spanProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,IAAI,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAkDjH;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,sBAAsB;IAChE,OAAO,CAAC,SAAS,CAAqB;;IAOtC;;OAEG;IACU,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxC;;OAEG;IACU,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAItC;;OAEG;IACI,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,GAAG,IAAI;IASxD,kBAAkB;IACX,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;CAYvC"}
|
package/types/trace.d.ts
CHANGED
|
@@ -5,11 +5,12 @@ import type { OpenTelemetrySpanContext } from './types';
|
|
|
5
5
|
/**
|
|
6
6
|
* Wraps a function with a transaction/span and finishes the span after the function is done.
|
|
7
7
|
* The created span is the active span and will be used as parent by other spans created inside the function
|
|
8
|
-
* and can be accessed via `Sentry.
|
|
8
|
+
* and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active.
|
|
9
9
|
*
|
|
10
10
|
* If you want to create a span that is not set as active, use {@link startInactiveSpan}.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* You'll always get a span passed to the callback,
|
|
13
|
+
* it may just be a non-recording span if the span is not sampled or if tracing is disabled.
|
|
13
14
|
*/
|
|
14
15
|
export declare function startSpan<T>(options: OpenTelemetrySpanContext, callback: (span: Span) => T): T;
|
|
15
16
|
/**
|
|
@@ -19,7 +20,8 @@ export declare function startSpan<T>(options: OpenTelemetrySpanContext, callback
|
|
|
19
20
|
* The created span is the active span and will be used as parent by other spans created inside the function
|
|
20
21
|
* and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active.
|
|
21
22
|
*
|
|
22
|
-
*
|
|
23
|
+
* You'll always get a span passed to the callback,
|
|
24
|
+
* it may just be a non-recording span if the span is not sampled or if tracing is disabled.
|
|
23
25
|
*/
|
|
24
26
|
export declare function startSpanManual<T>(options: OpenTelemetrySpanContext, callback: (span: Span, finish: () => void) => T): T;
|
|
25
27
|
/**
|
|
@@ -28,13 +30,12 @@ export declare function startSpanManual<T>(options: OpenTelemetrySpanContext, ca
|
|
|
28
30
|
export declare const startActiveSpan: typeof startSpan;
|
|
29
31
|
/**
|
|
30
32
|
* Creates a span. This span is not set as active, so will not get automatic instrumentation spans
|
|
31
|
-
* as children or be able to be accessed via `Sentry.
|
|
33
|
+
* as children or be able to be accessed via `Sentry.getActiveSpan()`.
|
|
32
34
|
*
|
|
33
35
|
* If you want to create a span that is set as active, use {@link startSpan}.
|
|
34
36
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* and the `span` returned from the callback will be undefined.
|
|
37
|
+
* This function will always return a span,
|
|
38
|
+
* it may just be a non-recording span if the span is not sampled or if tracing is disabled.
|
|
38
39
|
*/
|
|
39
40
|
export declare function startInactiveSpan(options: OpenTelemetrySpanContext): Span;
|
|
40
41
|
/**
|
|
@@ -42,7 +43,7 @@ export declare function startInactiveSpan(options: OpenTelemetrySpanContext): Sp
|
|
|
42
43
|
* passed `null` to start an entirely new span tree.
|
|
43
44
|
*
|
|
44
45
|
* @param span Spans started in the context of the provided callback will be children of this span. If `null` is passed,
|
|
45
|
-
* spans started within the callback will
|
|
46
|
+
* spans started within the callback will be root spans.
|
|
46
47
|
* @param callback Execution context in which the provided span will be active. Is passed the newly forked scope.
|
|
47
48
|
* @returns the value returned from the provided callback function.
|
|
48
49
|
*/
|
package/types/trace.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../src/trace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,IAAI,EAAoC,MAAM,oBAAoB,CAAC;AAK1F,OAAO,EAGL,aAAa,IAAI,iBAAiB,
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../src/trace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,IAAI,EAAoC,MAAM,oBAAoB,CAAC;AAK1F,OAAO,EAGL,aAAa,IAAI,iBAAiB,EAOnC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAU,KAAK,EAAE,MAAM,eAAe,CAAC;AAGnD,OAAO,KAAK,EAAuB,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAI7E;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,GAAG,CAAC,CAyB9F;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,OAAO,EAAE,wBAAwB,EACjC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,IAAI,KAAK,CAAC,GAC9C,CAAC,CAwBH;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,kBAAY,CAAC;AAEzC;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,CAgBzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,CAAC,GAAG,CAAC,CAGrF;AAuHD;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAIvG"}
|
|
@@ -10,4 +10,8 @@ export interface SpanNode {
|
|
|
10
10
|
* where each node holds a reference to their parent node.
|
|
11
11
|
*/
|
|
12
12
|
export declare function groupSpansWithParents(spans: ReadableSpan[]): SpanNode[];
|
|
13
|
+
/**
|
|
14
|
+
* This returns the _local_ parent ID - `parentId` on the span may point to a remote span.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getLocalParentId(span: ReadableSpan): string | undefined;
|
|
13
17
|
//# sourceMappingURL=groupSpansWithParents.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupSpansWithParents.d.ts","sourceRoot":"","sources":["../../../src/utils/groupSpansWithParents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAGlE,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,UAAU,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAClC,QAAQ,EAAE,QAAQ,EAAE,CAAC;CACtB;AAID;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,QAAQ,EAAE,CAUvE"}
|
|
1
|
+
{"version":3,"file":"groupSpansWithParents.d.ts","sourceRoot":"","sources":["../../../src/utils/groupSpansWithParents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAGlE,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,UAAU,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;IAClC,QAAQ,EAAE,QAAQ,EAAE,CAAC;CACtB;AAID;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,QAAQ,EAAE,CAUvE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAKvE"}
|
|
@@ -8,6 +8,8 @@ export declare function getPropagationContextFromSpanContext(spanContext: SpanCo
|
|
|
8
8
|
* Injects and extracts `sentry-trace` and `baggage` headers from carriers.
|
|
9
9
|
*/
|
|
10
10
|
export declare class SentryPropagator extends W3CBaggagePropagator {
|
|
11
|
+
/** A map of URLs that have already been checked for if they match tracePropagationTargets. */
|
|
12
|
+
private _urlMatchesTargetsMap;
|
|
11
13
|
constructor();
|
|
12
14
|
/**
|
|
13
15
|
* @inheritDoc
|
|
@@ -21,6 +23,8 @@ export declare class SentryPropagator extends W3CBaggagePropagator {
|
|
|
21
23
|
* @inheritDoc
|
|
22
24
|
*/
|
|
23
25
|
fields(): string[];
|
|
26
|
+
/** If we want to inject trace data for a given URL. */
|
|
27
|
+
private _shouldInjectTraceData;
|
|
24
28
|
}
|
|
25
29
|
/** Exported for tests. */
|
|
26
30
|
export declare function makeTraceState({ parentSpanId, dsc, sampled, }: {
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ReadableSpan, SpanExporter } from '@opentelemetry/sdk-trace-base';
|
|
1
|
+
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
3
2
|
/**
|
|
4
3
|
* A Sentry-specific exporter that converts OpenTelemetry Spans to Sentry Spans & Transactions.
|
|
5
4
|
*/
|
|
6
|
-
export declare class SentrySpanExporter
|
|
5
|
+
export declare class SentrySpanExporter {
|
|
6
|
+
private _flushTimeout;
|
|
7
7
|
private _finishedSpans;
|
|
8
|
-
private _stopped;
|
|
9
8
|
constructor();
|
|
10
|
-
/**
|
|
11
|
-
export(
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
|
|
9
|
+
/** Export a single span. */
|
|
10
|
+
export(span: ReadableSpan): void;
|
|
11
|
+
/** Try to flush any pending spans immediately. */
|
|
12
|
+
flush(): void;
|
|
13
|
+
/** Clear the exporter. */
|
|
14
|
+
clear(): void;
|
|
15
|
+
/** Clear the flush timeout. */
|
|
16
|
+
private _clearTimeout;
|
|
17
|
+
/**
|
|
18
|
+
* Remove any span that is older than 5min.
|
|
19
|
+
* We do this to avoid leaking memory.
|
|
20
|
+
*/
|
|
21
|
+
private _cleanupOldSpans;
|
|
16
22
|
}
|
|
17
23
|
//# sourceMappingURL=spanExporter.d.ts.map
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import { Context } from '@opentelemetry/api';
|
|
2
|
-
import { Span, SpanProcessor as SpanProcessorInterface } from '@opentelemetry/sdk-trace-base';
|
|
3
|
-
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
2
|
+
import { ReadableSpan, Span, SpanProcessor as SpanProcessorInterface } from '@opentelemetry/sdk-trace-base';
|
|
4
3
|
/**
|
|
5
4
|
* Converts OpenTelemetry Spans to Sentry Spans and sends them to Sentry via
|
|
6
5
|
* the Sentry SDK.
|
|
7
6
|
*/
|
|
8
|
-
export declare class SentrySpanProcessor
|
|
7
|
+
export declare class SentrySpanProcessor implements SpanProcessorInterface {
|
|
8
|
+
private _exporter;
|
|
9
9
|
constructor();
|
|
10
10
|
/**
|
|
11
11
|
* @inheritDoc
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
|
|
13
|
+
forceFlush(): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
17
|
+
shutdown(): Promise<void>;
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
18
|
-
* If you return `false` here, the span will not be passed to the exporter and thus not be sent.
|
|
19
|
+
* @inheritDoc
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
|
+
onStart(span: Span, parentContext: Context): void;
|
|
22
|
+
/** @inheritDoc */
|
|
23
|
+
onEnd(span: ReadableSpan): void;
|
|
21
24
|
}
|
|
22
25
|
//# sourceMappingURL=spanProcessor.d.ts.map
|
package/types-ts3.8/trace.d.ts
CHANGED
|
@@ -5,11 +5,12 @@ import { OpenTelemetrySpanContext } from './types';
|
|
|
5
5
|
/**
|
|
6
6
|
* Wraps a function with a transaction/span and finishes the span after the function is done.
|
|
7
7
|
* The created span is the active span and will be used as parent by other spans created inside the function
|
|
8
|
-
* and can be accessed via `Sentry.
|
|
8
|
+
* and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active.
|
|
9
9
|
*
|
|
10
10
|
* If you want to create a span that is not set as active, use {@link startInactiveSpan}.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* You'll always get a span passed to the callback,
|
|
13
|
+
* it may just be a non-recording span if the span is not sampled or if tracing is disabled.
|
|
13
14
|
*/
|
|
14
15
|
export declare function startSpan<T>(options: OpenTelemetrySpanContext, callback: (span: Span) => T): T;
|
|
15
16
|
/**
|
|
@@ -19,7 +20,8 @@ export declare function startSpan<T>(options: OpenTelemetrySpanContext, callback
|
|
|
19
20
|
* The created span is the active span and will be used as parent by other spans created inside the function
|
|
20
21
|
* and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active.
|
|
21
22
|
*
|
|
22
|
-
*
|
|
23
|
+
* You'll always get a span passed to the callback,
|
|
24
|
+
* it may just be a non-recording span if the span is not sampled or if tracing is disabled.
|
|
23
25
|
*/
|
|
24
26
|
export declare function startSpanManual<T>(options: OpenTelemetrySpanContext, callback: (span: Span, finish: () => void) => T): T;
|
|
25
27
|
/**
|
|
@@ -28,13 +30,12 @@ export declare function startSpanManual<T>(options: OpenTelemetrySpanContext, ca
|
|
|
28
30
|
export declare const startActiveSpan: typeof startSpan;
|
|
29
31
|
/**
|
|
30
32
|
* Creates a span. This span is not set as active, so will not get automatic instrumentation spans
|
|
31
|
-
* as children or be able to be accessed via `Sentry.
|
|
33
|
+
* as children or be able to be accessed via `Sentry.getActiveSpan()`.
|
|
32
34
|
*
|
|
33
35
|
* If you want to create a span that is set as active, use {@link startSpan}.
|
|
34
36
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* and the `span` returned from the callback will be undefined.
|
|
37
|
+
* This function will always return a span,
|
|
38
|
+
* it may just be a non-recording span if the span is not sampled or if tracing is disabled.
|
|
38
39
|
*/
|
|
39
40
|
export declare function startInactiveSpan(options: OpenTelemetrySpanContext): Span;
|
|
40
41
|
/**
|
|
@@ -42,7 +43,7 @@ export declare function startInactiveSpan(options: OpenTelemetrySpanContext): Sp
|
|
|
42
43
|
* passed `null` to start an entirely new span tree.
|
|
43
44
|
*
|
|
44
45
|
* @param span Spans started in the context of the provided callback will be children of this span. If `null` is passed,
|
|
45
|
-
* spans started within the callback will
|
|
46
|
+
* spans started within the callback will be root spans.
|
|
46
47
|
* @param callback Execution context in which the provided span will be active. Is passed the newly forked scope.
|
|
47
48
|
* @returns the value returned from the provided callback function.
|
|
48
49
|
*/
|
|
@@ -10,4 +10,8 @@ export interface SpanNode {
|
|
|
10
10
|
* where each node holds a reference to their parent node.
|
|
11
11
|
*/
|
|
12
12
|
export declare function groupSpansWithParents(spans: ReadableSpan[]): SpanNode[];
|
|
13
|
+
/**
|
|
14
|
+
* This returns the _local_ parent ID - `parentId` on the span may point to a remote span.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getLocalParentId(span: ReadableSpan): string | undefined;
|
|
13
17
|
//# sourceMappingURL=groupSpansWithParents.d.ts.map
|