@sentry/opentelemetry 10.70.0 → 11.0.0-alpha.1
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/README.md +2 -15
- package/build/cjs/index.js +614 -101
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.js +611 -65
- package/build/esm/index.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/types/asyncContextStrategy.d.ts +2 -4
- package/build/types/asyncContextStrategy.d.ts.map +1 -1
- package/build/types/asyncLocalStorageContextManager.d.ts +16 -4
- package/build/types/asyncLocalStorageContextManager.d.ts.map +1 -1
- package/build/types/constants.d.ts +0 -15
- package/build/types/constants.d.ts.map +1 -1
- package/build/types/index.d.ts +5 -4
- package/build/types/index.d.ts.map +1 -1
- package/build/types/propagator.d.ts +11 -38
- package/build/types/propagator.d.ts.map +1 -1
- package/build/types/trace.d.ts +4 -31
- package/build/types/trace.d.ts.map +1 -1
- package/build/types/tracer.d.ts.map +1 -1
- package/build/types/tracerProvider.d.ts +0 -9
- package/build/types/tracerProvider.d.ts.map +1 -1
- package/build/types/types.d.ts +1 -24
- package/build/types/types.d.ts.map +1 -1
- package/build/types/utils/TraceState.d.ts.map +1 -1
- package/build/types/utils/buildContextWithSentryScopes.d.ts +1 -1
- package/build/types/utils/buildContextWithSentryScopes.d.ts.map +1 -1
- package/build/types/utils/contextData.d.ts.map +1 -1
- package/build/types/utils/getActiveSpan.d.ts +2 -1
- package/build/types/utils/getActiveSpan.d.ts.map +1 -1
- package/build/types/utils/getSamplingDecision.d.ts +0 -17
- package/build/types/utils/getSamplingDecision.d.ts.map +1 -1
- package/build/types/utils/reconcileDscSampled.d.ts +14 -0
- package/build/types/utils/reconcileDscSampled.d.ts.map +1 -0
- package/build/types/utils/suppressTracing.d.ts +5 -4
- package/build/types/utils/suppressTracing.d.ts.map +1 -1
- package/package.json +11 -38
- package/build/cjs/asyncContextStrategy-volGaYqZ.js +0 -1892
- package/build/cjs/asyncContextStrategy-volGaYqZ.js.map +0 -1
- package/build/cjs/index.browser.js +0 -53
- package/build/cjs/index.browser.js.map +0 -1
- package/build/esm/asyncContextStrategy-jD8YWNDU.js +0 -1857
- package/build/esm/asyncContextStrategy-jD8YWNDU.js.map +0 -1
- package/build/esm/index.browser.js +0 -14
- package/build/esm/index.browser.js.map +0 -1
- package/build/types/applyOtelSpanData.d.ts +0 -18
- package/build/types/applyOtelSpanData.d.ts.map +0 -1
- package/build/types/contextManager.d.ts +0 -22
- package/build/types/contextManager.d.ts.map +0 -1
- package/build/types/custom/client.d.ts +0 -12
- package/build/types/custom/client.d.ts.map +0 -1
- package/build/types/exports.d.ts +0 -27
- package/build/types/exports.d.ts.map +0 -1
- package/build/types/index.browser.d.ts +0 -10
- package/build/types/index.browser.d.ts.map +0 -1
- package/build/types/nodeAsyncContextStrategy.d.ts +0 -4
- package/build/types/nodeAsyncContextStrategy.d.ts.map +0 -1
- package/build/types/resource.d.ts +0 -26
- package/build/types/resource.d.ts.map +0 -1
- package/build/types/sampler.d.ts +0 -32
- package/build/types/sampler.d.ts.map +0 -1
- package/build/types/semanticAttributes.d.ts +0 -4
- package/build/types/semanticAttributes.d.ts.map +0 -1
- package/build/types/setupEventContextTrace.d.ts +0 -4
- package/build/types/setupEventContextTrace.d.ts.map +0 -1
- package/build/types/spanExporter.d.ts +0 -50
- package/build/types/spanExporter.d.ts.map +0 -1
- package/build/types/spanProcessor.d.ts +0 -31
- package/build/types/spanProcessor.d.ts.map +0 -1
- package/build/types/utils/backfillStreamedSpanData.d.ts +0 -16
- package/build/types/utils/backfillStreamedSpanData.d.ts.map +0 -1
- package/build/types/utils/enhanceDscWithOpenTelemetryRootSpanName.d.ts +0 -7
- package/build/types/utils/enhanceDscWithOpenTelemetryRootSpanName.d.ts.map +0 -1
- package/build/types/utils/getParentSpanId.d.ts +0 -8
- package/build/types/utils/getParentSpanId.d.ts.map +0 -1
- package/build/types/utils/getRequestSpanData.d.ts +0 -8
- package/build/types/utils/getRequestSpanData.d.ts.map +0 -1
- package/build/types/utils/getSpanKind.d.ts +0 -10
- package/build/types/utils/getSpanKind.d.ts.map +0 -1
- package/build/types/utils/getTraceData.d.ts +0 -12
- package/build/types/utils/getTraceData.d.ts.map +0 -1
- package/build/types/utils/groupSpansWithParents.d.ts +0 -17
- package/build/types/utils/groupSpansWithParents.d.ts.map +0 -1
- package/build/types/utils/isSentryRequest.d.ts +0 -8
- package/build/types/utils/isSentryRequest.d.ts.map +0 -1
- package/build/types/utils/mapStatus.d.ts +0 -9
- package/build/types/utils/mapStatus.d.ts.map +0 -1
- package/build/types/utils/parseSpanDescription.d.ts +0 -56
- package/build/types/utils/parseSpanDescription.d.ts.map +0 -1
- package/build/types/utils/setupCheck.d.ts +0 -9
- package/build/types/utils/setupCheck.d.ts.map +0 -1
- package/build/types/utils/spanTypes.d.ts +0 -52
- package/build/types/utils/spanTypes.d.ts.map +0 -1
- package/build/types-ts3.8/applyOtelSpanData.d.ts +0 -18
- package/build/types-ts3.8/asyncContextStrategy.d.ts +0 -9
- package/build/types-ts3.8/asyncLocalStorageContextManager.d.ts +0 -31
- package/build/types-ts3.8/constants.d.ts +0 -24
- package/build/types-ts3.8/contextManager.d.ts +0 -22
- package/build/types-ts3.8/custom/client.d.ts +0 -12
- package/build/types-ts3.8/debug-build.d.ts +0 -7
- package/build/types-ts3.8/exports.d.ts +0 -27
- package/build/types-ts3.8/index.browser.d.ts +0 -10
- package/build/types-ts3.8/index.d.ts +0 -5
- package/build/types-ts3.8/nodeAsyncContextStrategy.d.ts +0 -4
- package/build/types-ts3.8/propagator.d.ts +0 -43
- package/build/types-ts3.8/resource.d.ts +0 -29
- package/build/types-ts3.8/sampler.d.ts +0 -32
- package/build/types-ts3.8/semanticAttributes.d.ts +0 -4
- package/build/types-ts3.8/setupEventContextTrace.d.ts +0 -4
- package/build/types-ts3.8/spanExporter.d.ts +0 -50
- package/build/types-ts3.8/spanProcessor.d.ts +0 -31
- package/build/types-ts3.8/trace.d.ts +0 -75
- package/build/types-ts3.8/tracer.d.ts +0 -13
- package/build/types-ts3.8/tracerProvider.d.ts +0 -23
- package/build/types-ts3.8/types.d.ts +0 -29
- package/build/types-ts3.8/utils/TraceState.d.ts +0 -21
- package/build/types-ts3.8/utils/backfillStreamedSpanData.d.ts +0 -16
- package/build/types-ts3.8/utils/buildContextWithSentryScopes.d.ts +0 -12
- package/build/types-ts3.8/utils/contextData.d.ts +0 -30
- package/build/types-ts3.8/utils/enhanceDscWithOpenTelemetryRootSpanName.d.ts +0 -7
- package/build/types-ts3.8/utils/getActiveSpan.d.ts +0 -6
- package/build/types-ts3.8/utils/getParentSpanId.d.ts +0 -8
- package/build/types-ts3.8/utils/getRequestSpanData.d.ts +0 -8
- package/build/types-ts3.8/utils/getSamplingDecision.d.ts +0 -27
- package/build/types-ts3.8/utils/getSpanKind.d.ts +0 -10
- package/build/types-ts3.8/utils/getTraceData.d.ts +0 -12
- package/build/types-ts3.8/utils/groupSpansWithParents.d.ts +0 -17
- package/build/types-ts3.8/utils/isSentryRequest.d.ts +0 -8
- package/build/types-ts3.8/utils/makeTraceState.d.ts +0 -10
- package/build/types-ts3.8/utils/mapStatus.d.ts +0 -9
- package/build/types-ts3.8/utils/parseSpanDescription.d.ts +0 -56
- package/build/types-ts3.8/utils/setupCheck.d.ts +0 -9
- package/build/types-ts3.8/utils/spanTypes.d.ts +0 -52
- package/build/types-ts3.8/utils/suppressTracing.d.ts +0 -5
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Span } from '@opentelemetry/api';
|
|
2
|
+
import type { Scope } from '@sentry/core';
|
|
2
3
|
/**
|
|
3
4
|
* Returns the currently active span.
|
|
4
5
|
*/
|
|
5
|
-
export declare function getActiveSpan(): Span | undefined;
|
|
6
|
+
export declare function getActiveSpan(scope?: Scope): Span | undefined;
|
|
6
7
|
//# sourceMappingURL=getActiveSpan.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getActiveSpan.d.ts","sourceRoot":"","sources":["../../../src/utils/getActiveSpan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"getActiveSpan.d.ts","sourceRoot":"","sources":["../../../src/utils/getActiveSpan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAG1C;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,SAAS,CAY7D"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { SpanContext } from '@opentelemetry/api';
|
|
2
|
-
import type { Client, Span } from '@sentry/core';
|
|
3
2
|
/**
|
|
4
3
|
* OpenTelemetry only knows about SAMPLED or NONE decision,
|
|
5
4
|
* but for us it is important to differentiate between unset and unsampled.
|
|
@@ -8,20 +7,4 @@ import type { Client, Span } from '@sentry/core';
|
|
|
8
7
|
* but we additionally look at a special trace state to differentiate between them.
|
|
9
8
|
*/
|
|
10
9
|
export declare function getSamplingDecision(spanContext: SpanContext): boolean | undefined;
|
|
11
|
-
/**
|
|
12
|
-
* Resolve a span's sampling decision for trace propagation, also handling native Sentry spans.
|
|
13
|
-
*
|
|
14
|
-
* Prefer the OpenTelemetry trace state via {@link getSamplingDecision}. Native Sentry spans (created
|
|
15
|
-
* by the `SentryTracerProvider`) don't carry that trace state, so when it's absent we fall back to the
|
|
16
|
-
* span's own decision via `spanIsSampled` — but only for an *explicit* decision. An explicit decision
|
|
17
|
-
* originates at a real `SentrySpan` root (a negatively sampled root, or a child of one) or an ignored
|
|
18
|
-
* segment root. Other non-recording placeholder roots (orphan/suppressed spans or TwP placeholders)
|
|
19
|
-
* and remote spans have a *deferred* decision that lives elsewhere (the scope, or the incoming trace
|
|
20
|
-
* state), so we return `undefined` rather than wrongly asserting `-0`.
|
|
21
|
-
*
|
|
22
|
-
* TODO(v11): Once the OTel SDK provider is gone and every local span is a native Sentry span, the
|
|
23
|
-
* trace-state lookup only matters for remote (incoming) spans; the local path always reads the span's
|
|
24
|
-
* own decision, so the "native-vs-OTel-SDK span" framing can be dropped (local → span, remote → trace state).
|
|
25
|
-
*/
|
|
26
|
-
export declare function getSampledForPropagation(span: Span, client: Client | undefined): boolean | undefined;
|
|
27
10
|
//# sourceMappingURL=getSamplingDecision.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSamplingDecision.d.ts","sourceRoot":"","sources":["../../../src/utils/getSamplingDecision.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"getSamplingDecision.d.ts","sourceRoot":"","sources":["../../../src/utils/getSamplingDecision.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAKtD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,GAAG,SAAS,CA6BjF"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DynamicSamplingContext } from '@sentry/core';
|
|
2
|
+
/**
|
|
3
|
+
* Reconcile a freshly-derived DSC's `sampled` flag with the OTel sampling decision.
|
|
4
|
+
*
|
|
5
|
+
* Only applies to a DSC that core generated from the span's (binary) trace flags — never to a frozen
|
|
6
|
+
* incoming DSC from the trace state, which the caller leaves untouched per the propagation spec.
|
|
7
|
+
* Trace flags cannot tell a *deferred* decision (an incoming remote span whose decision lives in the
|
|
8
|
+
* trace state) apart from a definitive *unsampled* one — both read as `traceFlags: NONE`.
|
|
9
|
+
* `getSamplingDecision` resolves this via the OTel trace state, so we let it win here: drop `sampled`
|
|
10
|
+
* when the decision is deferred (`undefined`), and — matching the OTel SDK, whose unsampled spans are
|
|
11
|
+
* nameless non-recording spans — drop the transaction name when the trace is definitively unsampled.
|
|
12
|
+
*/
|
|
13
|
+
export declare function reconcileDscSampled(dsc: Partial<DynamicSamplingContext>, sampled: boolean | undefined): Partial<DynamicSamplingContext>;
|
|
14
|
+
//# sourceMappingURL=reconcileDscSampled.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcileDscSampled.d.ts","sourceRoot":"","sources":["../../../src/utils/reconcileDscSampled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3D;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,OAAO,CAAC,sBAAsB,CAAC,EACpC,OAAO,EAAE,OAAO,GAAG,SAAS,GAC3B,OAAO,CAAC,sBAAsB,CAAC,CAajC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/**
|
|
3
|
-
export declare function suppressTracing
|
|
4
|
-
|
|
1
|
+
import type { Context } from '@opentelemetry/api';
|
|
2
|
+
/** Returns a new context with tracing suppressed, so no spans are created within it. */
|
|
3
|
+
export declare function suppressTracing(context: Context): Context;
|
|
4
|
+
/** Whether tracing is suppressed in the given context. */
|
|
5
|
+
export declare function isTracingSuppressed(context: Context): boolean;
|
|
5
6
|
//# sourceMappingURL=suppressTracing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suppressTracing.d.ts","sourceRoot":"","sources":["../../../src/utils/suppressTracing.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"suppressTracing.d.ts","sourceRoot":"","sources":["../../../src/utils/suppressTracing.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAKlD,wFAAwF;AACxF,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAEzD;AAED,0DAA0D;AAC1D,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAE7D"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/opentelemetry",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0-alpha.1",
|
|
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",
|
|
7
7
|
"author": "Sentry",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"engines": {
|
|
10
|
-
"node": ">=
|
|
10
|
+
"node": ">=20.19.0 <22.0.0 || >=22.12.0 <23.0.0 || >=23.2.0"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"/build"
|
|
@@ -19,63 +19,36 @@
|
|
|
19
19
|
"./package.json": "./package.json",
|
|
20
20
|
".": {
|
|
21
21
|
"types": "./build/types/index.d.ts",
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"require": "./build/cjs/index.js"
|
|
25
|
-
},
|
|
26
|
-
"worker": {
|
|
27
|
-
"import": "./build/esm/index.js",
|
|
28
|
-
"require": "./build/cjs/index.js"
|
|
29
|
-
},
|
|
30
|
-
"browser": {
|
|
31
|
-
"import": "./build/esm/index.browser.js",
|
|
32
|
-
"require": "./build/cjs/index.browser.js"
|
|
33
|
-
},
|
|
34
|
-
"default": {
|
|
35
|
-
"import": "./build/esm/index.js",
|
|
36
|
-
"require": "./build/cjs/index.js"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
"typesVersions": {
|
|
41
|
-
"<5.0": {
|
|
42
|
-
"build/types/index.d.ts": [
|
|
43
|
-
"build/types-ts3.8/index.d.ts"
|
|
44
|
-
]
|
|
22
|
+
"import": "./build/esm/index.js",
|
|
23
|
+
"require": "./build/cjs/index.js"
|
|
45
24
|
}
|
|
46
25
|
},
|
|
47
26
|
"publishConfig": {
|
|
48
27
|
"access": "public"
|
|
49
28
|
},
|
|
50
29
|
"dependencies": {
|
|
51
|
-
"@sentry/conventions": "^0.
|
|
52
|
-
"@sentry/core": "
|
|
30
|
+
"@sentry/conventions": "^0.19.0",
|
|
31
|
+
"@sentry/core": "11.0.0-alpha.1"
|
|
53
32
|
},
|
|
54
33
|
"peerDependencies": {
|
|
55
|
-
"@opentelemetry/api": "^1.9.0"
|
|
56
|
-
"@opentelemetry/core": "^1.30.1 || ^2.1.0",
|
|
57
|
-
"@opentelemetry/sdk-trace-base": "^1.30.1 || ^2.1.0"
|
|
34
|
+
"@opentelemetry/api": "^1.9.0"
|
|
58
35
|
},
|
|
59
36
|
"devDependencies": {
|
|
60
|
-
"@opentelemetry/api": "^1.9.1"
|
|
61
|
-
"@opentelemetry/core": "^2.9.0",
|
|
62
|
-
"@opentelemetry/sdk-trace-base": "^2.9.0"
|
|
37
|
+
"@opentelemetry/api": "^1.9.1"
|
|
63
38
|
},
|
|
64
39
|
"scripts": {
|
|
65
40
|
"build": "run-p build:transpile build:types",
|
|
66
41
|
"build:dev": "yarn build",
|
|
67
42
|
"build:transpile": "rollup -c rollup.npm.config.mjs",
|
|
68
|
-
"build:types": "
|
|
69
|
-
"build:types:core": "tsc -p tsconfig.types.json",
|
|
70
|
-
"build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
|
|
43
|
+
"build:types": "tsc -p tsconfig.types.json",
|
|
71
44
|
"build:watch": "run-p build:transpile:watch",
|
|
72
45
|
"build:dev:watch": "yarn build:watch",
|
|
73
46
|
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
|
|
74
47
|
"build:tarball": "npm pack",
|
|
75
48
|
"circularDepCheck": "madge --circular src/index.ts",
|
|
76
49
|
"clean": "rimraf build coverage sentry-opentelemetry-*.tgz",
|
|
77
|
-
"lint:fix": "
|
|
78
|
-
"lint": "
|
|
50
|
+
"lint:fix": "oxlint . --fix --type-aware",
|
|
51
|
+
"lint": "oxlint . --type-aware",
|
|
79
52
|
"lint:es-compatibility": "es-check es2022 ./build/cjs/*.js && es-check es2022 ./build/esm/*.js --module",
|
|
80
53
|
"test": "yarn test:unit",
|
|
81
54
|
"test:unit": "vitest run",
|