@sentry/core 10.47.0 → 10.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/attributes.js +43 -0
- package/build/cjs/attributes.js.map +1 -1
- package/build/cjs/client.js +13 -6
- package/build/cjs/client.js.map +1 -1
- package/build/cjs/envelope.js +4 -3
- package/build/cjs/envelope.js.map +1 -1
- package/build/cjs/index.js +44 -13
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/integration.js +6 -0
- package/build/cjs/integration.js.map +1 -1
- package/build/cjs/integrations/express/index.js +206 -0
- package/build/cjs/integrations/express/index.js.map +1 -0
- package/build/cjs/integrations/express/patch-layer.js +251 -0
- package/build/cjs/integrations/express/patch-layer.js.map +1 -0
- package/build/cjs/integrations/express/request-layer-store.js +25 -0
- package/build/cjs/integrations/express/request-layer-store.js.map +1 -0
- package/build/cjs/integrations/express/set-sdk-processing-metadata.js +17 -0
- package/build/cjs/integrations/express/set-sdk-processing-metadata.js.map +1 -0
- package/build/cjs/integrations/express/types.js +17 -0
- package/build/cjs/integrations/express/types.js.map +1 -0
- package/build/cjs/integrations/express/utils.js +238 -0
- package/build/cjs/integrations/express/utils.js.map +1 -0
- package/build/cjs/integrations/mcp-server/correlation.js +5 -1
- package/build/cjs/integrations/mcp-server/correlation.js.map +1 -1
- package/build/cjs/integrations/mcp-server/handlers.js +18 -10
- package/build/cjs/integrations/mcp-server/handlers.js.map +1 -1
- package/build/cjs/integrations/mcp-server/index.js +2 -1
- package/build/cjs/integrations/mcp-server/index.js.map +1 -1
- package/build/cjs/integrations/mcp-server/transport.js +1 -1
- package/build/cjs/integrations/mcp-server/transport.js.map +1 -1
- package/build/cjs/integrations/mcp-server/validation.js +7 -5
- package/build/cjs/integrations/mcp-server/validation.js.map +1 -1
- package/build/cjs/integrations/spanStreaming.js +48 -0
- package/build/cjs/integrations/spanStreaming.js.map +1 -0
- package/build/cjs/semanticAttributes.js +35 -3
- package/build/cjs/semanticAttributes.js.map +1 -1
- package/build/cjs/tracing/ai/gen-ai-attributes.js +9 -65
- package/build/cjs/tracing/ai/gen-ai-attributes.js.map +1 -1
- package/build/cjs/tracing/ai/utils.js +50 -0
- package/build/cjs/tracing/ai/utils.js.map +1 -1
- package/build/cjs/tracing/anthropic-ai/index.js +1 -12
- package/build/cjs/tracing/anthropic-ai/index.js.map +1 -1
- package/build/cjs/tracing/anthropic-ai/streaming.js +2 -100
- package/build/cjs/tracing/anthropic-ai/streaming.js.map +1 -1
- package/build/cjs/tracing/dynamicSamplingContext.js +2 -1
- package/build/cjs/tracing/dynamicSamplingContext.js.map +1 -1
- package/build/cjs/tracing/google-genai/constants.js +1 -6
- package/build/cjs/tracing/google-genai/constants.js.map +1 -1
- package/build/cjs/tracing/google-genai/index.js +24 -30
- package/build/cjs/tracing/google-genai/index.js.map +1 -1
- package/build/cjs/tracing/google-genai/streaming.js +2 -23
- package/build/cjs/tracing/google-genai/streaming.js.map +1 -1
- package/build/cjs/tracing/langchain/embeddings.js +132 -0
- package/build/cjs/tracing/langchain/embeddings.js.map +1 -0
- package/build/cjs/tracing/langchain/index.js.map +1 -1
- package/build/cjs/tracing/openai/index.js +2 -29
- package/build/cjs/tracing/openai/index.js.map +1 -1
- package/build/cjs/tracing/openai/streaming.js +3 -34
- package/build/cjs/tracing/openai/streaming.js.map +1 -1
- package/build/cjs/tracing/openai/utils.js +78 -204
- package/build/cjs/tracing/openai/utils.js.map +1 -1
- package/build/cjs/tracing/sentryNonRecordingSpan.js +7 -0
- package/build/cjs/tracing/sentryNonRecordingSpan.js.map +1 -1
- package/build/cjs/tracing/sentrySpan.js +39 -0
- package/build/cjs/tracing/sentrySpan.js.map +1 -1
- package/build/cjs/tracing/spans/beforeSendSpan.js +43 -0
- package/build/cjs/tracing/spans/beforeSendSpan.js.map +1 -0
- package/build/cjs/tracing/spans/captureSpan.js +126 -0
- package/build/cjs/tracing/spans/captureSpan.js.map +1 -0
- package/build/cjs/tracing/spans/envelope.js +38 -0
- package/build/cjs/tracing/spans/envelope.js.map +1 -0
- package/build/cjs/tracing/spans/estimateSize.js +41 -0
- package/build/cjs/tracing/spans/estimateSize.js.map +1 -0
- package/build/cjs/tracing/spans/hasSpanStreamingEnabled.js +11 -0
- package/build/cjs/tracing/spans/hasSpanStreamingEnabled.js.map +1 -0
- package/build/cjs/tracing/spans/spanBuffer.js +158 -0
- package/build/cjs/tracing/spans/spanBuffer.js.map +1 -0
- package/build/cjs/tracing/trace.js +83 -13
- package/build/cjs/tracing/trace.js.map +1 -1
- package/build/cjs/tracing/vercel-ai/utils.js +1 -4
- package/build/cjs/tracing/vercel-ai/utils.js.map +1 -1
- package/build/cjs/utils/featureFlags.js +6 -0
- package/build/cjs/utils/featureFlags.js.map +1 -1
- package/build/cjs/utils/object.js +33 -0
- package/build/cjs/utils/object.js.map +1 -1
- package/build/cjs/utils/spanUtils.js +116 -13
- package/build/cjs/utils/spanUtils.js.map +1 -1
- package/build/cjs/utils/stacktrace.js +3 -1
- package/build/cjs/utils/stacktrace.js.map +1 -1
- package/build/cjs/utils/string.js +3 -0
- package/build/cjs/utils/string.js.map +1 -1
- package/build/cjs/utils/version.js +1 -1
- package/build/esm/attributes.js +43 -1
- package/build/esm/attributes.js.map +1 -1
- package/build/esm/client.js +8 -1
- package/build/esm/client.js.map +1 -1
- package/build/esm/envelope.js +2 -1
- package/build/esm/envelope.js.map +1 -1
- package/build/esm/index.js +10 -2
- package/build/esm/index.js.map +1 -1
- package/build/esm/integration.js +6 -0
- package/build/esm/integration.js.map +1 -1
- package/build/esm/integrations/express/index.js +202 -0
- package/build/esm/integrations/express/index.js.map +1 -0
- package/build/esm/integrations/express/patch-layer.js +249 -0
- package/build/esm/integrations/express/patch-layer.js.map +1 -0
- package/build/esm/integrations/express/request-layer-store.js +22 -0
- package/build/esm/integrations/express/request-layer-store.js.map +1 -0
- package/build/esm/integrations/express/set-sdk-processing-metadata.js +15 -0
- package/build/esm/integrations/express/set-sdk-processing-metadata.js.map +1 -0
- package/build/esm/integrations/express/types.js +10 -0
- package/build/esm/integrations/express/types.js.map +1 -0
- package/build/esm/integrations/express/utils.js +225 -0
- package/build/esm/integrations/express/utils.js.map +1 -0
- package/build/esm/integrations/mcp-server/correlation.js +5 -1
- package/build/esm/integrations/mcp-server/correlation.js.map +1 -1
- package/build/esm/integrations/mcp-server/handlers.js +18 -10
- package/build/esm/integrations/mcp-server/handlers.js.map +1 -1
- package/build/esm/integrations/mcp-server/index.js +2 -1
- package/build/esm/integrations/mcp-server/index.js.map +1 -1
- package/build/esm/integrations/mcp-server/transport.js +1 -1
- package/build/esm/integrations/mcp-server/transport.js.map +1 -1
- package/build/esm/integrations/mcp-server/validation.js +7 -5
- package/build/esm/integrations/mcp-server/validation.js.map +1 -1
- package/build/esm/integrations/spanStreaming.js +46 -0
- package/build/esm/integrations/spanStreaming.js.map +1 -0
- package/build/esm/package.json +1 -1
- package/build/esm/semanticAttributes.js +26 -4
- package/build/esm/semanticAttributes.js.map +1 -1
- package/build/esm/tracing/ai/gen-ai-attributes.js +8 -56
- package/build/esm/tracing/ai/gen-ai-attributes.js.map +1 -1
- package/build/esm/tracing/ai/utils.js +51 -2
- package/build/esm/tracing/ai/utils.js.map +1 -1
- package/build/esm/tracing/anthropic-ai/index.js +2 -13
- package/build/esm/tracing/anthropic-ai/index.js.map +1 -1
- package/build/esm/tracing/anthropic-ai/streaming.js +3 -101
- package/build/esm/tracing/anthropic-ai/streaming.js.map +1 -1
- package/build/esm/tracing/dynamicSamplingContext.js +2 -1
- package/build/esm/tracing/dynamicSamplingContext.js.map +1 -1
- package/build/esm/tracing/google-genai/constants.js +2 -5
- package/build/esm/tracing/google-genai/constants.js.map +1 -1
- package/build/esm/tracing/google-genai/index.js +25 -31
- package/build/esm/tracing/google-genai/index.js.map +1 -1
- package/build/esm/tracing/google-genai/streaming.js +2 -23
- package/build/esm/tracing/google-genai/streaming.js.map +1 -1
- package/build/esm/tracing/langchain/embeddings.js +129 -0
- package/build/esm/tracing/langchain/embeddings.js.map +1 -0
- package/build/esm/tracing/langchain/index.js.map +1 -1
- package/build/esm/tracing/openai/index.js +3 -30
- package/build/esm/tracing/openai/index.js.map +1 -1
- package/build/esm/tracing/openai/streaming.js +4 -35
- package/build/esm/tracing/openai/streaming.js.map +1 -1
- package/build/esm/tracing/openai/utils.js +79 -196
- package/build/esm/tracing/openai/utils.js.map +1 -1
- package/build/esm/tracing/sentryNonRecordingSpan.js +7 -0
- package/build/esm/tracing/sentryNonRecordingSpan.js.map +1 -1
- package/build/esm/tracing/sentrySpan.js +40 -1
- package/build/esm/tracing/sentrySpan.js.map +1 -1
- package/build/esm/tracing/spans/beforeSendSpan.js +40 -0
- package/build/esm/tracing/spans/beforeSendSpan.js.map +1 -0
- package/build/esm/tracing/spans/captureSpan.js +122 -0
- package/build/esm/tracing/spans/captureSpan.js.map +1 -0
- package/build/esm/tracing/spans/envelope.js +36 -0
- package/build/esm/tracing/spans/envelope.js.map +1 -0
- package/build/esm/tracing/spans/estimateSize.js +39 -0
- package/build/esm/tracing/spans/estimateSize.js.map +1 -0
- package/build/esm/tracing/spans/hasSpanStreamingEnabled.js +9 -0
- package/build/esm/tracing/spans/hasSpanStreamingEnabled.js.map +1 -0
- package/build/esm/tracing/spans/spanBuffer.js +156 -0
- package/build/esm/tracing/spans/spanBuffer.js.map +1 -0
- package/build/esm/tracing/trace.js +84 -14
- package/build/esm/tracing/trace.js.map +1 -1
- package/build/esm/tracing/vercel-ai/utils.js +2 -5
- package/build/esm/tracing/vercel-ai/utils.js.map +1 -1
- package/build/esm/utils/featureFlags.js +6 -0
- package/build/esm/utils/featureFlags.js.map +1 -1
- package/build/esm/utils/object.js +33 -1
- package/build/esm/utils/object.js.map +1 -1
- package/build/esm/utils/spanUtils.js +112 -14
- package/build/esm/utils/spanUtils.js.map +1 -1
- package/build/esm/utils/stacktrace.js +3 -1
- package/build/esm/utils/stacktrace.js.map +1 -1
- package/build/esm/utils/string.js +3 -0
- package/build/esm/utils/string.js.map +1 -1
- package/build/esm/utils/version.js +1 -1
- package/build/types/attributes.d.ts +5 -0
- package/build/types/attributes.d.ts.map +1 -1
- package/build/types/client.d.ts +35 -1
- package/build/types/client.d.ts.map +1 -1
- package/build/types/envelope.d.ts.map +1 -1
- package/build/types/index.d.ts +12 -4
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integration.d.ts.map +1 -1
- package/build/types/integrations/express/index.d.ts +75 -0
- package/build/types/integrations/express/index.d.ts.map +1 -0
- package/build/types/integrations/express/patch-layer.d.ts +32 -0
- package/build/types/integrations/express/patch-layer.d.ts.map +1 -0
- package/build/types/integrations/express/request-layer-store.d.ts +32 -0
- package/build/types/integrations/express/request-layer-store.d.ts.map +1 -0
- package/build/types/integrations/express/set-sdk-processing-metadata.d.ts +35 -0
- package/build/types/integrations/express/set-sdk-processing-metadata.d.ts.map +1 -0
- package/build/types/integrations/express/types.d.ts +154 -0
- package/build/types/integrations/express/types.d.ts.map +1 -0
- package/build/types/integrations/express/utils.d.ts +93 -0
- package/build/types/integrations/express/utils.d.ts.map +1 -0
- package/build/types/integrations/mcp-server/correlation.d.ts +2 -1
- package/build/types/integrations/mcp-server/correlation.d.ts.map +1 -1
- package/build/types/integrations/mcp-server/handlers.d.ts +9 -4
- package/build/types/integrations/mcp-server/handlers.d.ts.map +1 -1
- package/build/types/integrations/mcp-server/index.d.ts +2 -1
- package/build/types/integrations/mcp-server/index.d.ts.map +1 -1
- package/build/types/integrations/mcp-server/types.d.ts +40 -7
- package/build/types/integrations/mcp-server/types.d.ts.map +1 -1
- package/build/types/integrations/mcp-server/validation.d.ts +4 -1
- package/build/types/integrations/mcp-server/validation.d.ts.map +1 -1
- package/build/types/integrations/spanStreaming.d.ts +2 -0
- package/build/types/integrations/spanStreaming.d.ts.map +1 -0
- package/build/types/semanticAttributes.d.ts +23 -3
- package/build/types/semanticAttributes.d.ts.map +1 -1
- package/build/types/tracing/ai/gen-ai-attributes.d.ts +6 -38
- package/build/types/tracing/ai/gen-ai-attributes.d.ts.map +1 -1
- package/build/types/tracing/ai/utils.d.ts +21 -2
- package/build/types/tracing/ai/utils.d.ts.map +1 -1
- package/build/types/tracing/anthropic-ai/index.d.ts.map +1 -1
- package/build/types/tracing/anthropic-ai/streaming.d.ts.map +1 -1
- package/build/types/tracing/dynamicSamplingContext.d.ts.map +1 -1
- package/build/types/tracing/google-genai/constants.d.ts +1 -3
- package/build/types/tracing/google-genai/constants.d.ts.map +1 -1
- package/build/types/tracing/google-genai/index.d.ts.map +1 -1
- package/build/types/tracing/google-genai/streaming.d.ts.map +1 -1
- package/build/types/tracing/index.d.ts +1 -0
- package/build/types/tracing/index.d.ts.map +1 -1
- package/build/types/tracing/langchain/embeddings.d.ts +27 -0
- package/build/types/tracing/langchain/embeddings.d.ts.map +1 -0
- package/build/types/tracing/langchain/index.d.ts +1 -0
- package/build/types/tracing/langchain/index.d.ts.map +1 -1
- package/build/types/tracing/openai/index.d.ts.map +1 -1
- package/build/types/tracing/openai/streaming.d.ts.map +1 -1
- package/build/types/tracing/openai/utils.d.ts +4 -49
- package/build/types/tracing/openai/utils.d.ts.map +1 -1
- package/build/types/tracing/sentryNonRecordingSpan.d.ts +12 -1
- package/build/types/tracing/sentryNonRecordingSpan.d.ts.map +1 -1
- package/build/types/tracing/sentrySpan.d.ts +10 -1
- package/build/types/tracing/sentrySpan.d.ts.map +1 -1
- package/build/types/tracing/spans/beforeSendSpan.d.ts +35 -0
- package/build/types/tracing/spans/beforeSendSpan.d.ts.map +1 -0
- package/build/types/tracing/spans/captureSpan.d.ts +26 -0
- package/build/types/tracing/spans/captureSpan.d.ts.map +1 -0
- package/build/types/tracing/spans/envelope.d.ts +8 -0
- package/build/types/tracing/spans/envelope.d.ts.map +1 -0
- package/build/types/tracing/spans/estimateSize.d.ts +12 -0
- package/build/types/tracing/spans/estimateSize.d.ts.map +1 -0
- package/build/types/tracing/spans/hasSpanStreamingEnabled.d.ts +6 -0
- package/build/types/tracing/spans/hasSpanStreamingEnabled.d.ts.map +1 -0
- package/build/types/tracing/spans/spanBuffer.d.ts +60 -0
- package/build/types/tracing/spans/spanBuffer.d.ts.map +1 -0
- package/build/types/tracing/trace.d.ts.map +1 -1
- package/build/types/tracing/vercel-ai/utils.d.ts.map +1 -1
- package/build/types/types-hoist/envelope.d.ts +22 -2
- package/build/types/types-hoist/envelope.d.ts.map +1 -1
- package/build/types/types-hoist/integration.d.ts +8 -0
- package/build/types/types-hoist/integration.d.ts.map +1 -1
- package/build/types/types-hoist/link.d.ts +2 -2
- package/build/types/types-hoist/link.d.ts.map +1 -1
- package/build/types/types-hoist/options.d.ts +26 -2
- package/build/types/types-hoist/options.d.ts.map +1 -1
- package/build/types/types-hoist/span.d.ts +35 -0
- package/build/types/types-hoist/span.d.ts.map +1 -1
- package/build/types/utils/featureFlags.d.ts.map +1 -1
- package/build/types/utils/object.d.ts +10 -0
- package/build/types/utils/object.d.ts.map +1 -1
- package/build/types/utils/spanUtils.d.ts +27 -2
- package/build/types/utils/spanUtils.d.ts.map +1 -1
- package/build/types/utils/stacktrace.d.ts.map +1 -1
- package/build/types/utils/string.d.ts +2 -2
- package/build/types/utils/string.d.ts.map +1 -1
- package/build/types-ts3.8/attributes.d.ts +5 -0
- package/build/types-ts3.8/client.d.ts +35 -1
- package/build/types-ts3.8/index.d.ts +12 -4
- package/build/types-ts3.8/integrations/express/index.d.ts +75 -0
- package/build/types-ts3.8/integrations/express/patch-layer.d.ts +32 -0
- package/build/types-ts3.8/integrations/express/request-layer-store.d.ts +32 -0
- package/build/types-ts3.8/integrations/express/set-sdk-processing-metadata.d.ts +35 -0
- package/build/types-ts3.8/integrations/express/types.d.ts +154 -0
- package/build/types-ts3.8/integrations/express/utils.d.ts +96 -0
- package/build/types-ts3.8/integrations/mcp-server/correlation.d.ts +2 -1
- package/build/types-ts3.8/integrations/mcp-server/handlers.d.ts +9 -4
- package/build/types-ts3.8/integrations/mcp-server/index.d.ts +2 -1
- package/build/types-ts3.8/integrations/mcp-server/types.d.ts +40 -7
- package/build/types-ts3.8/integrations/mcp-server/validation.d.ts +4 -1
- package/build/types-ts3.8/integrations/spanStreaming.d.ts +2 -0
- package/build/types-ts3.8/semanticAttributes.d.ts +23 -3
- package/build/types-ts3.8/tracing/ai/gen-ai-attributes.d.ts +6 -38
- package/build/types-ts3.8/tracing/ai/utils.d.ts +21 -2
- package/build/types-ts3.8/tracing/google-genai/constants.d.ts +1 -3
- package/build/types-ts3.8/tracing/index.d.ts +1 -0
- package/build/types-ts3.8/tracing/langchain/embeddings.d.ts +27 -0
- package/build/types-ts3.8/tracing/langchain/index.d.ts +1 -0
- package/build/types-ts3.8/tracing/openai/utils.d.ts +4 -49
- package/build/types-ts3.8/tracing/sentryNonRecordingSpan.d.ts +12 -1
- package/build/types-ts3.8/tracing/sentrySpan.d.ts +10 -1
- package/build/types-ts3.8/tracing/spans/beforeSendSpan.d.ts +35 -0
- package/build/types-ts3.8/tracing/spans/captureSpan.d.ts +26 -0
- package/build/types-ts3.8/tracing/spans/envelope.d.ts +8 -0
- package/build/types-ts3.8/tracing/spans/estimateSize.d.ts +12 -0
- package/build/types-ts3.8/tracing/spans/hasSpanStreamingEnabled.d.ts +6 -0
- package/build/types-ts3.8/tracing/spans/spanBuffer.d.ts +60 -0
- package/build/types-ts3.8/types-hoist/envelope.d.ts +22 -2
- package/build/types-ts3.8/types-hoist/integration.d.ts +8 -0
- package/build/types-ts3.8/types-hoist/link.d.ts +2 -2
- package/build/types-ts3.8/types-hoist/options.d.ts +26 -2
- package/build/types-ts3.8/types-hoist/span.d.ts +35 -0
- package/build/types-ts3.8/utils/object.d.ts +10 -0
- package/build/types-ts3.8/utils/spanUtils.d.ts +27 -2
- package/build/types-ts3.8/utils/string.d.ts +2 -2
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { Log } from './log';
|
|
|
6
6
|
import { Metric } from './metric';
|
|
7
7
|
import { TracesSamplerSamplingContext } from './samplingcontext';
|
|
8
8
|
import { SdkMetadata } from './sdkmetadata';
|
|
9
|
-
import { SpanJSON } from './span';
|
|
9
|
+
import { SpanJSON, StreamedSpanJSON } from './span';
|
|
10
10
|
import { StackLineParser, StackParser } from './stacktrace';
|
|
11
11
|
import { TracePropagationTargets } from './tracing';
|
|
12
12
|
import { BaseTransportOptions, Transport } from './transport';
|
|
@@ -450,6 +450,13 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
|
|
|
450
450
|
* @default false
|
|
451
451
|
*/
|
|
452
452
|
strictTraceContinuation?: boolean;
|
|
453
|
+
/**
|
|
454
|
+
* The trace lifecycle, determining whether spans are sent statically when the entire local span tree is complete,
|
|
455
|
+
* or streamed in batches, following interval- and action-based triggers.
|
|
456
|
+
*
|
|
457
|
+
* @default 'static'
|
|
458
|
+
*/
|
|
459
|
+
traceLifecycle?: 'static' | 'stream';
|
|
453
460
|
/**
|
|
454
461
|
* The organization ID for your Sentry project.
|
|
455
462
|
*
|
|
@@ -522,11 +529,16 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
|
|
|
522
529
|
/**
|
|
523
530
|
* This function can be defined to modify a child span before it's sent.
|
|
524
531
|
*
|
|
532
|
+
* When using `traceLifecycle: 'stream'`, wrap your callback with {@link withStreamedSpan}
|
|
533
|
+
* to receive and return {@link StreamedSpanJSON} instead.
|
|
534
|
+
*
|
|
525
535
|
* @param span The span generated by the SDK.
|
|
526
536
|
*
|
|
527
537
|
* @returns The modified span payload that will be sent.
|
|
528
538
|
*/
|
|
529
|
-
beforeSendSpan?: (span: SpanJSON) => SpanJSON
|
|
539
|
+
beforeSendSpan?: ((span: SpanJSON) => SpanJSON) & {
|
|
540
|
+
_streamed?: true;
|
|
541
|
+
};
|
|
530
542
|
/**
|
|
531
543
|
* An event-processing callback for transaction events, guaranteed to be invoked after all other event
|
|
532
544
|
* processors. This allows an event to be modified or dropped before it's sent.
|
|
@@ -552,6 +564,18 @@ export interface ClientOptions<TO extends BaseTransportOptions = BaseTransportOp
|
|
|
552
564
|
*/
|
|
553
565
|
beforeBreadcrumb?: (breadcrumb: Breadcrumb, hint?: BreadcrumbHint) => Breadcrumb | null;
|
|
554
566
|
}
|
|
567
|
+
/**
|
|
568
|
+
* A callback for processing streamed spans before they are sent.
|
|
569
|
+
*
|
|
570
|
+
* @see {@link StreamedSpanJSON} for the streamed span format used with `traceLifecycle: 'stream'`
|
|
571
|
+
*/
|
|
572
|
+
export type BeforeSendStreamedSpanCallback = ((span: StreamedSpanJSON) => StreamedSpanJSON) & {
|
|
573
|
+
/**
|
|
574
|
+
* When true, indicates this callback is designed to handle the {@link StreamedSpanJSON} format
|
|
575
|
+
* used with `traceLifecycle: 'stream'`. Set this by wrapping your callback with `withStreamedSpan`.
|
|
576
|
+
*/
|
|
577
|
+
_streamed?: true;
|
|
578
|
+
};
|
|
555
579
|
/** Base configuration options for every SDK. */
|
|
556
580
|
export interface CoreOptions<TO extends BaseTransportOptions = BaseTransportOptions> extends Pick<Partial<ClientOptions<TO>>, Exclude<keyof Partial<ClientOptions<TO>>, 'integrations' | 'transport' | 'stackParser'>> {
|
|
557
581
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Attributes, RawAttributes } from '../attributes';
|
|
1
2
|
import { SpanLink, SpanLinkJSON } from './link';
|
|
2
3
|
import { Measurements } from './measurement';
|
|
3
4
|
import { HrTime } from './opentelemetry';
|
|
@@ -17,6 +18,40 @@ export type SpanAttributes = Partial<{
|
|
|
17
18
|
}> & Record<string, SpanAttributeValue | undefined>;
|
|
18
19
|
/** This type is aligned with the OpenTelemetry TimeInput type. */
|
|
19
20
|
export type SpanTimeInput = HrTime | number | Date;
|
|
21
|
+
/**
|
|
22
|
+
* Intermediate JSON reporesentation of a v2 span, which users and our SDK integrations will interact with.
|
|
23
|
+
* This is NOT the final serialized JSON span, but an intermediate step still holding raw attributes.
|
|
24
|
+
* The final, serialized span is a {@link SerializedStreamedSpan}.
|
|
25
|
+
* Main reason: Make it easier and safer for users to work with attributes.
|
|
26
|
+
*/
|
|
27
|
+
export interface StreamedSpanJSON {
|
|
28
|
+
trace_id: string;
|
|
29
|
+
parent_span_id?: string;
|
|
30
|
+
span_id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
start_timestamp: number;
|
|
33
|
+
end_timestamp: number;
|
|
34
|
+
status: 'ok' | 'error';
|
|
35
|
+
is_segment: boolean;
|
|
36
|
+
attributes?: RawAttributes<Record<string, unknown>>;
|
|
37
|
+
links?: SpanLinkJSON<RawAttributes<Record<string, unknown>>>[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Serialized span item.
|
|
41
|
+
* This is the final, serialized span format that is sent to Sentry.
|
|
42
|
+
* The intermediate representation is {@link StreamedSpanJSON}.
|
|
43
|
+
* Main difference: Attributes are converted to {@link Attributes}, thus including the `type` annotation.
|
|
44
|
+
*/
|
|
45
|
+
export type SerializedStreamedSpan = Pick<StreamedSpanJSON, Exclude<keyof StreamedSpanJSON, 'attributes' | 'links'>> & {
|
|
46
|
+
attributes?: Attributes;
|
|
47
|
+
links?: SpanLinkJSON<Attributes>[];
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Envelope span item container.
|
|
51
|
+
*/
|
|
52
|
+
export type SerializedStreamedSpanContainer = {
|
|
53
|
+
items: Array<SerializedStreamedSpan>;
|
|
54
|
+
};
|
|
20
55
|
/** A JSON representation of a span. */
|
|
21
56
|
export interface SpanJSON {
|
|
22
57
|
data: SpanAttributes;
|
|
@@ -31,6 +31,16 @@ export declare function addNonEnumerableProperty(obj: object, name: string, valu
|
|
|
31
31
|
* @param original the original function that gets wrapped
|
|
32
32
|
*/
|
|
33
33
|
export declare function markFunctionWrapped(wrapped: WrappedFunction, original: WrappedFunction): void;
|
|
34
|
+
/**
|
|
35
|
+
* Wrap a method on an object by name, only if it is not already wrapped.
|
|
36
|
+
*
|
|
37
|
+
* Note: to set the wrapped method as a non-enumerable property, pass
|
|
38
|
+
* false as the `enumerable` argument. This could be detected, but only
|
|
39
|
+
* by either walking up the prototype chain, or iterating over all fields
|
|
40
|
+
* in a `for(in)` loop. Neither are an acceptable performance impact for
|
|
41
|
+
* the rare case where we might patch a non-enumerable method.
|
|
42
|
+
*/
|
|
43
|
+
export declare function wrapMethod<O extends {}, T extends string & keyof O>(obj: O, field: T, wrapped: WrappedFunction, enumerable?: boolean): void;
|
|
34
44
|
/**
|
|
35
45
|
* This extracts the original function if available. See
|
|
36
46
|
* `markFunctionWrapped` for more information.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { RawAttributes } from '../attributes';
|
|
1
2
|
import { TraceContext } from '../types-hoist/context';
|
|
2
3
|
import { SpanLink, SpanLinkJSON } from '../types-hoist/link';
|
|
3
|
-
import { Span, SpanAttributes, SpanJSON, SpanTimeInput } from '../types-hoist/span';
|
|
4
|
+
import { SerializedStreamedSpan, Span, SpanAttributes, SpanJSON, SpanTimeInput, StreamedSpanJSON } from '../types-hoist/span';
|
|
4
5
|
import { SpanStatus } from '../types-hoist/spanStatus';
|
|
5
6
|
export declare const TRACE_FLAG_NONE = 0;
|
|
6
7
|
export declare const TRACE_FLAG_SAMPLED = 1;
|
|
@@ -28,6 +29,12 @@ export declare function spanToTraceparentHeader(span: Span): string;
|
|
|
28
29
|
* If the links array is empty, it returns `undefined` so the empty value can be dropped before it's sent.
|
|
29
30
|
*/
|
|
30
31
|
export declare function convertSpanLinksForEnvelope(links?: SpanLink[]): SpanLinkJSON[] | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Converts the span links array to a flattened version with serialized attributes for V2 spans.
|
|
34
|
+
*
|
|
35
|
+
* If the links array is empty, it returns `undefined` so the empty value can be dropped before it's sent.
|
|
36
|
+
*/
|
|
37
|
+
export declare function getStreamedSpanLinks(links?: SpanLink[]): SpanLinkJSON<RawAttributes<Record<string, unknown>>>[] | undefined;
|
|
31
38
|
/**
|
|
32
39
|
* Convert a span time input into a timestamp in seconds.
|
|
33
40
|
*/
|
|
@@ -36,6 +43,16 @@ export declare function spanTimeInputToSeconds(input: SpanTimeInput | undefined)
|
|
|
36
43
|
* Convert a span to a JSON representation.
|
|
37
44
|
*/
|
|
38
45
|
export declare function spanToJSON(span: Span): SpanJSON;
|
|
46
|
+
/**
|
|
47
|
+
* Convert a span to the intermediate {@link StreamedSpanJSON} representation.
|
|
48
|
+
*/
|
|
49
|
+
export declare function spanToStreamedSpanJSON(span: Span): StreamedSpanJSON;
|
|
50
|
+
/**
|
|
51
|
+
* Converts a {@link StreamedSpanJSON} to a {@link SerializedSpan}.
|
|
52
|
+
* This is the final serialized span format that is sent to Sentry.
|
|
53
|
+
* The returned serilaized spans must not be consumed by users or SDK integrations.
|
|
54
|
+
*/
|
|
55
|
+
export declare function streamedSpanJsonToSerializedSpan(spanJson: StreamedSpanJSON): SerializedStreamedSpan;
|
|
39
56
|
/** Exported only for tests. */
|
|
40
57
|
export interface OpenTelemetrySdkTraceBaseSpan extends Span {
|
|
41
58
|
attributes: SpanAttributes;
|
|
@@ -55,6 +72,10 @@ export interface OpenTelemetrySdkTraceBaseSpan extends Span {
|
|
|
55
72
|
export declare function spanIsSampled(span: Span): boolean;
|
|
56
73
|
/** Get the status message to use for a JSON representation of a span. */
|
|
57
74
|
export declare function getStatusMessage(status: SpanStatus | undefined): string | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* Convert the various statuses to the simple onces expected by Sentry for steamed spans ('ok' is default).
|
|
77
|
+
*/
|
|
78
|
+
export declare function getSimpleStatusMessage(status: SpanStatus | undefined): 'ok' | 'error';
|
|
58
79
|
declare const CHILD_SPANS_FIELD = "_sentryChildSpans";
|
|
59
80
|
declare const ROOT_SPAN_FIELD = "_sentryRootSpan";
|
|
60
81
|
type SpanWithPotentialChildren = Span & {
|
|
@@ -74,7 +95,11 @@ export declare function getSpanDescendants(span: SpanWithPotentialChildren): Spa
|
|
|
74
95
|
/**
|
|
75
96
|
* Returns the root span of a given span.
|
|
76
97
|
*/
|
|
77
|
-
export declare
|
|
98
|
+
export declare const getRootSpan: typeof INTERNAL_getSegmentSpan;
|
|
99
|
+
/**
|
|
100
|
+
* Returns the segment span of a given span.
|
|
101
|
+
*/
|
|
102
|
+
export declare function INTERNAL_getSegmentSpan(span: SpanWithPotentialChildren): Span;
|
|
78
103
|
/**
|
|
79
104
|
* Returns the currently active span.
|
|
80
105
|
*/
|
|
@@ -31,7 +31,7 @@ export declare function safeJoin(input: unknown[], delimiter?: string): string;
|
|
|
31
31
|
* @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match
|
|
32
32
|
* `pattern` if it contains `pattern`. Only applies to string-type patterns.
|
|
33
33
|
*/
|
|
34
|
-
export declare function isMatchingPattern(value: string, pattern: RegExp | string, requireExactStringMatch?: boolean): boolean;
|
|
34
|
+
export declare function isMatchingPattern(value: string, pattern: RegExp | string | ((value: string) => boolean), requireExactStringMatch?: boolean): boolean;
|
|
35
35
|
/**
|
|
36
36
|
* Test the given string against an array of strings and regexes. By default, string matching is done on a
|
|
37
37
|
* substring-inclusion basis rather than a strict equality basis
|
|
@@ -42,5 +42,5 @@ export declare function isMatchingPattern(value: string, pattern: RegExp | strin
|
|
|
42
42
|
* count. If false, `testString` will match a string pattern if it contains that pattern.
|
|
43
43
|
* @returns
|
|
44
44
|
*/
|
|
45
|
-
export declare function stringMatchesSomePattern(testString: string, patterns?: Array<string | RegExp>, requireExactStringMatch?: boolean): boolean;
|
|
45
|
+
export declare function stringMatchesSomePattern(testString: string, patterns?: Array<string | RegExp | ((value: string) => boolean)>, requireExactStringMatch?: boolean): boolean;
|
|
46
46
|
//# sourceMappingURL=string.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/core",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.48.0",
|
|
4
4
|
"description": "Base implementation for all Sentry JavaScript SDKs",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/core",
|