@sentry/opentelemetry 10.31.0 → 10.32.0-alpha.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 +70 -10
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.js +71 -11
- package/build/esm/index.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/types/spanExporter.d.ts +17 -2
- package/build/types/spanExporter.d.ts.map +1 -1
- package/build/types/spanProcessor.d.ts +3 -0
- package/build/types/spanProcessor.d.ts.map +1 -1
- package/build/types/streamingSpanExporter.d.ts +32 -0
- package/build/types/streamingSpanExporter.d.ts.map +1 -0
- package/build/types-ts3.8/spanExporter.d.ts +17 -2
- package/build/types-ts3.8/spanProcessor.d.ts +3 -0
- package/build/types-ts3.8/streamingSpanExporter.d.ts +32 -0
- package/package.json +2 -2
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"10.
|
|
1
|
+
{"type":"module","version":"10.32.0-alpha.0","sideEffects":false}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import type { ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
2
|
-
import type { TransactionEvent } from '@sentry/core';
|
|
2
|
+
import type { SpanOrigin, TransactionEvent, TransactionSource } from '@sentry/core';
|
|
3
|
+
export interface ISentrySpanExporter {
|
|
4
|
+
export(span: ReadableSpan): void;
|
|
5
|
+
flush(): void;
|
|
6
|
+
clear(): void;
|
|
7
|
+
}
|
|
3
8
|
/**
|
|
4
9
|
* A Sentry-specific exporter that converts OpenTelemetry Spans to Sentry Spans & Transactions.
|
|
5
10
|
*/
|
|
6
|
-
export declare class SentrySpanExporter {
|
|
11
|
+
export declare class SentrySpanExporter implements ISentrySpanExporter {
|
|
7
12
|
private _finishedSpanBuckets;
|
|
8
13
|
private _finishedSpanBucketSize;
|
|
9
14
|
private _spansToBucketEntry;
|
|
@@ -49,4 +54,14 @@ export declare class SentrySpanExporter {
|
|
|
49
54
|
}
|
|
50
55
|
/** Exported only for tests. */
|
|
51
56
|
export declare function createTransactionForOtelSpan(span: ReadableSpan): TransactionEvent;
|
|
57
|
+
/**
|
|
58
|
+
* Get span data from the OTEL span
|
|
59
|
+
*/
|
|
60
|
+
export declare function getSpanData(span: ReadableSpan): {
|
|
61
|
+
data: Record<string, unknown>;
|
|
62
|
+
op?: string;
|
|
63
|
+
description: string;
|
|
64
|
+
source?: TransactionSource;
|
|
65
|
+
origin?: SpanOrigin;
|
|
66
|
+
};
|
|
52
67
|
//# 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,
|
|
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,EAGV,UAAU,EAEV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAoCtB,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IACjC,KAAK,IAAI,IAAI,CAAC;IACd,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;GAEG;AACH,qBAAa,kBAAmB,YAAW,mBAAmB;IAiB5D,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;IA4ClB,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;AA0DD;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,YAAY,GAAG;IAC/C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAgBA"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import type { Context } from '@opentelemetry/api';
|
|
2
2
|
import type { ReadableSpan, Span, SpanProcessor as SpanProcessorInterface } from '@opentelemetry/sdk-trace-base';
|
|
3
|
+
import type { Client } from '@sentry/core';
|
|
3
4
|
/**
|
|
4
5
|
* Converts OpenTelemetry Spans to Sentry Spans and sends them to Sentry via
|
|
5
6
|
* the Sentry SDK.
|
|
6
7
|
*/
|
|
7
8
|
export declare class SentrySpanProcessor implements SpanProcessorInterface {
|
|
8
9
|
private _exporter;
|
|
10
|
+
private _client;
|
|
9
11
|
constructor(options?: {
|
|
10
12
|
timeout?: number;
|
|
13
|
+
client?: Client;
|
|
11
14
|
});
|
|
12
15
|
/**
|
|
13
16
|
* @inheritDoc
|
|
@@ -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,YAAY,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;AACjH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAqD3C;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,sBAAsB;IAChE,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,OAAO,CAAqB;gBAEjB,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;IAUlE;;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;IAIxD,kBAAkB;IACX,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,YAAY,GAAG,IAAI;CAO9C"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
2
|
+
import type { Client, Span } from '@sentry/core';
|
|
3
|
+
import { type ISentrySpanExporter } from './spanExporter';
|
|
4
|
+
type StreamingSpanExporterOptions = {
|
|
5
|
+
flushInterval?: number;
|
|
6
|
+
maxSpanLimit?: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A Sentry-specific exporter that buffers span JSON objects and streams them to Sentry
|
|
10
|
+
* in Span v2 envelopes. This exporter works with pre-serialized span JSON rather than
|
|
11
|
+
* OTel span instances to avoid mutating already-ended spans.
|
|
12
|
+
*/
|
|
13
|
+
export declare class StreamingSpanExporter implements ISentrySpanExporter {
|
|
14
|
+
private _buffer;
|
|
15
|
+
private _client;
|
|
16
|
+
constructor(client: Client, options?: StreamingSpanExporterOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Enqueue a span JSON into the buffer
|
|
19
|
+
*/
|
|
20
|
+
export(span: ReadableSpan & Span): void;
|
|
21
|
+
/**
|
|
22
|
+
* Try to flush any pending spans immediately.
|
|
23
|
+
*/
|
|
24
|
+
flush(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Clear the exporter.
|
|
27
|
+
* This is called when the span processor is shut down.
|
|
28
|
+
*/
|
|
29
|
+
clear(): void;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=streamingSpanExporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"streamingSpanExporter.d.ts","sourceRoot":"","sources":["../../src/streamingSpanExporter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAQjD,OAAO,EAAe,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAEvE,KAAK,4BAA4B,GAAG;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,qBAAa,qBAAsB,YAAW,mBAAmB;IAC/D,OAAO,CAAC,OAAO,CAAa;IAC5B,OAAO,CAAC,OAAO,CAAS;gBAEL,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,4BAA4B;IA2BzE;;OAEG;IACI,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,GAAG,IAAI;IAI9C;;OAEG;IACI,KAAK,IAAI,IAAI;IAIpB;;;OAGG;IACI,KAAK,IAAI,IAAI;CAGrB"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
2
|
-
import { TransactionEvent } from '@sentry/core';
|
|
2
|
+
import { SpanOrigin, TransactionEvent, TransactionSource } from '@sentry/core';
|
|
3
|
+
export interface ISentrySpanExporter {
|
|
4
|
+
export(span: ReadableSpan): void;
|
|
5
|
+
flush(): void;
|
|
6
|
+
clear(): void;
|
|
7
|
+
}
|
|
3
8
|
/**
|
|
4
9
|
* A Sentry-specific exporter that converts OpenTelemetry Spans to Sentry Spans & Transactions.
|
|
5
10
|
*/
|
|
6
|
-
export declare class SentrySpanExporter {
|
|
11
|
+
export declare class SentrySpanExporter implements ISentrySpanExporter {
|
|
7
12
|
private _finishedSpanBuckets;
|
|
8
13
|
private _finishedSpanBucketSize;
|
|
9
14
|
private _spansToBucketEntry;
|
|
@@ -49,4 +54,14 @@ export declare class SentrySpanExporter {
|
|
|
49
54
|
}
|
|
50
55
|
/** Exported only for tests. */
|
|
51
56
|
export declare function createTransactionForOtelSpan(span: ReadableSpan): TransactionEvent;
|
|
57
|
+
/**
|
|
58
|
+
* Get span data from the OTEL span
|
|
59
|
+
*/
|
|
60
|
+
export declare function getSpanData(span: ReadableSpan): {
|
|
61
|
+
data: Record<string, unknown>;
|
|
62
|
+
op?: string;
|
|
63
|
+
description: string;
|
|
64
|
+
source?: TransactionSource;
|
|
65
|
+
origin?: SpanOrigin;
|
|
66
|
+
};
|
|
52
67
|
//# sourceMappingURL=spanExporter.d.ts.map
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { Context } from '@opentelemetry/api';
|
|
2
2
|
import { ReadableSpan, Span, SpanProcessor as SpanProcessorInterface } from '@opentelemetry/sdk-trace-base';
|
|
3
|
+
import { Client } from '@sentry/core';
|
|
3
4
|
/**
|
|
4
5
|
* Converts OpenTelemetry Spans to Sentry Spans and sends them to Sentry via
|
|
5
6
|
* the Sentry SDK.
|
|
6
7
|
*/
|
|
7
8
|
export declare class SentrySpanProcessor implements SpanProcessorInterface {
|
|
8
9
|
private _exporter;
|
|
10
|
+
private _client;
|
|
9
11
|
constructor(options?: {
|
|
10
12
|
timeout?: number;
|
|
13
|
+
client?: Client;
|
|
11
14
|
});
|
|
12
15
|
/**
|
|
13
16
|
* @inheritDoc
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
2
|
+
import { Client, Span } from '@sentry/core';
|
|
3
|
+
import { ISentrySpanExporter } from './spanExporter';
|
|
4
|
+
type StreamingSpanExporterOptions = {
|
|
5
|
+
flushInterval?: number;
|
|
6
|
+
maxSpanLimit?: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* A Sentry-specific exporter that buffers span JSON objects and streams them to Sentry
|
|
10
|
+
* in Span v2 envelopes. This exporter works with pre-serialized span JSON rather than
|
|
11
|
+
* OTel span instances to avoid mutating already-ended spans.
|
|
12
|
+
*/
|
|
13
|
+
export declare class StreamingSpanExporter implements ISentrySpanExporter {
|
|
14
|
+
private _buffer;
|
|
15
|
+
private _client;
|
|
16
|
+
constructor(client: Client, options?: StreamingSpanExporterOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Enqueue a span JSON into the buffer
|
|
19
|
+
*/
|
|
20
|
+
export(span: ReadableSpan & Span): void;
|
|
21
|
+
/**
|
|
22
|
+
* Try to flush any pending spans immediately.
|
|
23
|
+
*/
|
|
24
|
+
flush(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Clear the exporter.
|
|
27
|
+
* This is called when the span processor is shut down.
|
|
28
|
+
*/
|
|
29
|
+
clear(): void;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=streamingSpanExporter.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/opentelemetry",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.32.0-alpha.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": "10.
|
|
42
|
+
"@sentry/core": "10.32.0-alpha.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@opentelemetry/api": "^1.9.0",
|