@sentry/opentelemetry 7.104.0 → 8.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 +8 -14
- package/cjs/asyncContextStrategy.js +87 -19
- package/cjs/asyncContextStrategy.js.map +1 -1
- package/cjs/constants.js +14 -0
- package/cjs/constants.js.map +1 -1
- package/cjs/contextManager.js +37 -15
- package/cjs/contextManager.js.map +1 -1
- package/cjs/custom/client.js +0 -28
- package/cjs/custom/client.js.map +1 -1
- package/cjs/custom/getCurrentHub.js +106 -0
- package/cjs/custom/getCurrentHub.js.map +1 -0
- package/cjs/custom/hub.js +3 -136
- package/cjs/custom/hub.js.map +1 -1
- package/cjs/custom/transaction.js +3 -32
- package/cjs/custom/transaction.js.map +1 -1
- package/cjs/index.js +7 -7
- package/cjs/index.js.map +1 -1
- package/cjs/propagator.js +39 -12
- package/cjs/propagator.js.map +1 -1
- package/cjs/sampler.js +0 -1
- package/cjs/sampler.js.map +1 -1
- package/cjs/semanticAttributes.js +0 -9
- package/cjs/semanticAttributes.js.map +1 -1
- package/cjs/setupEventContextTrace.js +12 -7
- package/cjs/setupEventContextTrace.js.map +1 -1
- package/cjs/spanExporter.js +69 -58
- package/cjs/spanExporter.js.map +1 -1
- package/cjs/spanProcessor.js +14 -19
- package/cjs/spanProcessor.js.map +1 -1
- package/cjs/trace.js +120 -23
- package/cjs/trace.js.map +1 -1
- package/cjs/utils/addOriginToSpan.js +2 -2
- package/cjs/utils/addOriginToSpan.js.map +1 -1
- package/cjs/utils/contextData.js +38 -0
- package/cjs/utils/contextData.js.map +1 -1
- package/cjs/utils/dynamicSamplingContext.js +64 -0
- package/cjs/utils/dynamicSamplingContext.js.map +1 -0
- package/cjs/utils/spanData.js +23 -23
- package/cjs/utils/spanData.js.map +1 -1
- package/esm/asyncContextStrategy.js +89 -18
- package/esm/asyncContextStrategy.js.map +1 -1
- package/esm/constants.js +10 -1
- package/esm/constants.js.map +1 -1
- package/esm/contextManager.js +36 -17
- package/esm/contextManager.js.map +1 -1
- package/esm/custom/client.js +0 -28
- package/esm/custom/client.js.map +1 -1
- package/esm/custom/getCurrentHub.js +101 -0
- package/esm/custom/getCurrentHub.js.map +1 -0
- package/esm/custom/hub.js +4 -133
- package/esm/custom/hub.js.map +1 -1
- package/esm/custom/transaction.js +4 -32
- package/esm/custom/transaction.js.map +1 -1
- package/esm/index.js +6 -5
- package/esm/index.js.map +1 -1
- package/esm/propagator.js +42 -15
- package/esm/propagator.js.map +1 -1
- package/esm/sampler.js +0 -1
- package/esm/sampler.js.map +1 -1
- package/esm/semanticAttributes.js +0 -9
- package/esm/semanticAttributes.js.map +1 -1
- package/esm/setupEventContextTrace.js +14 -9
- package/esm/setupEventContextTrace.js.map +1 -1
- package/esm/spanExporter.js +70 -59
- package/esm/spanExporter.js.map +1 -1
- package/esm/spanProcessor.js +10 -15
- package/esm/spanProcessor.js.map +1 -1
- package/esm/trace.js +122 -26
- package/esm/trace.js.map +1 -1
- package/esm/utils/addOriginToSpan.js +2 -2
- package/esm/utils/addOriginToSpan.js.map +1 -1
- package/esm/utils/contextData.js +36 -2
- package/esm/utils/contextData.js.map +1 -1
- package/esm/utils/dynamicSamplingContext.js +59 -0
- package/esm/utils/dynamicSamplingContext.js.map +1 -0
- package/esm/utils/spanData.js +22 -20
- package/esm/utils/spanData.js.map +1 -1
- package/package.json +5 -5
- package/types/asyncContextStrategy.d.ts.map +1 -1
- package/types/constants.d.ts +5 -0
- package/types/constants.d.ts.map +1 -1
- package/types/contextManager.d.ts +1 -1
- package/types/contextManager.d.ts.map +1 -1
- package/types/custom/client.d.ts.map +1 -1
- package/types/custom/getCurrentHub.d.ts +7 -0
- package/types/custom/getCurrentHub.d.ts.map +1 -0
- package/types/custom/hub.d.ts +2 -33
- package/types/custom/hub.d.ts.map +1 -1
- package/types/custom/transaction.d.ts +1 -10
- package/types/custom/transaction.d.ts.map +1 -1
- package/types/index.d.ts +6 -5
- package/types/index.d.ts.map +1 -1
- package/types/propagator.d.ts.map +1 -1
- package/types/semanticAttributes.d.ts +0 -9
- 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 +1 -5
- package/types/spanProcessor.d.ts.map +1 -1
- package/types/trace.d.ts +14 -3
- package/types/trace.d.ts.map +1 -1
- package/types/types.d.ts +7 -12
- package/types/types.d.ts.map +1 -1
- package/types/utils/addOriginToSpan.d.ts.map +1 -1
- package/types/utils/contextData.d.ts +22 -1
- package/types/utils/contextData.d.ts.map +1 -1
- package/types/utils/dynamicSamplingContext.d.ts +11 -0
- package/types/utils/dynamicSamplingContext.d.ts.map +1 -0
- package/types/utils/spanData.d.ts +14 -8
- package/types/utils/spanData.d.ts.map +1 -1
- package/types-ts3.8/constants.d.ts +5 -0
- package/types-ts3.8/contextManager.d.ts +1 -1
- package/types-ts3.8/custom/getCurrentHub.d.ts +7 -0
- package/types-ts3.8/custom/hub.d.ts +2 -33
- package/types-ts3.8/custom/transaction.d.ts +1 -10
- package/types-ts3.8/index.d.ts +6 -5
- package/types-ts3.8/semanticAttributes.d.ts +0 -9
- package/types-ts3.8/spanProcessor.d.ts +1 -5
- package/types-ts3.8/trace.d.ts +14 -3
- package/types-ts3.8/types.d.ts +7 -12
- package/types-ts3.8/utils/contextData.d.ts +22 -1
- package/types-ts3.8/utils/dynamicSamplingContext.d.ts +11 -0
- package/types-ts3.8/utils/spanData.d.ts +14 -8
- package/cjs/custom/scope.js +0 -202
- package/cjs/custom/scope.js.map +0 -1
- package/esm/custom/scope.js +0 -200
- package/esm/custom/scope.js.map +0 -1
- package/types/custom/scope.d.ts +0 -42
- package/types/custom/scope.d.ts.map +0 -1
- package/types-ts3.8/custom/scope.d.ts +0 -42
package/types/custom/hub.d.ts
CHANGED
|
@@ -1,38 +1,7 @@
|
|
|
1
|
-
import type { Carrier, Scope } from '@sentry/core';
|
|
2
|
-
import { Hub } from '@sentry/core';
|
|
3
|
-
import type { Client } from '@sentry/types';
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
* Exported only for testing
|
|
7
|
-
*/
|
|
8
|
-
export declare class OpenTelemetryHub extends Hub {
|
|
9
|
-
constructor(client?: Client, scope?: Scope);
|
|
10
|
-
}
|
|
11
|
-
/** Custom getClient method that uses the custom hub. */
|
|
12
|
-
export declare function getClient<C extends Client>(): C | undefined;
|
|
13
|
-
/**
|
|
14
|
-
* Returns the default hub instance.
|
|
2
|
+
* Ensure the global hub is setup.
|
|
15
3
|
*
|
|
16
|
-
*
|
|
17
|
-
* contains a more recent version, it replaces the registered version.
|
|
18
|
-
* Otherwise, the currently registered hub will be returned.
|
|
19
|
-
*/
|
|
20
|
-
export declare function getCurrentHub(): Hub;
|
|
21
|
-
/**
|
|
22
|
-
* Ensure the global hub is an OpenTelemetryHub.
|
|
4
|
+
* @deprecated This will be removed in the next major version.
|
|
23
5
|
*/
|
|
24
6
|
export declare function setupGlobalHub(): void;
|
|
25
|
-
/**
|
|
26
|
-
* This will create a new {@link Hub} and add to the passed object on
|
|
27
|
-
* __SENTRY__.hub.
|
|
28
|
-
* @param carrier object
|
|
29
|
-
* @hidden
|
|
30
|
-
*/
|
|
31
|
-
export declare function getHubFromCarrier(carrier: Carrier): Hub;
|
|
32
|
-
/**
|
|
33
|
-
* @private Private API with no semver guarantees!
|
|
34
|
-
*
|
|
35
|
-
* If the carrier does not contain a hub, a new hub is created with the global hub client and scope.
|
|
36
|
-
*/
|
|
37
|
-
export declare function ensureHubOnCarrier(carrier: Carrier, parent?: Hub): void;
|
|
38
7
|
//# sourceMappingURL=hub.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hub.d.ts","sourceRoot":"","sources":["../../../src/custom/hub.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"hub.d.ts","sourceRoot":"","sources":["../../../src/custom/hub.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAErC"}
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import { Transaction } from '@sentry/core';
|
|
2
|
-
import type { Hub as HubInterface,
|
|
2
|
+
import type { Hub as HubInterface, TransactionContext } from '@sentry/types';
|
|
3
3
|
/**
|
|
4
4
|
* This is a fork of core's tracing/hubextensions.ts _startTransaction,
|
|
5
5
|
* with some OTEL specifics.
|
|
6
6
|
*/
|
|
7
7
|
export declare function startTransaction(hub: HubInterface, transactionContext: TransactionContext): Transaction;
|
|
8
|
-
/**
|
|
9
|
-
* This is a fork of the base Transaction with OTEL specific stuff added.
|
|
10
|
-
*/
|
|
11
|
-
export declare class OpenTelemetryTransaction extends Transaction {
|
|
12
|
-
/**
|
|
13
|
-
* Finish the transaction, but apply the given scope instead of the current one.
|
|
14
|
-
*/
|
|
15
|
-
finishWithScope(endTimestamp?: number, scope?: Scope): string | undefined;
|
|
16
|
-
}
|
|
17
8
|
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/custom/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../../../src/custom/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,EAAE,GAAG,IAAI,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAE7E;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,GAAG,WAAW,CAcvG"}
|
package/types/index.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ import { getRequestSpanData } from './utils/getRequestSpanData';
|
|
|
4
4
|
export type { OpenTelemetryClient } from './types';
|
|
5
5
|
export { wrapClientClass } from './custom/client';
|
|
6
6
|
export { getSpanKind } from './utils/getSpanKind';
|
|
7
|
-
export { getSpanHub, getSpanMetadata, getSpanParent,
|
|
8
|
-
export { getPropagationContextFromContext, setPropagationContextOnContext,
|
|
7
|
+
export { getSpanHub, getSpanMetadata, getSpanParent, setSpanMetadata, getSpanScopes, } from './utils/spanData';
|
|
8
|
+
export { getPropagationContextFromContext, setPropagationContextOnContext, getScopesFromContext, } from './utils/contextData';
|
|
9
9
|
export { spanHasAttributes, spanHasEvents, spanHasKind, spanHasName, spanHasParentId, spanHasStatus, } from './utils/spanTypes';
|
|
10
10
|
export { isSentryRequestSpan } from './utils/isSentryRequest';
|
|
11
11
|
export { getActiveSpan, getRootSpan } from './utils/getActiveSpan';
|
|
12
|
-
export { startSpan, startSpanManual, startInactiveSpan } from './trace';
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
12
|
+
export { startSpan, startSpanManual, startInactiveSpan, withActiveSpan } from './trace';
|
|
13
|
+
export { setupGlobalHub } from './custom/hub';
|
|
14
|
+
export { getCurrentHub } from './custom/getCurrentHub';
|
|
15
15
|
export { addTracingExtensions } from './custom/hubextensions';
|
|
16
16
|
export { setupEventContextTrace } from './setupEventContextTrace';
|
|
17
17
|
export { setOpenTelemetryContextAsyncContextStrategy } from './asyncContextStrategy';
|
|
@@ -19,6 +19,7 @@ export { wrapContextManagerClass } from './contextManager';
|
|
|
19
19
|
export { SentryPropagator } from './propagator';
|
|
20
20
|
export { SentrySpanProcessor } from './spanProcessor';
|
|
21
21
|
export { SentrySampler } from './sampler';
|
|
22
|
+
export { getClient } from '@sentry/core';
|
|
22
23
|
/**
|
|
23
24
|
* The following internal utils are not considered public API and are subject to change.
|
|
24
25
|
* @hidden
|
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,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,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,EACL,UAAU,EACV,eAAe,EACf,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,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,EACL,UAAU,EACV,eAAe,EACf,aAAa,EACb,eAAe,EACf,aAAa,GACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,gCAAgC,EAChC,8BAA8B,EAC9B,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,WAAW,EACX,eAAe,EACf,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGxF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,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;AAG1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;GAGG;AACH,QAAA,MAAM,SAAS;;;;CAIL,CAAC;AAEX,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propagator.d.ts","sourceRoot":"","sources":["../../src/propagator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,OAAO,EAAe,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEtG,OAAO,
|
|
1
|
+
{"version":3,"file":"propagator.d.ts","sourceRoot":"","sources":["../../src/propagator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,OAAO,EAAe,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEtG,OAAO,EAAc,oBAAoB,EAAuB,MAAM,qBAAqB,CAAC;AAmC5F;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,oBAAoB;IACxD;;OAEG;IACI,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI;IA0B9E;;OAEG;IACI,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,GAAG,OAAO;IAkClF;;OAEG;IACI,MAAM,IAAI,MAAM,EAAE;CAG1B"}
|
|
@@ -3,15 +3,6 @@
|
|
|
3
3
|
* No guarantees apply to these attributes, and the may change/disappear at any time.
|
|
4
4
|
*/
|
|
5
5
|
export declare const InternalSentrySemanticAttributes: {
|
|
6
|
-
readonly ORIGIN: "sentry.origin";
|
|
7
|
-
readonly OP: "sentry.op";
|
|
8
|
-
readonly SOURCE: "sentry.source";
|
|
9
|
-
readonly SAMPLE_RATE: "sentry.sample_rate";
|
|
10
6
|
readonly PARENT_SAMPLED: "sentry.parentSampled";
|
|
11
|
-
readonly BREADCRUMB_TYPE: "sentry.breadcrumb.type";
|
|
12
|
-
readonly BREADCRUMB_LEVEL: "sentry.breadcrumb.level";
|
|
13
|
-
readonly BREADCRUMB_EVENT_ID: "sentry.breadcrumb.event_id";
|
|
14
|
-
readonly BREADCRUMB_CATEGORY: "sentry.breadcrumb.category";
|
|
15
|
-
readonly BREADCRUMB_DATA: "sentry.breadcrumb.data";
|
|
16
7
|
};
|
|
17
8
|
//# sourceMappingURL=semanticAttributes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"semanticAttributes.d.ts","sourceRoot":"","sources":["../../src/semanticAttributes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,gCAAgC
|
|
1
|
+
{"version":3,"file":"semanticAttributes.d.ts","sourceRoot":"","sources":["../../src/semanticAttributes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,gCAAgC;;CAEnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setupEventContextTrace.d.ts","sourceRoot":"","sources":["../../src/setupEventContextTrace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"setupEventContextTrace.d.ts","sourceRoot":"","sources":["../../src/setupEventContextTrace.ts"],"names":[],"mappings":"AAAA,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":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"spanExporter.d.ts","sourceRoot":"","sources":["../../src/spanExporter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AA2BhF;;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"}
|
package/types/spanProcessor.d.ts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import type { Context } from '@opentelemetry/api';
|
|
2
2
|
import type { Span, SpanProcessor as SpanProcessorInterface } from '@opentelemetry/sdk-trace-base';
|
|
3
3
|
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
4
|
-
import { OpenTelemetryScope } from './custom/scope';
|
|
5
4
|
/**
|
|
6
5
|
* Converts OpenTelemetry Spans to Sentry Spans and sends them to Sentry via
|
|
7
6
|
* the Sentry SDK.
|
|
8
7
|
*/
|
|
9
8
|
export declare class SentrySpanProcessor extends BatchSpanProcessor implements SpanProcessorInterface {
|
|
10
|
-
|
|
11
|
-
constructor(options?: {
|
|
12
|
-
scopeClass?: typeof OpenTelemetryScope;
|
|
13
|
-
});
|
|
9
|
+
constructor();
|
|
14
10
|
/**
|
|
15
11
|
* @inheritDoc
|
|
16
12
|
*/
|
|
@@ -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;AAgDnE;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,kBAAmB,YAAW,sBAAsB;;IAK3F;;OAEG;IACI,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,OAAO,GAAG,IAAI;IAQxD,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 type { Scope } from '@sentry/types';
|
|
2
3
|
import type { OpenTelemetrySpanContext } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* Wraps a function with a transaction/span and finishes the span after the function is done.
|
|
@@ -9,7 +10,7 @@ import type { OpenTelemetrySpanContext } from './types';
|
|
|
9
10
|
*
|
|
10
11
|
* Note that you'll always get a span passed to the callback, it may just be a NonRecordingSpan if the span is not sampled.
|
|
11
12
|
*/
|
|
12
|
-
export declare function startSpan<T>(
|
|
13
|
+
export declare function startSpan<T>(options: OpenTelemetrySpanContext, callback: (span: Span) => T): T;
|
|
13
14
|
/**
|
|
14
15
|
* Similar to `Sentry.startSpan`. Wraps a function with a span, but does not finish the span
|
|
15
16
|
* after the function is done automatically. You'll have to call `span.end()` manually.
|
|
@@ -19,7 +20,7 @@ export declare function startSpan<T>(spanContext: OpenTelemetrySpanContext, call
|
|
|
19
20
|
*
|
|
20
21
|
* Note that you'll always get a span passed to the callback, it may just be a NonRecordingSpan if the span is not sampled.
|
|
21
22
|
*/
|
|
22
|
-
export declare function startSpanManual<T>(
|
|
23
|
+
export declare function startSpanManual<T>(options: OpenTelemetrySpanContext, callback: (span: Span) => T): T;
|
|
23
24
|
/**
|
|
24
25
|
* @deprecated Use {@link startSpan} instead.
|
|
25
26
|
*/
|
|
@@ -34,5 +35,15 @@ export declare const startActiveSpan: typeof startSpan;
|
|
|
34
35
|
* or you didn't set `tracesSampleRate` or `tracesSampler`, this function will not generate spans
|
|
35
36
|
* and the `span` returned from the callback will be undefined.
|
|
36
37
|
*/
|
|
37
|
-
export declare function startInactiveSpan(
|
|
38
|
+
export declare function startInactiveSpan(options: OpenTelemetrySpanContext): Span;
|
|
39
|
+
/**
|
|
40
|
+
* Forks the current scope and sets the provided span as active span in the context of the provided callback. Can be
|
|
41
|
+
* passed `null` to start an entirely new span tree.
|
|
42
|
+
*
|
|
43
|
+
* @param span Spans started in the context of the provided callback will be children of this span. If `null` is passed,
|
|
44
|
+
* spans started within the callback will not be attached to a parent span.
|
|
45
|
+
* @param callback Execution context in which the provided span will be active. Is passed the newly forked scope.
|
|
46
|
+
* @returns the value returned from the provided callback function.
|
|
47
|
+
*/
|
|
48
|
+
export declare function withActiveSpan<T>(span: Span | null, callback: (scope: Scope) => T): T;
|
|
38
49
|
//# 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,
|
|
1
|
+
{"version":3,"file":"trace.d.ts","sourceRoot":"","sources":["../../src/trace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,IAAI,EAAoC,MAAM,oBAAoB,CAAC;AAc1F,OAAO,KAAK,EAAU,KAAK,EAAE,MAAM,eAAe,CAAC;AAInD,OAAO,KAAK,EAAuB,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAM7E;;;;;;;;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,EAAE,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,GAAG,CAAC,CAqBpG;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"}
|
package/types/types.d.ts
CHANGED
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Span as WriteableSpan, SpanKind, Tracer } from '@opentelemetry/api';
|
|
2
2
|
import type { BasicTracerProvider, ReadableSpan, Span } from '@opentelemetry/sdk-trace-base';
|
|
3
|
-
import type { Scope,
|
|
3
|
+
import type { Scope, StartSpanOptions } from '@sentry/types';
|
|
4
4
|
export interface OpenTelemetryClient {
|
|
5
5
|
tracer: Tracer;
|
|
6
6
|
traceProvider: BasicTracerProvider | undefined;
|
|
7
7
|
}
|
|
8
|
-
export interface OpenTelemetrySpanContext {
|
|
9
|
-
name: string;
|
|
10
|
-
op?: string;
|
|
11
|
-
metadata?: Partial<TransactionMetadata>;
|
|
12
|
-
origin?: SpanOrigin;
|
|
13
|
-
source?: TransactionSource;
|
|
14
|
-
scope?: Scope;
|
|
15
|
-
onlyIfParent?: boolean;
|
|
16
|
-
attributes?: Attributes;
|
|
8
|
+
export interface OpenTelemetrySpanContext extends StartSpanOptions {
|
|
17
9
|
kind?: SpanKind;
|
|
18
|
-
startTime?: TimeInput;
|
|
19
10
|
}
|
|
20
11
|
/**
|
|
21
12
|
* The base `Span` type is basically a `WriteableSpan`.
|
|
@@ -28,4 +19,8 @@ export interface OpenTelemetrySpanContext {
|
|
|
28
19
|
*/
|
|
29
20
|
export type AbstractSpan = WriteableSpan | ReadableSpan;
|
|
30
21
|
export type { Span };
|
|
22
|
+
export interface CurrentScopes {
|
|
23
|
+
scope: Scope;
|
|
24
|
+
isolationScope: Scope;
|
|
25
|
+
}
|
|
31
26
|
//# sourceMappingURL=types.d.ts.map
|
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,
|
|
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,IAAI,EAAE,MAAM,+BAA+B,CAAC;AAC7F,OAAO,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAE7D,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,CAAC;AAExD,YAAY,EAAE,IAAI,EAAE,CAAC;AAErB,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,KAAK,CAAC;CACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addOriginToSpan.d.ts","sourceRoot":"","sources":["../../../src/utils/addOriginToSpan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"addOriginToSpan.d.ts","sourceRoot":"","sources":["../../../src/utils/addOriginToSpan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,sCAAsC;AACtC,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAEpE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Context } from '@opentelemetry/api';
|
|
2
|
-
import type { Hub, PropagationContext } from '@sentry/types';
|
|
2
|
+
import type { Hub, PropagationContext, Scope } from '@sentry/types';
|
|
3
|
+
import type { CurrentScopes } from '../types';
|
|
3
4
|
/**
|
|
4
5
|
* Try to get the Propagation Context from the given OTEL context.
|
|
5
6
|
* This requires the SentryPropagator to be registered.
|
|
@@ -20,4 +21,24 @@ export declare function getHubFromContext(context: Context): Hub | undefined;
|
|
|
20
21
|
* This will return a forked context with the Propagation Context set.
|
|
21
22
|
*/
|
|
22
23
|
export declare function setHubOnContext(context: Context, hub: Hub): Context;
|
|
24
|
+
/**
|
|
25
|
+
* Try to get the current scopes from the given OTEL context.
|
|
26
|
+
* This requires a Context Manager that was wrapped with getWrappedContextManager.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getScopesFromContext(context: Context): CurrentScopes | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Set the current scopes on an OTEL context.
|
|
31
|
+
* This will return a forked context with the Propagation Context set.
|
|
32
|
+
*/
|
|
33
|
+
export declare function setScopesOnContext(context: Context, scopes: CurrentScopes): Context;
|
|
34
|
+
/**
|
|
35
|
+
* Set the context on the scope so we can later look it up.
|
|
36
|
+
* We need this to get the context from the scope in the `trace` functions.
|
|
37
|
+
*/
|
|
38
|
+
export declare function setContextOnScope(scope: Scope, context: Context): void;
|
|
39
|
+
/**
|
|
40
|
+
* Get the context related to a scope.
|
|
41
|
+
* TODO v8: Use this for the `trace` functions.
|
|
42
|
+
* */
|
|
43
|
+
export declare function getContextFromScope(scope: Scope): Context | undefined;
|
|
23
44
|
//# sourceMappingURL=contextData.d.ts.map
|
|
@@ -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,GAAG,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;
|
|
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,GAAG,EAAE,kBAAkB,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAOpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAI9C;;;GAGG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAEjG;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,GAAG,OAAO,CAEhH;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,GAAG,GAAG,SAAS,CAEnE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAEnE;AAED;;;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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DynamicSamplingContext } from '@sentry/types';
|
|
2
|
+
import type { AbstractSpan } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a dynamic sampling context from a span (and client and scope)
|
|
5
|
+
*
|
|
6
|
+
* @param span the span from which a few values like the root span name and sample rate are extracted.
|
|
7
|
+
*
|
|
8
|
+
* @returns a dynamic sampling context
|
|
9
|
+
*/
|
|
10
|
+
export declare function getDynamicSamplingContextFromSpan(span: AbstractSpan): Readonly<Partial<DynamicSamplingContext>>;
|
|
11
|
+
//# sourceMappingURL=dynamicSamplingContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamicSamplingContext.d.ts","sourceRoot":"","sources":["../../../src/utils/dynamicSamplingContext.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAG5D,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"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import type { Span } from '@opentelemetry/api';
|
|
2
2
|
import type { Hub, Scope, TransactionMetadata } from '@sentry/types';
|
|
3
3
|
import type { AbstractSpan } from '../types';
|
|
4
|
-
/** Set the Sentry scope on an OTEL span. */
|
|
5
|
-
export declare function setSpanScope(span: AbstractSpan, scope: Scope): void;
|
|
6
|
-
/** Get the Sentry scope of an OTEL span. */
|
|
7
|
-
export declare function getSpanScope(span: AbstractSpan): Scope | undefined;
|
|
8
4
|
/** Set the Sentry hub on an OTEL span. */
|
|
9
5
|
export declare function setSpanHub(span: AbstractSpan, hub: Hub): void;
|
|
10
6
|
/** Get the Sentry hub of an OTEL span. */
|
|
@@ -17,8 +13,18 @@ export declare function getSpanParent(span: AbstractSpan): Span | undefined;
|
|
|
17
13
|
export declare function setSpanMetadata(span: AbstractSpan, metadata: Partial<TransactionMetadata>): void;
|
|
18
14
|
/** Get metadata for an OTEL span. */
|
|
19
15
|
export declare function getSpanMetadata(span: AbstractSpan): Partial<TransactionMetadata> | undefined;
|
|
20
|
-
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Set the Sentry scope to be used for finishing a given OTEL span.
|
|
18
|
+
* This is different from `setCapturedScopesOnSpan`, as that works on _sentry_ spans,
|
|
19
|
+
* while here we are basically "caching" this on the otel spans.
|
|
20
|
+
*/
|
|
21
|
+
export declare function setSpanScopes(span: AbstractSpan, scopes: {
|
|
22
|
+
scope: Scope;
|
|
23
|
+
isolationScope: Scope;
|
|
24
|
+
}): void;
|
|
25
|
+
/** Get the Sentry scopes to use for finishing an OTEL span. */
|
|
26
|
+
export declare function getSpanScopes(span: AbstractSpan): {
|
|
27
|
+
scope: Scope;
|
|
28
|
+
isolationScope: Scope;
|
|
29
|
+
} | undefined;
|
|
24
30
|
//# sourceMappingURL=spanData.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spanData.d.ts","sourceRoot":"","sources":["../../../src/utils/spanData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAErE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"spanData.d.ts","sourceRoot":"","sources":["../../../src/utils/spanData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAErE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAgB7C,0CAA0C;AAC1C,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,GAAG,GAAG,IAAI,CAE7D;AAED,0CAA0C;AAC1C,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,GAAG,GAAG,GAAG,SAAS,CAE9D;AAED,gDAAgD;AAChD,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,GAAG,IAAI,CAExE;AAED,gDAAgD;AAChD,wBAAgB,aAAa,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,CAElE;AAED,qCAAqC;AACrC,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAEhG;AAED,qCAAqC;AACrC,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC,GAAG,SAAS,CAE5F;AAED;;;;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,7 +1,12 @@
|
|
|
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.trace";
|
|
3
4
|
/** Context Key to hold a PropagationContext. */
|
|
4
5
|
export declare const SENTRY_PROPAGATION_CONTEXT_CONTEXT_KEY: symbol;
|
|
5
6
|
/** Context Key to hold a Hub. */
|
|
6
7
|
export declare const SENTRY_HUB_CONTEXT_KEY: symbol;
|
|
8
|
+
export declare const SENTRY_SCOPES_CONTEXT_KEY: symbol;
|
|
9
|
+
export declare const SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY: symbol;
|
|
10
|
+
export declare const SENTRY_FORK_SET_SCOPE_CONTEXT_KEY: symbol;
|
|
11
|
+
export declare const SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY: symbol;
|
|
7
12
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -7,5 +7,5 @@ import { ContextManager } from '@opentelemetry/api';
|
|
|
7
7
|
* const SentryContextManager = wrapContextManagerClass(AsyncLocalStorageContextManager);
|
|
8
8
|
* const contextManager = new SentryContextManager();
|
|
9
9
|
*/
|
|
10
|
-
export declare function wrapContextManagerClass<ContextManagerInstance extends ContextManager>(ContextManagerClass: new (...args:
|
|
10
|
+
export declare function wrapContextManagerClass<ContextManagerInstance extends ContextManager>(ContextManagerClass: new (...args: unknown[]) => ContextManagerInstance): typeof ContextManagerClass;
|
|
11
11
|
//# sourceMappingURL=contextManager.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Hub } from '@sentry/types';
|
|
2
|
+
/**
|
|
3
|
+
* This is for legacy reasons, and returns a proxy object instead of a hub to be used.
|
|
4
|
+
* @deprecated Use the methods directly.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getCurrentHub(): Hub;
|
|
7
|
+
//# sourceMappingURL=getCurrentHub.d.ts.map
|
|
@@ -1,38 +1,7 @@
|
|
|
1
|
-
import { Carrier, Scope } from '@sentry/core';
|
|
2
|
-
import { Hub } from '@sentry/core';
|
|
3
|
-
import { Client } from '@sentry/types';
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
* Exported only for testing
|
|
7
|
-
*/
|
|
8
|
-
export declare class OpenTelemetryHub extends Hub {
|
|
9
|
-
constructor(client?: Client, scope?: Scope);
|
|
10
|
-
}
|
|
11
|
-
/** Custom getClient method that uses the custom hub. */
|
|
12
|
-
export declare function getClient<C extends Client>(): C | undefined;
|
|
13
|
-
/**
|
|
14
|
-
* Returns the default hub instance.
|
|
2
|
+
* Ensure the global hub is setup.
|
|
15
3
|
*
|
|
16
|
-
*
|
|
17
|
-
* contains a more recent version, it replaces the registered version.
|
|
18
|
-
* Otherwise, the currently registered hub will be returned.
|
|
19
|
-
*/
|
|
20
|
-
export declare function getCurrentHub(): Hub;
|
|
21
|
-
/**
|
|
22
|
-
* Ensure the global hub is an OpenTelemetryHub.
|
|
4
|
+
* @deprecated This will be removed in the next major version.
|
|
23
5
|
*/
|
|
24
6
|
export declare function setupGlobalHub(): void;
|
|
25
|
-
/**
|
|
26
|
-
* This will create a new {@link Hub} and add to the passed object on
|
|
27
|
-
* __SENTRY__.hub.
|
|
28
|
-
* @param carrier object
|
|
29
|
-
* @hidden
|
|
30
|
-
*/
|
|
31
|
-
export declare function getHubFromCarrier(carrier: Carrier): Hub;
|
|
32
|
-
/**
|
|
33
|
-
* @private Private API with no semver guarantees!
|
|
34
|
-
*
|
|
35
|
-
* If the carrier does not contain a hub, a new hub is created with the global hub client and scope.
|
|
36
|
-
*/
|
|
37
|
-
export declare function ensureHubOnCarrier(carrier: Carrier, parent?: Hub): void;
|
|
38
7
|
//# sourceMappingURL=hub.d.ts.map
|
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import { Transaction } from '@sentry/core';
|
|
2
|
-
import { Hub as HubInterface,
|
|
2
|
+
import { Hub as HubInterface, TransactionContext } from '@sentry/types';
|
|
3
3
|
/**
|
|
4
4
|
* This is a fork of core's tracing/hubextensions.ts _startTransaction,
|
|
5
5
|
* with some OTEL specifics.
|
|
6
6
|
*/
|
|
7
7
|
export declare function startTransaction(hub: HubInterface, transactionContext: TransactionContext): Transaction;
|
|
8
|
-
/**
|
|
9
|
-
* This is a fork of the base Transaction with OTEL specific stuff added.
|
|
10
|
-
*/
|
|
11
|
-
export declare class OpenTelemetryTransaction extends Transaction {
|
|
12
|
-
/**
|
|
13
|
-
* Finish the transaction, but apply the given scope instead of the current one.
|
|
14
|
-
*/
|
|
15
|
-
finishWithScope(endTimestamp?: number, scope?: Scope): string | undefined;
|
|
16
|
-
}
|
|
17
8
|
//# sourceMappingURL=transaction.d.ts.map
|
package/types-ts3.8/index.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ import { getRequestSpanData } from './utils/getRequestSpanData';
|
|
|
4
4
|
export { OpenTelemetryClient } from './types';
|
|
5
5
|
export { wrapClientClass } from './custom/client';
|
|
6
6
|
export { getSpanKind } from './utils/getSpanKind';
|
|
7
|
-
export { getSpanHub, getSpanMetadata, getSpanParent,
|
|
8
|
-
export { getPropagationContextFromContext, setPropagationContextOnContext,
|
|
7
|
+
export { getSpanHub, getSpanMetadata, getSpanParent, setSpanMetadata, getSpanScopes, } from './utils/spanData';
|
|
8
|
+
export { getPropagationContextFromContext, setPropagationContextOnContext, getScopesFromContext, } from './utils/contextData';
|
|
9
9
|
export { spanHasAttributes, spanHasEvents, spanHasKind, spanHasName, spanHasParentId, spanHasStatus, } from './utils/spanTypes';
|
|
10
10
|
export { isSentryRequestSpan } from './utils/isSentryRequest';
|
|
11
11
|
export { getActiveSpan, getRootSpan } from './utils/getActiveSpan';
|
|
12
|
-
export { startSpan, startSpanManual, startInactiveSpan } from './trace';
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
12
|
+
export { startSpan, startSpanManual, startInactiveSpan, withActiveSpan } from './trace';
|
|
13
|
+
export { setupGlobalHub } from './custom/hub';
|
|
14
|
+
export { getCurrentHub } from './custom/getCurrentHub';
|
|
15
15
|
export { addTracingExtensions } from './custom/hubextensions';
|
|
16
16
|
export { setupEventContextTrace } from './setupEventContextTrace';
|
|
17
17
|
export { setOpenTelemetryContextAsyncContextStrategy } from './asyncContextStrategy';
|
|
@@ -19,6 +19,7 @@ export { wrapContextManagerClass } from './contextManager';
|
|
|
19
19
|
export { SentryPropagator } from './propagator';
|
|
20
20
|
export { SentrySpanProcessor } from './spanProcessor';
|
|
21
21
|
export { SentrySampler } from './sampler';
|
|
22
|
+
export { getClient } from '@sentry/core';
|
|
22
23
|
/**
|
|
23
24
|
* The following internal utils are not considered public API and are subject to change.
|
|
24
25
|
* @hidden
|
|
@@ -3,15 +3,6 @@
|
|
|
3
3
|
* No guarantees apply to these attributes, and the may change/disappear at any time.
|
|
4
4
|
*/
|
|
5
5
|
export declare const InternalSentrySemanticAttributes: {
|
|
6
|
-
readonly ORIGIN: "sentry.origin";
|
|
7
|
-
readonly OP: "sentry.op";
|
|
8
|
-
readonly SOURCE: "sentry.source";
|
|
9
|
-
readonly SAMPLE_RATE: "sentry.sample_rate";
|
|
10
6
|
readonly PARENT_SAMPLED: "sentry.parentSampled";
|
|
11
|
-
readonly BREADCRUMB_TYPE: "sentry.breadcrumb.type";
|
|
12
|
-
readonly BREADCRUMB_LEVEL: "sentry.breadcrumb.level";
|
|
13
|
-
readonly BREADCRUMB_EVENT_ID: "sentry.breadcrumb.event_id";
|
|
14
|
-
readonly BREADCRUMB_CATEGORY: "sentry.breadcrumb.category";
|
|
15
|
-
readonly BREADCRUMB_DATA: "sentry.breadcrumb.data";
|
|
16
7
|
};
|
|
17
8
|
//# sourceMappingURL=semanticAttributes.d.ts.map
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { Context } from '@opentelemetry/api';
|
|
2
2
|
import { Span, SpanProcessor as SpanProcessorInterface } from '@opentelemetry/sdk-trace-base';
|
|
3
3
|
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
4
|
-
import { OpenTelemetryScope } from './custom/scope';
|
|
5
4
|
/**
|
|
6
5
|
* Converts OpenTelemetry Spans to Sentry Spans and sends them to Sentry via
|
|
7
6
|
* the Sentry SDK.
|
|
8
7
|
*/
|
|
9
8
|
export declare class SentrySpanProcessor extends BatchSpanProcessor implements SpanProcessorInterface {
|
|
10
|
-
|
|
11
|
-
constructor(options?: {
|
|
12
|
-
scopeClass?: typeof OpenTelemetryScope;
|
|
13
|
-
});
|
|
9
|
+
constructor();
|
|
14
10
|
/**
|
|
15
11
|
* @inheritDoc
|
|
16
12
|
*/
|
package/types-ts3.8/trace.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Span } from '@opentelemetry/api';
|
|
2
|
+
import { Scope } from '@sentry/types';
|
|
2
3
|
import { OpenTelemetrySpanContext } from './types';
|
|
3
4
|
/**
|
|
4
5
|
* Wraps a function with a transaction/span and finishes the span after the function is done.
|
|
@@ -9,7 +10,7 @@ import { OpenTelemetrySpanContext } from './types';
|
|
|
9
10
|
*
|
|
10
11
|
* Note that you'll always get a span passed to the callback, it may just be a NonRecordingSpan if the span is not sampled.
|
|
11
12
|
*/
|
|
12
|
-
export declare function startSpan<T>(
|
|
13
|
+
export declare function startSpan<T>(options: OpenTelemetrySpanContext, callback: (span: Span) => T): T;
|
|
13
14
|
/**
|
|
14
15
|
* Similar to `Sentry.startSpan`. Wraps a function with a span, but does not finish the span
|
|
15
16
|
* after the function is done automatically. You'll have to call `span.end()` manually.
|
|
@@ -19,7 +20,7 @@ export declare function startSpan<T>(spanContext: OpenTelemetrySpanContext, call
|
|
|
19
20
|
*
|
|
20
21
|
* Note that you'll always get a span passed to the callback, it may just be a NonRecordingSpan if the span is not sampled.
|
|
21
22
|
*/
|
|
22
|
-
export declare function startSpanManual<T>(
|
|
23
|
+
export declare function startSpanManual<T>(options: OpenTelemetrySpanContext, callback: (span: Span) => T): T;
|
|
23
24
|
/**
|
|
24
25
|
* @deprecated Use {@link startSpan} instead.
|
|
25
26
|
*/
|
|
@@ -34,5 +35,15 @@ export declare const startActiveSpan: typeof startSpan;
|
|
|
34
35
|
* or you didn't set `tracesSampleRate` or `tracesSampler`, this function will not generate spans
|
|
35
36
|
* and the `span` returned from the callback will be undefined.
|
|
36
37
|
*/
|
|
37
|
-
export declare function startInactiveSpan(
|
|
38
|
+
export declare function startInactiveSpan(options: OpenTelemetrySpanContext): Span;
|
|
39
|
+
/**
|
|
40
|
+
* Forks the current scope and sets the provided span as active span in the context of the provided callback. Can be
|
|
41
|
+
* passed `null` to start an entirely new span tree.
|
|
42
|
+
*
|
|
43
|
+
* @param span Spans started in the context of the provided callback will be children of this span. If `null` is passed,
|
|
44
|
+
* spans started within the callback will not be attached to a parent span.
|
|
45
|
+
* @param callback Execution context in which the provided span will be active. Is passed the newly forked scope.
|
|
46
|
+
* @returns the value returned from the provided callback function.
|
|
47
|
+
*/
|
|
48
|
+
export declare function withActiveSpan<T>(span: Span | null, callback: (scope: Scope) => T): T;
|
|
38
49
|
//# sourceMappingURL=trace.d.ts.map
|
package/types-ts3.8/types.d.ts
CHANGED
|
@@ -1,21 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Span as WriteableSpan, SpanKind, Tracer } from '@opentelemetry/api';
|
|
2
2
|
import { BasicTracerProvider, ReadableSpan, Span } from '@opentelemetry/sdk-trace-base';
|
|
3
|
-
import { Scope,
|
|
3
|
+
import { Scope, StartSpanOptions } from '@sentry/types';
|
|
4
4
|
export interface OpenTelemetryClient {
|
|
5
5
|
tracer: Tracer;
|
|
6
6
|
traceProvider: BasicTracerProvider | undefined;
|
|
7
7
|
}
|
|
8
|
-
export interface OpenTelemetrySpanContext {
|
|
9
|
-
name: string;
|
|
10
|
-
op?: string;
|
|
11
|
-
metadata?: Partial<TransactionMetadata>;
|
|
12
|
-
origin?: SpanOrigin;
|
|
13
|
-
source?: TransactionSource;
|
|
14
|
-
scope?: Scope;
|
|
15
|
-
onlyIfParent?: boolean;
|
|
16
|
-
attributes?: Attributes;
|
|
8
|
+
export interface OpenTelemetrySpanContext extends StartSpanOptions {
|
|
17
9
|
kind?: SpanKind;
|
|
18
|
-
startTime?: TimeInput;
|
|
19
10
|
}
|
|
20
11
|
/**
|
|
21
12
|
* The base `Span` type is basically a `WriteableSpan`.
|
|
@@ -28,4 +19,8 @@ export interface OpenTelemetrySpanContext {
|
|
|
28
19
|
*/
|
|
29
20
|
export type AbstractSpan = WriteableSpan | ReadableSpan;
|
|
30
21
|
export { Span };
|
|
22
|
+
export interface CurrentScopes {
|
|
23
|
+
scope: Scope;
|
|
24
|
+
isolationScope: Scope;
|
|
25
|
+
}
|
|
31
26
|
//# sourceMappingURL=types.d.ts.map
|