@sentry/opentelemetry 8.0.0-alpha.1 → 8.0.0-alpha.3
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 -1
- package/cjs/index.js +2120 -55
- package/cjs/index.js.map +1 -1
- package/esm/index.js +2091 -22
- package/esm/index.js.map +1 -1
- package/esm/package.json +1 -0
- package/package.json +18 -5
- package/types/asyncContextStrategy.d.ts.map +1 -1
- package/types/constants.d.ts +3 -5
- package/types/constants.d.ts.map +1 -1
- package/types/contextManager.d.ts.map +1 -1
- package/types/custom/getCurrentHub.d.ts.map +1 -1
- package/types/index.d.ts +6 -7
- package/types/index.d.ts.map +1 -1
- package/types/propagator.d.ts +26 -2
- package/types/propagator.d.ts.map +1 -1
- package/types/sampler.d.ts.map +1 -1
- package/types/semanticAttributes.d.ts +2 -7
- package/types/semanticAttributes.d.ts.map +1 -1
- package/types/setupEventContextTrace.d.ts.map +1 -1
- package/types/spanExporter.d.ts.map +1 -1
- package/types/spanProcessor.d.ts.map +1 -1
- package/types/trace.d.ts +14 -1
- package/types/trace.d.ts.map +1 -1
- package/types/types.d.ts +3 -4
- package/types/types.d.ts.map +1 -1
- package/types/utils/captureExceptionForTimedEvent.d.ts +1 -2
- package/types/utils/captureExceptionForTimedEvent.d.ts.map +1 -1
- package/types/utils/contextData.d.ts +1 -21
- package/types/utils/contextData.d.ts.map +1 -1
- package/types/utils/dynamicSamplingContext.d.ts.map +1 -1
- package/types/utils/getActiveSpan.d.ts +0 -5
- package/types/utils/getActiveSpan.d.ts.map +1 -1
- package/types/utils/groupSpansWithParents.d.ts.map +1 -1
- package/types/utils/mapStatus.d.ts +2 -2
- package/types/utils/mapStatus.d.ts.map +1 -1
- package/types/utils/setupCheck.d.ts +9 -0
- package/types/utils/setupCheck.d.ts.map +1 -0
- package/types/utils/spanData.d.ts +1 -14
- package/types/utils/spanData.d.ts.map +1 -1
- package/types-ts3.8/constants.d.ts +3 -5
- package/types-ts3.8/index.d.ts +6 -7
- package/types-ts3.8/propagator.d.ts +26 -2
- package/types-ts3.8/semanticAttributes.d.ts +2 -7
- package/types-ts3.8/trace.d.ts +14 -1
- package/types-ts3.8/types.d.ts +3 -4
- package/types-ts3.8/utils/captureExceptionForTimedEvent.d.ts +1 -2
- package/types-ts3.8/utils/contextData.d.ts +1 -21
- package/types-ts3.8/utils/getActiveSpan.d.ts +0 -5
- package/types-ts3.8/utils/mapStatus.d.ts +2 -2
- package/types-ts3.8/utils/setupCheck.d.ts +9 -0
- package/types-ts3.8/utils/spanData.d.ts +1 -14
- package/cjs/asyncContextStrategy.js +0 -114
- package/cjs/asyncContextStrategy.js.map +0 -1
- package/cjs/constants.js +0 -32
- package/cjs/constants.js.map +0 -1
- package/cjs/contextManager.js +0 -82
- package/cjs/contextManager.js.map +0 -1
- package/cjs/custom/client.js +0 -64
- package/cjs/custom/client.js.map +0 -1
- package/cjs/custom/getCurrentHub.js +0 -106
- package/cjs/custom/getCurrentHub.js.map +0 -1
- package/cjs/custom/hub.js +0 -13
- package/cjs/custom/hub.js.map +0 -1
- package/cjs/custom/hubextensions.js +0 -37
- package/cjs/custom/hubextensions.js.map +0 -1
- package/cjs/custom/transaction.js +0 -26
- package/cjs/custom/transaction.js.map +0 -1
- package/cjs/debug-build.js +0 -11
- package/cjs/debug-build.js.map +0 -1
- package/cjs/propagator.js +0 -159
- package/cjs/propagator.js.map +0 -1
- package/cjs/sampler.js +0 -186
- package/cjs/sampler.js.map +0 -1
- package/cjs/semanticAttributes.js +0 -12
- package/cjs/semanticAttributes.js.map +0 -1
- package/cjs/setupEventContextTrace.js +0 -40
- package/cjs/setupEventContextTrace.js.map +0 -1
- package/cjs/spanExporter.js +0 -314
- package/cjs/spanExporter.js.map +0 -1
- package/cjs/spanProcessor.js +0 -95
- package/cjs/spanProcessor.js.map +0 -1
- package/cjs/trace.js +0 -222
- package/cjs/trace.js.map +0 -1
- package/cjs/utils/addOriginToSpan.js +0 -11
- package/cjs/utils/addOriginToSpan.js.map +0 -1
- package/cjs/utils/captureExceptionForTimedEvent.js +0 -59
- package/cjs/utils/captureExceptionForTimedEvent.js.map +0 -1
- package/cjs/utils/contextData.js +0 -79
- package/cjs/utils/contextData.js.map +0 -1
- package/cjs/utils/convertOtelTimeToSeconds.js +0 -9
- package/cjs/utils/convertOtelTimeToSeconds.js.map +0 -1
- package/cjs/utils/dynamicSamplingContext.js +0 -64
- package/cjs/utils/dynamicSamplingContext.js.map +0 -1
- package/cjs/utils/getActiveSpan.js +0 -29
- package/cjs/utils/getActiveSpan.js.map +0 -1
- package/cjs/utils/getRequestSpanData.js +0 -48
- package/cjs/utils/getRequestSpanData.js.map +0 -1
- package/cjs/utils/getSpanKind.js +0 -21
- package/cjs/utils/getSpanKind.js.map +0 -1
- package/cjs/utils/groupSpansWithParents.js +0 -74
- package/cjs/utils/groupSpansWithParents.js.map +0 -1
- package/cjs/utils/isSentryRequest.js +0 -29
- package/cjs/utils/isSentryRequest.js.map +0 -1
- package/cjs/utils/mapStatus.js +0 -76
- package/cjs/utils/mapStatus.js.map +0 -1
- package/cjs/utils/parseSpanDescription.js +0 -158
- package/cjs/utils/parseSpanDescription.js.map +0 -1
- package/cjs/utils/spanData.js +0 -72
- package/cjs/utils/spanData.js.map +0 -1
- package/cjs/utils/spanTypes.js +0 -77
- package/cjs/utils/spanTypes.js.map +0 -1
- package/esm/asyncContextStrategy.js +0 -112
- package/esm/asyncContextStrategy.js.map +0 -1
- package/esm/constants.js +0 -22
- package/esm/constants.js.map +0 -1
- package/esm/contextManager.js +0 -77
- package/esm/contextManager.js.map +0 -1
- package/esm/custom/client.js +0 -59
- package/esm/custom/client.js.map +0 -1
- package/esm/custom/getCurrentHub.js +0 -101
- package/esm/custom/getCurrentHub.js.map +0 -1
- package/esm/custom/hub.js +0 -11
- package/esm/custom/hub.js.map +0 -1
- package/esm/custom/hubextensions.js +0 -35
- package/esm/custom/hubextensions.js.map +0 -1
- package/esm/custom/transaction.js +0 -24
- package/esm/custom/transaction.js.map +0 -1
- package/esm/debug-build.js +0 -9
- package/esm/debug-build.js.map +0 -1
- package/esm/propagator.js +0 -154
- package/esm/propagator.js.map +0 -1
- package/esm/sampler.js +0 -184
- package/esm/sampler.js.map +0 -1
- package/esm/semanticAttributes.js +0 -10
- package/esm/semanticAttributes.js.map +0 -1
- package/esm/setupEventContextTrace.js +0 -38
- package/esm/setupEventContextTrace.js.map +0 -1
- package/esm/spanExporter.js +0 -312
- package/esm/spanExporter.js.map +0 -1
- package/esm/spanProcessor.js +0 -93
- package/esm/spanProcessor.js.map +0 -1
- package/esm/trace.js +0 -217
- package/esm/trace.js.map +0 -1
- package/esm/utils/addOriginToSpan.js +0 -9
- package/esm/utils/addOriginToSpan.js.map +0 -1
- package/esm/utils/captureExceptionForTimedEvent.js +0 -57
- package/esm/utils/captureExceptionForTimedEvent.js.map +0 -1
- package/esm/utils/contextData.js +0 -70
- package/esm/utils/contextData.js.map +0 -1
- package/esm/utils/convertOtelTimeToSeconds.js +0 -7
- package/esm/utils/convertOtelTimeToSeconds.js.map +0 -1
- package/esm/utils/dynamicSamplingContext.js +0 -59
- package/esm/utils/dynamicSamplingContext.js.map +0 -1
- package/esm/utils/getActiveSpan.js +0 -26
- package/esm/utils/getActiveSpan.js.map +0 -1
- package/esm/utils/getRequestSpanData.js +0 -46
- package/esm/utils/getRequestSpanData.js.map +0 -1
- package/esm/utils/getSpanKind.js +0 -19
- package/esm/utils/getSpanKind.js.map +0 -1
- package/esm/utils/groupSpansWithParents.js +0 -72
- package/esm/utils/groupSpansWithParents.js.map +0 -1
- package/esm/utils/isSentryRequest.js +0 -27
- package/esm/utils/isSentryRequest.js.map +0 -1
- package/esm/utils/mapStatus.js +0 -74
- package/esm/utils/mapStatus.js.map +0 -1
- package/esm/utils/parseSpanDescription.js +0 -154
- package/esm/utils/parseSpanDescription.js.map +0 -1
- package/esm/utils/spanData.js +0 -63
- package/esm/utils/spanData.js.map +0 -1
- package/esm/utils/spanTypes.js +0 -70
- package/esm/utils/spanTypes.js.map +0 -1
- package/types/custom/hubextensions.d.ts +0 -5
- package/types/custom/hubextensions.d.ts.map +0 -1
- package/types/custom/transaction.d.ts +0 -8
- package/types/custom/transaction.d.ts.map +0 -1
- package/types-ts3.8/custom/hubextensions.d.ts +0 -5
- package/types-ts3.8/custom/transaction.d.ts +0 -8
package/esm/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "type": "module" }
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/opentelemetry",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.3",
|
|
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": ">=14.
|
|
10
|
+
"node": ">=14.18"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"cjs",
|
|
@@ -18,6 +18,19 @@
|
|
|
18
18
|
"main": "cjs/index.js",
|
|
19
19
|
"module": "esm/index.js",
|
|
20
20
|
"types": "types/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
"./package.json": "./package.json",
|
|
23
|
+
".": {
|
|
24
|
+
"import": {
|
|
25
|
+
"types": "./types/index.d.ts",
|
|
26
|
+
"default": "./esm/index.js"
|
|
27
|
+
},
|
|
28
|
+
"require": {
|
|
29
|
+
"types": "./types/index.d.ts",
|
|
30
|
+
"default": "./cjs/index.js"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
21
34
|
"typesVersions": {
|
|
22
35
|
"<4.9": {
|
|
23
36
|
"types/index.d.ts": [
|
|
@@ -29,9 +42,9 @@
|
|
|
29
42
|
"access": "public"
|
|
30
43
|
},
|
|
31
44
|
"dependencies": {
|
|
32
|
-
"@sentry/core": "8.0.0-alpha.
|
|
33
|
-
"@sentry/types": "8.0.0-alpha.
|
|
34
|
-
"@sentry/utils": "8.0.0-alpha.
|
|
45
|
+
"@sentry/core": "8.0.0-alpha.3",
|
|
46
|
+
"@sentry/types": "8.0.0-alpha.3",
|
|
47
|
+
"@sentry/utils": "8.0.0-alpha.3"
|
|
35
48
|
},
|
|
36
49
|
"peerDependencies": {
|
|
37
50
|
"@opentelemetry/api": "^1.0.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncContextStrategy.d.ts","sourceRoot":"","sources":["../../src/asyncContextStrategy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"asyncContextStrategy.d.ts","sourceRoot":"","sources":["../../src/asyncContextStrategy.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,wBAAgB,2CAA2C,IAAI,IAAI,CAyGlE"}
|
package/types/constants.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
export declare const SENTRY_TRACE_HEADER = "sentry-trace";
|
|
2
2
|
export declare const SENTRY_BAGGAGE_HEADER = "baggage";
|
|
3
|
-
export declare const SENTRY_TRACE_STATE_DSC = "sentry.
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
6
|
-
/** Context Key to hold a Hub. */
|
|
7
|
-
export declare const SENTRY_HUB_CONTEXT_KEY: symbol;
|
|
3
|
+
export declare const SENTRY_TRACE_STATE_DSC = "sentry.dsc";
|
|
4
|
+
export declare const SENTRY_TRACE_STATE_PARENT_SPAN_ID = "sentry.parent_span_id";
|
|
5
|
+
export declare const SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING = "sentry.sampled_not_recording";
|
|
8
6
|
export declare const SENTRY_SCOPES_CONTEXT_KEY: symbol;
|
|
9
7
|
export declare const SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY: symbol;
|
|
10
8
|
export declare const SENTRY_FORK_SET_SCOPE_CONTEXT_KEY: symbol;
|
package/types/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAClD,eAAO,MAAM,qBAAqB,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,iBAAiB,CAAC;AAClD,eAAO,MAAM,qBAAqB,YAAY,CAAC;AAE/C,eAAO,MAAM,sBAAsB,eAAe,CAAC;AACnD,eAAO,MAAM,iCAAiC,0BAA0B,CAAC;AACzE,eAAO,MAAM,wCAAwC,iCAAiC,CAAC;AAEvF,eAAO,MAAM,yBAAyB,QAAoC,CAAC;AAE3E,eAAO,MAAM,uCAAuC,QAAkD,CAAC;AAEvG,eAAO,MAAM,iCAAiC,QAA4C,CAAC;AAE3F,eAAO,MAAM,2CAA2C,QAAsD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextManager.d.ts","sourceRoot":"","sources":["../../src/contextManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAYlE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,sBAAsB,SAAS,cAAc,EACnF,mBAAmB,EAAE,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,sBAAsB,GACtE,OAAO,mBAAmB,
|
|
1
|
+
{"version":3,"file":"contextManager.d.ts","sourceRoot":"","sources":["../../src/contextManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAYlE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,sBAAsB,SAAS,cAAc,EACnF,mBAAmB,EAAE,KAAK,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,sBAAsB,GACtE,OAAO,mBAAmB,CAqD5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCurrentHub.d.ts","sourceRoot":"","sources":["../../../src/custom/getCurrentHub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"getCurrentHub.d.ts","sourceRoot":"","sources":["../../../src/custom/getCurrentHub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAqB,GAAG,EAAuD,MAAM,eAAe,CAAC;AAmBjH;;;GAGG;AACH,wBAAgB,aAAa,IAAI,GAAG,CAiEnC"}
|
package/types/index.d.ts
CHANGED
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { addOriginToSpan } from './utils/addOriginToSpan';
|
|
2
1
|
import { maybeCaptureExceptionForTimedEvent } from './utils/captureExceptionForTimedEvent';
|
|
3
2
|
import { getRequestSpanData } from './utils/getRequestSpanData';
|
|
4
3
|
export type { OpenTelemetryClient } from './types';
|
|
5
4
|
export { wrapClientClass } from './custom/client';
|
|
6
5
|
export { getSpanKind } from './utils/getSpanKind';
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
6
|
+
export { getSpanScopes } from './utils/spanData';
|
|
7
|
+
export { getScopesFromContext } from './utils/contextData';
|
|
9
8
|
export { spanHasAttributes, spanHasEvents, spanHasKind, spanHasName, spanHasParentId, spanHasStatus, } from './utils/spanTypes';
|
|
9
|
+
export { getDynamicSamplingContextFromSpan } from './utils/dynamicSamplingContext';
|
|
10
10
|
export { isSentryRequestSpan } from './utils/isSentryRequest';
|
|
11
|
-
export { getActiveSpan
|
|
12
|
-
export { startSpan, startSpanManual, startInactiveSpan, withActiveSpan } from './trace';
|
|
11
|
+
export { getActiveSpan } from './utils/getActiveSpan';
|
|
12
|
+
export { startSpan, startSpanManual, startInactiveSpan, withActiveSpan, continueTrace } from './trace';
|
|
13
13
|
export { setupGlobalHub } from './custom/hub';
|
|
14
14
|
export { getCurrentHub } from './custom/getCurrentHub';
|
|
15
|
-
export { addTracingExtensions } from './custom/hubextensions';
|
|
16
15
|
export { setupEventContextTrace } from './setupEventContextTrace';
|
|
17
16
|
export { setOpenTelemetryContextAsyncContextStrategy } from './asyncContextStrategy';
|
|
18
17
|
export { wrapContextManagerClass } from './contextManager';
|
|
19
18
|
export { SentryPropagator } from './propagator';
|
|
20
19
|
export { SentrySpanProcessor } from './spanProcessor';
|
|
21
20
|
export { SentrySampler } from './sampler';
|
|
21
|
+
export { openTelemetrySetupCheck } from './utils/setupCheck';
|
|
22
22
|
export { getClient } from '@sentry/core';
|
|
23
23
|
/**
|
|
24
24
|
* The following internal utils are not considered public API and are subject to change.
|
|
25
25
|
* @hidden
|
|
26
26
|
*/
|
|
27
27
|
declare const _INTERNAL: {
|
|
28
|
-
readonly addOriginToSpan: typeof addOriginToSpan;
|
|
29
28
|
readonly maybeCaptureExceptionForTimedEvent: typeof maybeCaptureExceptionForTimedEvent;
|
|
30
29
|
readonly getRequestSpanData: typeof getRequestSpanData;
|
|
31
30
|
};
|
package/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,uCAAuC,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,WAAW,EACX,eAAe,EACf,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,iCAAiC,EAAE,MAAM,gCAAgC,CAAC;AAEnF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGvG,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,2CAA2C,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;GAGG;AACH,QAAA,MAAM,SAAS;;;CAGL,CAAC;AAEX,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
package/types/propagator.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import type { Context, TextMapGetter, TextMapSetter } from '@opentelemetry/api';
|
|
2
|
-
import { W3CBaggagePropagator } from '@opentelemetry/core';
|
|
1
|
+
import type { Context, SpanContext, TextMapGetter, TextMapSetter } from '@opentelemetry/api';
|
|
2
|
+
import { TraceState, W3CBaggagePropagator } from '@opentelemetry/core';
|
|
3
|
+
import type { continueTrace } from '@sentry/core';
|
|
4
|
+
import type { DynamicSamplingContext, PropagationContext } from '@sentry/types';
|
|
5
|
+
/** Get the Sentry propagation context from a span context. */
|
|
6
|
+
export declare function getPropagationContextFromSpanContext(spanContext: SpanContext): PropagationContext;
|
|
3
7
|
/**
|
|
4
8
|
* Injects and extracts `sentry-trace` and `baggage` headers from carriers.
|
|
5
9
|
*/
|
|
6
10
|
export declare class SentryPropagator extends W3CBaggagePropagator {
|
|
11
|
+
constructor();
|
|
7
12
|
/**
|
|
8
13
|
* @inheritDoc
|
|
9
14
|
*/
|
|
@@ -17,4 +22,23 @@ export declare class SentryPropagator extends W3CBaggagePropagator {
|
|
|
17
22
|
*/
|
|
18
23
|
fields(): string[];
|
|
19
24
|
}
|
|
25
|
+
/** Exported for tests. */
|
|
26
|
+
export declare function makeTraceState({ parentSpanId, dsc, sampled, }: {
|
|
27
|
+
parentSpanId?: string;
|
|
28
|
+
dsc?: Partial<DynamicSamplingContext>;
|
|
29
|
+
sampled?: boolean;
|
|
30
|
+
}): TraceState | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Takes trace strings and propagates them as a remote active span.
|
|
33
|
+
* This should be used in addition to `continueTrace` in OTEL-powered environments.
|
|
34
|
+
*/
|
|
35
|
+
export declare function continueTraceAsRemoteSpan<T>(ctx: Context, options: Parameters<typeof continueTrace>[0], callback: () => T): T;
|
|
36
|
+
/**
|
|
37
|
+
* OpenTelemetry only knows about SAMPLED or NONE decision,
|
|
38
|
+
* but for us it is important to differentiate between unset and unsampled.
|
|
39
|
+
*
|
|
40
|
+
* Both of these are identified as `traceFlags === TracegFlags.NONE`,
|
|
41
|
+
* but we additionally look at a special trace state to differentiate between them.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getSamplingDecision(spanContext: SpanContext): boolean | undefined;
|
|
20
44
|
//# sourceMappingURL=propagator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propagator.d.ts","sourceRoot":"","sources":["../../src/propagator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,OAAO,
|
|
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;AAC5F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAmBhF,8DAA8D;AAC9D,wBAAgB,oCAAoC,CAAC,WAAW,EAAE,WAAW,GAAG,kBAAkB,CAgBjG;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,oBAAoB;;IAMxD;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI;IAuB9E;;OAEG;IACI,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO;IA0BlF;;OAEG;IACI,MAAM,IAAI,MAAM,EAAE;CAG1B;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/sampler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sampler.d.ts","sourceRoot":"","sources":["../../src/sampler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sampler.d.ts","sourceRoot":"","sources":["../../src/sampler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,OAAO,EAAe,MAAM,oBAAoB,CAAC;AAG3E,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAG7E,OAAO,KAAK,EAAE,MAAM,EAAkC,MAAM,eAAe,CAAC;AAQ5E;;GAEG;AACH,qBAAa,aAAc,YAAW,OAAO;IAC3C,OAAO,CAAC,OAAO,CAAS;gBAEL,MAAM,EAAE,MAAM;IAKjC,kBAAkB;IACX,YAAY,CACjB,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,OAAO,EAClB,cAAc,EAAE,OAAO,EACvB,MAAM,EAAE,OAAO,GACd,cAAc;IA+FjB,4EAA4E;IACrE,QAAQ,IAAI,MAAM;CAG1B"}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
* No guarantees apply to these attributes, and the may change/disappear at any time.
|
|
4
|
-
*/
|
|
5
|
-
export declare const InternalSentrySemanticAttributes: {
|
|
6
|
-
readonly PARENT_SAMPLED: "sentry.parentSampled";
|
|
7
|
-
};
|
|
1
|
+
/** If this attribute is true, it means that the parent is a remote span. */
|
|
2
|
+
export declare const SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE = "sentry.parentIsRemote";
|
|
8
3
|
//# sourceMappingURL=semanticAttributes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semanticAttributes.d.ts","sourceRoot":"","sources":["../../src/semanticAttributes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"semanticAttributes.d.ts","sourceRoot":"","sources":["../../src/semanticAttributes.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,eAAO,MAAM,0CAA0C,0BAA0B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupEventContextTrace.d.ts","sourceRoot":"","sources":["../../src/setupEventContextTrace.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setupEventContextTrace.d.ts","sourceRoot":"","sources":["../../src/setupEventContextTrace.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAM5C,uDAAuD;AACvD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA6B3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spanExporter.d.ts","sourceRoot":"","sources":["../../src/spanExporter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spanExporter.d.ts","sourceRoot":"","sources":["../../src/spanExporter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AA0BhF;;GAEG;AACH,qBAAa,kBAAmB,YAAW,YAAY;IACrD,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,QAAQ,CAAU;;IAO1B,kBAAkB;IACX,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI;IAoC1F,kBAAkB;IACX,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAOhC,kBAAkB;IACX,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAKnC"}
|
|
@@ -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;AACnG,OAAO,EAAE,kBAAkB,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,IAAI,EAAE,aAAa,IAAI,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAwDnE;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,kBAAmB,YAAW,sBAAsB;;IAO3F;;OAEG;IACI,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,GAAG,IAAI;IAWxD,kBAAkB;IACX,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAa9B;;;OAGG;IACH,SAAS,CAAC,uBAAuB,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO;CAGxD"}
|
package/types/trace.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Span } from '@opentelemetry/api';
|
|
2
|
+
import { continueTrace as baseContinueTrace } from '@sentry/core';
|
|
2
3
|
import type { Scope } from '@sentry/types';
|
|
3
4
|
import type { OpenTelemetrySpanContext } from './types';
|
|
4
5
|
/**
|
|
@@ -20,7 +21,7 @@ export declare function startSpan<T>(options: OpenTelemetrySpanContext, callback
|
|
|
20
21
|
*
|
|
21
22
|
* Note that you'll always get a span passed to the callback, it may just be a NonRecordingSpan if the span is not sampled.
|
|
22
23
|
*/
|
|
23
|
-
export declare function startSpanManual<T>(options: OpenTelemetrySpanContext, callback: (span: Span) => T): T;
|
|
24
|
+
export declare function startSpanManual<T>(options: OpenTelemetrySpanContext, callback: (span: Span, finish: () => void) => T): T;
|
|
24
25
|
/**
|
|
25
26
|
* @deprecated Use {@link startSpan} instead.
|
|
26
27
|
*/
|
|
@@ -46,4 +47,16 @@ export declare function startInactiveSpan(options: OpenTelemetrySpanContext): Sp
|
|
|
46
47
|
* @returns the value returned from the provided callback function.
|
|
47
48
|
*/
|
|
48
49
|
export declare function withActiveSpan<T>(span: Span | null, callback: (scope: Scope) => T): T;
|
|
50
|
+
/**
|
|
51
|
+
* Continue a trace from `sentry-trace` and `baggage` values.
|
|
52
|
+
* These values can be obtained from incoming request headers, or in the browser from `<meta name="sentry-trace">`
|
|
53
|
+
* and `<meta name="baggage">` HTML tags.
|
|
54
|
+
*
|
|
55
|
+
* Spans started with `startSpan`, `startSpanManual` and `startInactiveSpan`, within the callback will automatically
|
|
56
|
+
* be attached to the incoming trace.
|
|
57
|
+
*
|
|
58
|
+
* This is a custom version of `continueTrace` that is used in OTEL-powered environments.
|
|
59
|
+
* It propagates the trace as a remote span, in addition to setting it on the propagation context.
|
|
60
|
+
*/
|
|
61
|
+
export declare function continueTrace<T>(options: Parameters<typeof baseContinueTrace>[0], callback: () => T): T;
|
|
49
62
|
//# sourceMappingURL=trace.d.ts.map
|
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;
|
|
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,EAMnC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAU,KAAK,EAAE,MAAM,eAAe,CAAC;AAGnD,OAAO,KAAK,EAAuB,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAI7E;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,GAAG,CAAC,CAsB9F;AAED;;;;;;;;GAQG;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,CAqBH;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,kBAAY,CAAC;AAEzC;;;;;;;;;GASG;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"}
|
package/types/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Span as WriteableSpan, SpanKind, Tracer } from '@opentelemetry/api';
|
|
2
|
-
import type { BasicTracerProvider, ReadableSpan
|
|
3
|
-
import type { Scope, StartSpanOptions } from '@sentry/types';
|
|
2
|
+
import type { BasicTracerProvider, ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
3
|
+
import type { Scope, Span, StartSpanOptions } from '@sentry/types';
|
|
4
4
|
export interface OpenTelemetryClient {
|
|
5
5
|
tracer: Tracer;
|
|
6
6
|
traceProvider: BasicTracerProvider | undefined;
|
|
@@ -17,8 +17,7 @@ export interface OpenTelemetrySpanContext extends StartSpanOptions {
|
|
|
17
17
|
* Note that technically, the `Span` exported from `@opentelemwetry/sdk-trace-base` matches this,
|
|
18
18
|
* but we cannot be 100% sure that we are actually getting such a span, so this type is more defensive.
|
|
19
19
|
*/
|
|
20
|
-
export type AbstractSpan = WriteableSpan | ReadableSpan;
|
|
21
|
-
export type { Span };
|
|
20
|
+
export type AbstractSpan = WriteableSpan | ReadableSpan | Span;
|
|
22
21
|
export interface CurrentScopes {
|
|
23
22
|
scope: Scope;
|
|
24
23
|
isolationScope: Scope;
|
package/types/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACvF,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEnE,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,mBAAmB,GAAG,SAAS,CAAC;CAChD;AAED,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAEhE,IAAI,CAAC,EAAE,QAAQ,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,YAAY,GAAG,IAAI,CAAC;AAE/D,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,KAAK,CAAC;CACvB"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { Span as OtelSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';
|
|
2
|
-
import type { Hub } from '@sentry/types';
|
|
3
2
|
/**
|
|
4
3
|
* Maybe capture a Sentry exception for an OTEL timed event.
|
|
5
4
|
* This will check if the event is exception-like and in that case capture it as an exception.
|
|
6
5
|
*/
|
|
7
|
-
export declare function maybeCaptureExceptionForTimedEvent(
|
|
6
|
+
export declare function maybeCaptureExceptionForTimedEvent(event: TimedEvent, otelSpan?: OtelSpan): void;
|
|
8
7
|
//# sourceMappingURL=captureExceptionForTimedEvent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"captureExceptionForTimedEvent.d.ts","sourceRoot":"","sources":["../../../src/utils/captureExceptionForTimedEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"captureExceptionForTimedEvent.d.ts","sourceRoot":"","sources":["../../../src/utils/captureExceptionForTimedEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAKlF;;;GAGG;AACH,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CA6C/F"}
|
|
@@ -1,26 +1,6 @@
|
|
|
1
1
|
import type { Context } from '@opentelemetry/api';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Scope } from '@sentry/types';
|
|
3
3
|
import type { CurrentScopes } from '../types';
|
|
4
|
-
/**
|
|
5
|
-
* Try to get the Propagation Context from the given OTEL context.
|
|
6
|
-
* This requires the SentryPropagator to be registered.
|
|
7
|
-
*/
|
|
8
|
-
export declare function getPropagationContextFromContext(context: Context): PropagationContext | undefined;
|
|
9
|
-
/**
|
|
10
|
-
* Set a Propagation Context on an OTEL context..
|
|
11
|
-
* This will return a forked context with the Propagation Context set.
|
|
12
|
-
*/
|
|
13
|
-
export declare function setPropagationContextOnContext(context: Context, propagationContext: PropagationContext): Context;
|
|
14
|
-
/**
|
|
15
|
-
* Try to get the Hub from the given OTEL context.
|
|
16
|
-
* This requires a Context Manager that was wrapped with getWrappedContextManager.
|
|
17
|
-
*/
|
|
18
|
-
export declare function getHubFromContext(context: Context): Hub | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* Set a Hub on an OTEL context..
|
|
21
|
-
* This will return a forked context with the Propagation Context set.
|
|
22
|
-
*/
|
|
23
|
-
export declare function setHubOnContext(context: Context, hub: Hub): Context;
|
|
24
4
|
/**
|
|
25
5
|
* Try to get the current scopes from the given OTEL context.
|
|
26
6
|
* This requires a Context Manager that was wrapped with getWrappedContextManager.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextData.d.ts","sourceRoot":"","sources":["../../../src/utils/contextData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"contextData.d.ts","sourceRoot":"","sources":["../../../src/utils/contextData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAI9C;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAEhF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO,CAEnF;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAEtE;AAED;;;KAGK;AACL,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,GAAG,SAAS,CAErE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dynamicSamplingContext.d.ts","sourceRoot":"","sources":["../../../src/utils/dynamicSamplingContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dynamicSamplingContext.d.ts","sourceRoot":"","sources":["../../../src/utils/dynamicSamplingContext.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAI5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC,CAyC/G"}
|
|
@@ -3,9 +3,4 @@ import type { Span } from '@opentelemetry/api';
|
|
|
3
3
|
* Returns the currently active span.
|
|
4
4
|
*/
|
|
5
5
|
export declare function getActiveSpan(): Span | undefined;
|
|
6
|
-
/**
|
|
7
|
-
* Get the root span for the given span.
|
|
8
|
-
* The given span may be the root span itself.
|
|
9
|
-
*/
|
|
10
|
-
export declare function getRootSpan(span: Span): Span;
|
|
11
6
|
//# 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;AAG/C;;GAEG;AACH,wBAAgB,aAAa,IAAI,IAAI,GAAG,SAAS,CAEhD"}
|
|
@@ -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;
|
|
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,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SpanStatus } from '@sentry/types';
|
|
2
2
|
import type { AbstractSpan } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Get a Sentry span status from an otel span.
|
|
5
5
|
*/
|
|
6
|
-
export declare function mapStatus(span: AbstractSpan):
|
|
6
|
+
export declare function mapStatus(span: AbstractSpan): SpanStatus;
|
|
7
7
|
//# sourceMappingURL=mapStatus.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapStatus.d.ts","sourceRoot":"","sources":["../../../src/utils/mapStatus.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mapStatus.d.ts","sourceRoot":"","sources":["../../../src/utils/mapStatus.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAsC7C;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,CA4BxD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type OpenTelemetryElement = 'SentrySpanProcessor' | 'SentryContextManager' | 'SentryPropagator' | 'SentrySampler';
|
|
2
|
+
/** Get all the OpenTelemetry elements that have been set up. */
|
|
3
|
+
export declare function openTelemetrySetupCheck(): OpenTelemetryElement[];
|
|
4
|
+
/** Mark an OpenTelemetry element as setup. */
|
|
5
|
+
export declare function setIsSetup(element: OpenTelemetryElement): void;
|
|
6
|
+
/** Only exported for tests. */
|
|
7
|
+
export declare function clearOpenTelemetrySetupCheck(): void;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=setupCheck.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setupCheck.d.ts","sourceRoot":"","sources":["../../../src/utils/setupCheck.ts"],"names":[],"mappings":"AAAA,KAAK,oBAAoB,GAAG,qBAAqB,GAAG,sBAAsB,GAAG,kBAAkB,GAAG,eAAe,CAAC;AAIlH,gEAAgE;AAChE,wBAAgB,uBAAuB,IAAI,oBAAoB,EAAE,CAEhE;AAED,8CAA8C;AAC9C,wBAAgB,UAAU,CAAC,OAAO,EAAE,oBAAoB,GAAG,IAAI,CAE9D;AAED,+BAA+B;AAC/B,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD"}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Hub, Scope, TransactionMetadata } from '@sentry/types';
|
|
1
|
+
import type { Scope } from '@sentry/types';
|
|
3
2
|
import type { AbstractSpan } from '../types';
|
|
4
|
-
/** Set the Sentry hub on an OTEL span. */
|
|
5
|
-
export declare function setSpanHub(span: AbstractSpan, hub: Hub): void;
|
|
6
|
-
/** Get the Sentry hub of an OTEL span. */
|
|
7
|
-
export declare function getSpanHub(span: AbstractSpan): Hub | undefined;
|
|
8
|
-
/** Set the parent OTEL span on an OTEL span. */
|
|
9
|
-
export declare function setSpanParent(span: AbstractSpan, parentSpan: Span): void;
|
|
10
|
-
/** Get the parent OTEL span of an OTEL span. */
|
|
11
|
-
export declare function getSpanParent(span: AbstractSpan): Span | undefined;
|
|
12
|
-
/** Set metadata for an OTEL span. */
|
|
13
|
-
export declare function setSpanMetadata(span: AbstractSpan, metadata: Partial<TransactionMetadata>): void;
|
|
14
|
-
/** Get metadata for an OTEL span. */
|
|
15
|
-
export declare function getSpanMetadata(span: AbstractSpan): Partial<TransactionMetadata> | undefined;
|
|
16
3
|
/**
|
|
17
4
|
* Set the Sentry scope to be used for finishing a given OTEL span.
|
|
18
5
|
* This is different from `setCapturedScopesOnSpan`, as that works on _sentry_ spans,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spanData.d.ts","sourceRoot":"","sources":["../../../src/utils/spanData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"spanData.d.ts","sourceRoot":"","sources":["../../../src/utils/spanData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAa7C;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE;IACN,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,KAAK,CAAC;CACvB,GACA,IAAI,CAEN;AAED,+DAA+D;AAC/D,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAC5C;IACE,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,KAAK,CAAC;CACvB,GACD,SAAS,CAEZ"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
export declare const SENTRY_TRACE_HEADER = "sentry-trace";
|
|
2
2
|
export declare const SENTRY_BAGGAGE_HEADER = "baggage";
|
|
3
|
-
export declare const SENTRY_TRACE_STATE_DSC = "sentry.
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
6
|
-
/** Context Key to hold a Hub. */
|
|
7
|
-
export declare const SENTRY_HUB_CONTEXT_KEY: symbol;
|
|
3
|
+
export declare const SENTRY_TRACE_STATE_DSC = "sentry.dsc";
|
|
4
|
+
export declare const SENTRY_TRACE_STATE_PARENT_SPAN_ID = "sentry.parent_span_id";
|
|
5
|
+
export declare const SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING = "sentry.sampled_not_recording";
|
|
8
6
|
export declare const SENTRY_SCOPES_CONTEXT_KEY: symbol;
|
|
9
7
|
export declare const SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY: symbol;
|
|
10
8
|
export declare const SENTRY_FORK_SET_SCOPE_CONTEXT_KEY: symbol;
|
package/types-ts3.8/index.d.ts
CHANGED
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
import { addOriginToSpan } from './utils/addOriginToSpan';
|
|
2
1
|
import { maybeCaptureExceptionForTimedEvent } from './utils/captureExceptionForTimedEvent';
|
|
3
2
|
import { getRequestSpanData } from './utils/getRequestSpanData';
|
|
4
3
|
export { OpenTelemetryClient } from './types';
|
|
5
4
|
export { wrapClientClass } from './custom/client';
|
|
6
5
|
export { getSpanKind } from './utils/getSpanKind';
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
6
|
+
export { getSpanScopes } from './utils/spanData';
|
|
7
|
+
export { getScopesFromContext } from './utils/contextData';
|
|
9
8
|
export { spanHasAttributes, spanHasEvents, spanHasKind, spanHasName, spanHasParentId, spanHasStatus, } from './utils/spanTypes';
|
|
9
|
+
export { getDynamicSamplingContextFromSpan } from './utils/dynamicSamplingContext';
|
|
10
10
|
export { isSentryRequestSpan } from './utils/isSentryRequest';
|
|
11
|
-
export { getActiveSpan
|
|
12
|
-
export { startSpan, startSpanManual, startInactiveSpan, withActiveSpan } from './trace';
|
|
11
|
+
export { getActiveSpan } from './utils/getActiveSpan';
|
|
12
|
+
export { startSpan, startSpanManual, startInactiveSpan, withActiveSpan, continueTrace } from './trace';
|
|
13
13
|
export { setupGlobalHub } from './custom/hub';
|
|
14
14
|
export { getCurrentHub } from './custom/getCurrentHub';
|
|
15
|
-
export { addTracingExtensions } from './custom/hubextensions';
|
|
16
15
|
export { setupEventContextTrace } from './setupEventContextTrace';
|
|
17
16
|
export { setOpenTelemetryContextAsyncContextStrategy } from './asyncContextStrategy';
|
|
18
17
|
export { wrapContextManagerClass } from './contextManager';
|
|
19
18
|
export { SentryPropagator } from './propagator';
|
|
20
19
|
export { SentrySpanProcessor } from './spanProcessor';
|
|
21
20
|
export { SentrySampler } from './sampler';
|
|
21
|
+
export { openTelemetrySetupCheck } from './utils/setupCheck';
|
|
22
22
|
export { getClient } from '@sentry/core';
|
|
23
23
|
/**
|
|
24
24
|
* The following internal utils are not considered public API and are subject to change.
|
|
25
25
|
* @hidden
|
|
26
26
|
*/
|
|
27
27
|
declare const _INTERNAL: {
|
|
28
|
-
readonly addOriginToSpan: typeof addOriginToSpan;
|
|
29
28
|
readonly maybeCaptureExceptionForTimedEvent: typeof maybeCaptureExceptionForTimedEvent;
|
|
30
29
|
readonly getRequestSpanData: typeof getRequestSpanData;
|
|
31
30
|
};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { Context, TextMapGetter, TextMapSetter } from '@opentelemetry/api';
|
|
2
|
-
import { W3CBaggagePropagator } from '@opentelemetry/core';
|
|
1
|
+
import { Context, SpanContext, TextMapGetter, TextMapSetter } from '@opentelemetry/api';
|
|
2
|
+
import { TraceState, W3CBaggagePropagator } from '@opentelemetry/core';
|
|
3
|
+
import { continueTrace } from '@sentry/core';
|
|
4
|
+
import { DynamicSamplingContext, PropagationContext } from '@sentry/types';
|
|
5
|
+
/** Get the Sentry propagation context from a span context. */
|
|
6
|
+
export declare function getPropagationContextFromSpanContext(spanContext: SpanContext): PropagationContext;
|
|
3
7
|
/**
|
|
4
8
|
* Injects and extracts `sentry-trace` and `baggage` headers from carriers.
|
|
5
9
|
*/
|
|
6
10
|
export declare class SentryPropagator extends W3CBaggagePropagator {
|
|
11
|
+
constructor();
|
|
7
12
|
/**
|
|
8
13
|
* @inheritDoc
|
|
9
14
|
*/
|
|
@@ -17,4 +22,23 @@ export declare class SentryPropagator extends W3CBaggagePropagator {
|
|
|
17
22
|
*/
|
|
18
23
|
fields(): string[];
|
|
19
24
|
}
|
|
25
|
+
/** Exported for tests. */
|
|
26
|
+
export declare function makeTraceState({ parentSpanId, dsc, sampled, }: {
|
|
27
|
+
parentSpanId?: string;
|
|
28
|
+
dsc?: Partial<DynamicSamplingContext>;
|
|
29
|
+
sampled?: boolean;
|
|
30
|
+
}): TraceState | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Takes trace strings and propagates them as a remote active span.
|
|
33
|
+
* This should be used in addition to `continueTrace` in OTEL-powered environments.
|
|
34
|
+
*/
|
|
35
|
+
export declare function continueTraceAsRemoteSpan<T>(ctx: Context, options: Parameters<typeof continueTrace>[0], callback: () => T): T;
|
|
36
|
+
/**
|
|
37
|
+
* OpenTelemetry only knows about SAMPLED or NONE decision,
|
|
38
|
+
* but for us it is important to differentiate between unset and unsampled.
|
|
39
|
+
*
|
|
40
|
+
* Both of these are identified as `traceFlags === TracegFlags.NONE`,
|
|
41
|
+
* but we additionally look at a special trace state to differentiate between them.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getSamplingDecision(spanContext: SpanContext): boolean | undefined;
|
|
20
44
|
//# sourceMappingURL=propagator.d.ts.map
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
3
|
-
* No guarantees apply to these attributes, and the may change/disappear at any time.
|
|
4
|
-
*/
|
|
5
|
-
export declare const InternalSentrySemanticAttributes: {
|
|
6
|
-
readonly PARENT_SAMPLED: "sentry.parentSampled";
|
|
7
|
-
};
|
|
1
|
+
/** If this attribute is true, it means that the parent is a remote span. */
|
|
2
|
+
export declare const SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE = "sentry.parentIsRemote";
|
|
8
3
|
//# sourceMappingURL=semanticAttributes.d.ts.map
|
package/types-ts3.8/trace.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Span } from '@opentelemetry/api';
|
|
2
|
+
import { continueTrace as baseContinueTrace } from '@sentry/core';
|
|
2
3
|
import { Scope } from '@sentry/types';
|
|
3
4
|
import { OpenTelemetrySpanContext } from './types';
|
|
4
5
|
/**
|
|
@@ -20,7 +21,7 @@ export declare function startSpan<T>(options: OpenTelemetrySpanContext, callback
|
|
|
20
21
|
*
|
|
21
22
|
* Note that you'll always get a span passed to the callback, it may just be a NonRecordingSpan if the span is not sampled.
|
|
22
23
|
*/
|
|
23
|
-
export declare function startSpanManual<T>(options: OpenTelemetrySpanContext, callback: (span: Span) => T): T;
|
|
24
|
+
export declare function startSpanManual<T>(options: OpenTelemetrySpanContext, callback: (span: Span, finish: () => void) => T): T;
|
|
24
25
|
/**
|
|
25
26
|
* @deprecated Use {@link startSpan} instead.
|
|
26
27
|
*/
|
|
@@ -46,4 +47,16 @@ export declare function startInactiveSpan(options: OpenTelemetrySpanContext): Sp
|
|
|
46
47
|
* @returns the value returned from the provided callback function.
|
|
47
48
|
*/
|
|
48
49
|
export declare function withActiveSpan<T>(span: Span | null, callback: (scope: Scope) => T): T;
|
|
50
|
+
/**
|
|
51
|
+
* Continue a trace from `sentry-trace` and `baggage` values.
|
|
52
|
+
* These values can be obtained from incoming request headers, or in the browser from `<meta name="sentry-trace">`
|
|
53
|
+
* and `<meta name="baggage">` HTML tags.
|
|
54
|
+
*
|
|
55
|
+
* Spans started with `startSpan`, `startSpanManual` and `startInactiveSpan`, within the callback will automatically
|
|
56
|
+
* be attached to the incoming trace.
|
|
57
|
+
*
|
|
58
|
+
* This is a custom version of `continueTrace` that is used in OTEL-powered environments.
|
|
59
|
+
* It propagates the trace as a remote span, in addition to setting it on the propagation context.
|
|
60
|
+
*/
|
|
61
|
+
export declare function continueTrace<T>(options: Parameters<typeof baseContinueTrace>[0], callback: () => T): T;
|
|
49
62
|
//# sourceMappingURL=trace.d.ts.map
|
package/types-ts3.8/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Span as WriteableSpan, SpanKind, Tracer } from '@opentelemetry/api';
|
|
2
|
-
import { BasicTracerProvider, ReadableSpan
|
|
3
|
-
import { Scope, StartSpanOptions } from '@sentry/types';
|
|
2
|
+
import { BasicTracerProvider, ReadableSpan } from '@opentelemetry/sdk-trace-base';
|
|
3
|
+
import { Scope, Span, StartSpanOptions } from '@sentry/types';
|
|
4
4
|
export interface OpenTelemetryClient {
|
|
5
5
|
tracer: Tracer;
|
|
6
6
|
traceProvider: BasicTracerProvider | undefined;
|
|
@@ -17,8 +17,7 @@ export interface OpenTelemetrySpanContext extends StartSpanOptions {
|
|
|
17
17
|
* Note that technically, the `Span` exported from `@opentelemwetry/sdk-trace-base` matches this,
|
|
18
18
|
* but we cannot be 100% sure that we are actually getting such a span, so this type is more defensive.
|
|
19
19
|
*/
|
|
20
|
-
export type AbstractSpan = WriteableSpan | ReadableSpan;
|
|
21
|
-
export { Span };
|
|
20
|
+
export type AbstractSpan = WriteableSpan | ReadableSpan | Span;
|
|
22
21
|
export interface CurrentScopes {
|
|
23
22
|
scope: Scope;
|
|
24
23
|
isolationScope: Scope;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Span as OtelSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';
|
|
2
|
-
import { Hub } from '@sentry/types';
|
|
3
2
|
/**
|
|
4
3
|
* Maybe capture a Sentry exception for an OTEL timed event.
|
|
5
4
|
* This will check if the event is exception-like and in that case capture it as an exception.
|
|
6
5
|
*/
|
|
7
|
-
export declare function maybeCaptureExceptionForTimedEvent(
|
|
6
|
+
export declare function maybeCaptureExceptionForTimedEvent(event: TimedEvent, otelSpan?: OtelSpan): void;
|
|
8
7
|
//# sourceMappingURL=captureExceptionForTimedEvent.d.ts.map
|