@sentry/opentelemetry 10.70.0 → 11.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -15
- package/build/cjs/index.js +614 -101
- package/build/cjs/index.js.map +1 -1
- package/build/esm/index.js +611 -65
- package/build/esm/index.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/types/asyncContextStrategy.d.ts +2 -4
- package/build/types/asyncContextStrategy.d.ts.map +1 -1
- package/build/types/asyncLocalStorageContextManager.d.ts +16 -4
- package/build/types/asyncLocalStorageContextManager.d.ts.map +1 -1
- package/build/types/constants.d.ts +0 -15
- package/build/types/constants.d.ts.map +1 -1
- package/build/types/index.d.ts +5 -4
- package/build/types/index.d.ts.map +1 -1
- package/build/types/propagator.d.ts +11 -38
- package/build/types/propagator.d.ts.map +1 -1
- package/build/types/trace.d.ts +4 -31
- package/build/types/trace.d.ts.map +1 -1
- package/build/types/tracer.d.ts.map +1 -1
- package/build/types/tracerProvider.d.ts +0 -9
- package/build/types/tracerProvider.d.ts.map +1 -1
- package/build/types/types.d.ts +1 -24
- package/build/types/types.d.ts.map +1 -1
- package/build/types/utils/TraceState.d.ts.map +1 -1
- package/build/types/utils/buildContextWithSentryScopes.d.ts +1 -1
- package/build/types/utils/buildContextWithSentryScopes.d.ts.map +1 -1
- package/build/types/utils/contextData.d.ts.map +1 -1
- package/build/types/utils/getActiveSpan.d.ts +2 -1
- package/build/types/utils/getActiveSpan.d.ts.map +1 -1
- package/build/types/utils/getSamplingDecision.d.ts +0 -17
- package/build/types/utils/getSamplingDecision.d.ts.map +1 -1
- package/build/types/utils/reconcileDscSampled.d.ts +14 -0
- package/build/types/utils/reconcileDscSampled.d.ts.map +1 -0
- package/build/types/utils/suppressTracing.d.ts +5 -4
- package/build/types/utils/suppressTracing.d.ts.map +1 -1
- package/package.json +11 -38
- package/build/cjs/asyncContextStrategy-volGaYqZ.js +0 -1892
- package/build/cjs/asyncContextStrategy-volGaYqZ.js.map +0 -1
- package/build/cjs/index.browser.js +0 -53
- package/build/cjs/index.browser.js.map +0 -1
- package/build/esm/asyncContextStrategy-jD8YWNDU.js +0 -1857
- package/build/esm/asyncContextStrategy-jD8YWNDU.js.map +0 -1
- package/build/esm/index.browser.js +0 -14
- package/build/esm/index.browser.js.map +0 -1
- package/build/types/applyOtelSpanData.d.ts +0 -18
- package/build/types/applyOtelSpanData.d.ts.map +0 -1
- package/build/types/contextManager.d.ts +0 -22
- package/build/types/contextManager.d.ts.map +0 -1
- package/build/types/custom/client.d.ts +0 -12
- package/build/types/custom/client.d.ts.map +0 -1
- package/build/types/exports.d.ts +0 -27
- package/build/types/exports.d.ts.map +0 -1
- package/build/types/index.browser.d.ts +0 -10
- package/build/types/index.browser.d.ts.map +0 -1
- package/build/types/nodeAsyncContextStrategy.d.ts +0 -4
- package/build/types/nodeAsyncContextStrategy.d.ts.map +0 -1
- package/build/types/resource.d.ts +0 -26
- package/build/types/resource.d.ts.map +0 -1
- package/build/types/sampler.d.ts +0 -32
- package/build/types/sampler.d.ts.map +0 -1
- package/build/types/semanticAttributes.d.ts +0 -4
- package/build/types/semanticAttributes.d.ts.map +0 -1
- package/build/types/setupEventContextTrace.d.ts +0 -4
- package/build/types/setupEventContextTrace.d.ts.map +0 -1
- package/build/types/spanExporter.d.ts +0 -50
- package/build/types/spanExporter.d.ts.map +0 -1
- package/build/types/spanProcessor.d.ts +0 -31
- package/build/types/spanProcessor.d.ts.map +0 -1
- package/build/types/utils/backfillStreamedSpanData.d.ts +0 -16
- package/build/types/utils/backfillStreamedSpanData.d.ts.map +0 -1
- package/build/types/utils/enhanceDscWithOpenTelemetryRootSpanName.d.ts +0 -7
- package/build/types/utils/enhanceDscWithOpenTelemetryRootSpanName.d.ts.map +0 -1
- package/build/types/utils/getParentSpanId.d.ts +0 -8
- package/build/types/utils/getParentSpanId.d.ts.map +0 -1
- package/build/types/utils/getRequestSpanData.d.ts +0 -8
- package/build/types/utils/getRequestSpanData.d.ts.map +0 -1
- package/build/types/utils/getSpanKind.d.ts +0 -10
- package/build/types/utils/getSpanKind.d.ts.map +0 -1
- package/build/types/utils/getTraceData.d.ts +0 -12
- package/build/types/utils/getTraceData.d.ts.map +0 -1
- package/build/types/utils/groupSpansWithParents.d.ts +0 -17
- package/build/types/utils/groupSpansWithParents.d.ts.map +0 -1
- package/build/types/utils/isSentryRequest.d.ts +0 -8
- package/build/types/utils/isSentryRequest.d.ts.map +0 -1
- package/build/types/utils/mapStatus.d.ts +0 -9
- package/build/types/utils/mapStatus.d.ts.map +0 -1
- package/build/types/utils/parseSpanDescription.d.ts +0 -56
- package/build/types/utils/parseSpanDescription.d.ts.map +0 -1
- package/build/types/utils/setupCheck.d.ts +0 -9
- package/build/types/utils/setupCheck.d.ts.map +0 -1
- package/build/types/utils/spanTypes.d.ts +0 -52
- package/build/types/utils/spanTypes.d.ts.map +0 -1
- package/build/types-ts3.8/applyOtelSpanData.d.ts +0 -18
- package/build/types-ts3.8/asyncContextStrategy.d.ts +0 -9
- package/build/types-ts3.8/asyncLocalStorageContextManager.d.ts +0 -31
- package/build/types-ts3.8/constants.d.ts +0 -24
- package/build/types-ts3.8/contextManager.d.ts +0 -22
- package/build/types-ts3.8/custom/client.d.ts +0 -12
- package/build/types-ts3.8/debug-build.d.ts +0 -7
- package/build/types-ts3.8/exports.d.ts +0 -27
- package/build/types-ts3.8/index.browser.d.ts +0 -10
- package/build/types-ts3.8/index.d.ts +0 -5
- package/build/types-ts3.8/nodeAsyncContextStrategy.d.ts +0 -4
- package/build/types-ts3.8/propagator.d.ts +0 -43
- package/build/types-ts3.8/resource.d.ts +0 -29
- package/build/types-ts3.8/sampler.d.ts +0 -32
- package/build/types-ts3.8/semanticAttributes.d.ts +0 -4
- package/build/types-ts3.8/setupEventContextTrace.d.ts +0 -4
- package/build/types-ts3.8/spanExporter.d.ts +0 -50
- package/build/types-ts3.8/spanProcessor.d.ts +0 -31
- package/build/types-ts3.8/trace.d.ts +0 -75
- package/build/types-ts3.8/tracer.d.ts +0 -13
- package/build/types-ts3.8/tracerProvider.d.ts +0 -23
- package/build/types-ts3.8/types.d.ts +0 -29
- package/build/types-ts3.8/utils/TraceState.d.ts +0 -21
- package/build/types-ts3.8/utils/backfillStreamedSpanData.d.ts +0 -16
- package/build/types-ts3.8/utils/buildContextWithSentryScopes.d.ts +0 -12
- package/build/types-ts3.8/utils/contextData.d.ts +0 -30
- package/build/types-ts3.8/utils/enhanceDscWithOpenTelemetryRootSpanName.d.ts +0 -7
- package/build/types-ts3.8/utils/getActiveSpan.d.ts +0 -6
- package/build/types-ts3.8/utils/getParentSpanId.d.ts +0 -8
- package/build/types-ts3.8/utils/getRequestSpanData.d.ts +0 -8
- package/build/types-ts3.8/utils/getSamplingDecision.d.ts +0 -27
- package/build/types-ts3.8/utils/getSpanKind.d.ts +0 -10
- package/build/types-ts3.8/utils/getTraceData.d.ts +0 -12
- package/build/types-ts3.8/utils/groupSpansWithParents.d.ts +0 -17
- package/build/types-ts3.8/utils/isSentryRequest.d.ts +0 -8
- package/build/types-ts3.8/utils/makeTraceState.d.ts +0 -10
- package/build/types-ts3.8/utils/mapStatus.d.ts +0 -9
- package/build/types-ts3.8/utils/parseSpanDescription.d.ts +0 -56
- package/build/types-ts3.8/utils/setupCheck.d.ts +0 -9
- package/build/types-ts3.8/utils/spanTypes.d.ts +0 -52
- package/build/types-ts3.8/utils/suppressTracing.d.ts +0 -5
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { AbstractSpan } from '../types';
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* @param otelSpan Checks whether a given OTEL Span is an http request to sentry.
|
|
5
|
-
* @returns boolean
|
|
6
|
-
*/
|
|
7
|
-
export declare function isSentryRequestSpan(span: AbstractSpan): boolean;
|
|
8
|
-
//# sourceMappingURL=isSentryRequest.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { DynamicSamplingContext } from '@sentry/core';
|
|
2
|
-
import { TraceState } from './TraceState';
|
|
3
|
-
/**
|
|
4
|
-
* Generate a TraceState for the given data.
|
|
5
|
-
*/
|
|
6
|
-
export declare function makeTraceState({ dsc, sampled, }: {
|
|
7
|
-
dsc?: Partial<DynamicSamplingContext>;
|
|
8
|
-
sampled?: boolean;
|
|
9
|
-
}): TraceState;
|
|
10
|
-
//# sourceMappingURL=makeTraceState.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { SpanAttributes, SpanStatus } from '@sentry/core';
|
|
2
|
-
import { AbstractSpan } from '../types';
|
|
3
|
-
export declare const isStatusErrorMessageValid: (message: string) => boolean;
|
|
4
|
-
/**
|
|
5
|
-
* Get a Sentry span status from an otel span.
|
|
6
|
-
*/
|
|
7
|
-
export declare function mapStatus(span: AbstractSpan): SpanStatus;
|
|
8
|
-
export declare function inferStatusFromAttributes(attributes: SpanAttributes): SpanStatus | undefined;
|
|
9
|
-
//# sourceMappingURL=mapStatus.d.ts.map
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { Attributes, AttributeValue } from '@opentelemetry/api';
|
|
2
|
-
import { SpanKind } from '@opentelemetry/api';
|
|
3
|
-
import { SpanAttributes, TransactionSource } from '@sentry/core';
|
|
4
|
-
import { AbstractSpan } from '../types';
|
|
5
|
-
interface SpanDescription {
|
|
6
|
-
op: string | undefined;
|
|
7
|
-
description: string;
|
|
8
|
-
source: TransactionSource;
|
|
9
|
-
data?: Record<string, string | undefined>;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Infer the op & description for a set of name, attributes and kind of a span.
|
|
13
|
-
*/
|
|
14
|
-
export declare function inferSpanData(spanName: string, attributes: SpanAttributes, kind: SpanKind): SpanDescription;
|
|
15
|
-
/**
|
|
16
|
-
* Extract better op/description from an otel span.
|
|
17
|
-
*
|
|
18
|
-
* Does not overwrite the span name if the source is already set to custom to ensure
|
|
19
|
-
* that user-updated span names are preserved. In this case, we only adjust the op but
|
|
20
|
-
* leave span description and source unchanged.
|
|
21
|
-
*
|
|
22
|
-
* Based on https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/7422ce2a06337f68a59b552b8c5a2ac125d6bae5/exporter/sentryexporter/sentry_exporter.go#L306
|
|
23
|
-
*/
|
|
24
|
-
export declare function parseSpanDescription(span: AbstractSpan): SpanDescription;
|
|
25
|
-
/** Only exported for tests. */
|
|
26
|
-
export declare function descriptionForHttpMethod({ name, kind, attributes }: {
|
|
27
|
-
name: string;
|
|
28
|
-
attributes: Attributes;
|
|
29
|
-
kind: SpanKind;
|
|
30
|
-
}, httpMethod: AttributeValue): SpanDescription;
|
|
31
|
-
/** Exported for tests only */
|
|
32
|
-
export declare function getSanitizedUrl(attributes: Attributes, kind: SpanKind): {
|
|
33
|
-
url: string | undefined;
|
|
34
|
-
urlPath: string | undefined;
|
|
35
|
-
query: string | undefined;
|
|
36
|
-
fragment: string | undefined;
|
|
37
|
-
hasRoute: boolean;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Because Otel instrumentation sometimes mutates span names via `span.updateName`, the only way
|
|
41
|
-
* to ensure that a user-set span name is preserved is to store it as a tmp attribute on the span.
|
|
42
|
-
* We delete this attribute once we're done with it when preparing the event envelope.
|
|
43
|
-
*
|
|
44
|
-
* This temp attribute always takes precedence over the original name.
|
|
45
|
-
*
|
|
46
|
-
* We also need to take care of setting the correct source. Users can always update the source
|
|
47
|
-
* after updating the name, so we need to respect that.
|
|
48
|
-
*
|
|
49
|
-
* @internal exported only for testing
|
|
50
|
-
*/
|
|
51
|
-
export declare function getUserUpdatedNameAndSource(originalName: string, attributes: Attributes, fallbackSource?: TransactionSource): {
|
|
52
|
-
description: string;
|
|
53
|
-
source: TransactionSource;
|
|
54
|
-
};
|
|
55
|
-
export {};
|
|
56
|
-
//# sourceMappingURL=parseSpanDescription.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
type OpenTelemetryElement = 'SentrySpanProcessor' | 'SentryContextManager' | 'SentryPropagator' | 'SentrySampler' | 'SentryTracerProvider';
|
|
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
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { SpanKind, SpanStatus } from '@opentelemetry/api';
|
|
2
|
-
import { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';
|
|
3
|
-
import { AbstractSpan } from '../types';
|
|
4
|
-
/**
|
|
5
|
-
* Check if a given span has attributes.
|
|
6
|
-
* This is necessary because the base `Span` type does not have attributes,
|
|
7
|
-
* so in places where we are passed a generic span, we need to check if we want to access them.
|
|
8
|
-
*/
|
|
9
|
-
export declare function spanHasAttributes<SpanType extends AbstractSpan>(span: SpanType): span is SpanType & {
|
|
10
|
-
attributes: ReadableSpan['attributes'];
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Check if a given span has a kind.
|
|
14
|
-
* This is necessary because the base `Span` type does not have a kind,
|
|
15
|
-
* so in places where we are passed a generic span, we need to check if we want to access it.
|
|
16
|
-
*/
|
|
17
|
-
export declare function spanHasKind<SpanType extends AbstractSpan>(span: SpanType): span is SpanType & {
|
|
18
|
-
kind: SpanKind;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Check if a given span has a status.
|
|
22
|
-
* This is necessary because the base `Span` type does not have a status,
|
|
23
|
-
* so in places where we are passed a generic span, we need to check if we want to access it.
|
|
24
|
-
*/
|
|
25
|
-
export declare function spanHasStatus<SpanType extends AbstractSpan>(span: SpanType): span is SpanType & {
|
|
26
|
-
status: SpanStatus;
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Check if a given span has a name.
|
|
30
|
-
* This is necessary because the base `Span` type does not have a name,
|
|
31
|
-
* so in places where we are passed a generic span, we need to check if we want to access it.
|
|
32
|
-
*/
|
|
33
|
-
export declare function spanHasName<SpanType extends AbstractSpan>(span: SpanType): span is SpanType & {
|
|
34
|
-
name: string;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* Check if a given span has a kind.
|
|
38
|
-
* This is necessary because the base `Span` type does not have a kind,
|
|
39
|
-
* so in places where we are passed a generic span, we need to check if we want to access it.
|
|
40
|
-
*/
|
|
41
|
-
export declare function spanHasParentId<SpanType extends AbstractSpan>(span: SpanType): span is SpanType & {
|
|
42
|
-
parentSpanId: string;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Check if a given span has events.
|
|
46
|
-
* This is necessary because the base `Span` type does not have events,
|
|
47
|
-
* so in places where we are passed a generic span, we need to check if we want to access it.
|
|
48
|
-
*/
|
|
49
|
-
export declare function spanHasEvents<SpanType extends AbstractSpan>(span: SpanType): span is SpanType & {
|
|
50
|
-
events: TimedEvent[];
|
|
51
|
-
};
|
|
52
|
-
//# sourceMappingURL=spanTypes.d.ts.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Scope } from '@sentry/core';
|
|
2
|
-
/** Suppress tracing in the given callback, ensuring no spans are generated inside of it. */
|
|
3
|
-
export declare function suppressTracing<T>(callback: () => T): T;
|
|
4
|
-
export declare function isTracingSuppressed(scope?: Scope): boolean;
|
|
5
|
-
//# sourceMappingURL=suppressTracing.d.ts.map
|