@sentry/core 10.46.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/api.js +1 -0
- package/build/cjs/api.js.map +1 -1
- 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/currentScopes.js +33 -0
- package/build/cjs/currentScopes.js.map +1 -1
- package/build/cjs/envelope.js +4 -3
- package/build/cjs/envelope.js.map +1 -1
- package/build/cjs/index.js +50 -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/integrations/supabase.js +1 -1
- package/build/cjs/integrations/supabase.js.map +1 -1
- 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 -79
- package/build/cjs/tracing/ai/gen-ai-attributes.js.map +1 -1
- package/build/cjs/tracing/ai/utils.js +50 -35
- package/build/cjs/tracing/ai/utils.js.map +1 -1
- package/build/cjs/tracing/anthropic-ai/constants.js +10 -10
- package/build/cjs/tracing/anthropic-ai/constants.js.map +1 -1
- package/build/cjs/tracing/anthropic-ai/index.js +18 -20
- 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/anthropic-ai/utils.js +0 -9
- package/build/cjs/tracing/anthropic-ai/utils.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 +9 -12
- package/build/cjs/tracing/google-genai/constants.js.map +1 -1
- package/build/cjs/tracing/google-genai/index.js +49 -27
- 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/google-genai/utils.js +0 -25
- package/build/cjs/tracing/google-genai/utils.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/constants.js +7 -7
- package/build/cjs/tracing/openai/constants.js.map +1 -1
- package/build/cjs/tracing/openai/index.js +19 -37
- 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 -243
- 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 +88 -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/traceData.js +11 -0
- package/build/cjs/utils/traceData.js.map +1 -1
- package/build/cjs/utils/version.js +1 -1
- package/build/esm/api.js +1 -1
- package/build/esm/api.js.map +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/currentScopes.js +31 -1
- package/build/esm/currentScopes.js.map +1 -1
- package/build/esm/envelope.js +2 -1
- package/build/esm/envelope.js.map +1 -1
- package/build/esm/index.js +13 -4
- 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/integrations/supabase.js +1 -1
- package/build/esm/integrations/supabase.js.map +1 -1
- 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 -69
- package/build/esm/tracing/ai/gen-ai-attributes.js.map +1 -1
- package/build/esm/tracing/ai/utils.js +51 -35
- package/build/esm/tracing/ai/utils.js.map +1 -1
- package/build/esm/tracing/anthropic-ai/constants.js +10 -10
- package/build/esm/tracing/anthropic-ai/constants.js.map +1 -1
- package/build/esm/tracing/anthropic-ai/index.js +21 -23
- 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/anthropic-ai/utils.js +1 -9
- package/build/esm/tracing/anthropic-ai/utils.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 +9 -10
- package/build/esm/tracing/google-genai/constants.js.map +1 -1
- package/build/esm/tracing/google-genai/index.js +53 -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/google-genai/utils.js +1 -24
- package/build/esm/tracing/google-genai/utils.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/constants.js +7 -7
- package/build/esm/tracing/openai/constants.js.map +1 -1
- package/build/esm/tracing/openai/index.js +21 -39
- 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 -232
- 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 +89 -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/traceData.js +12 -1
- package/build/esm/utils/traceData.js.map +1 -1
- package/build/esm/utils/version.js +1 -1
- package/build/types/api.d.ts +1 -0
- package/build/types/api.d.ts.map +1 -1
- package/build/types/asyncContext/types.d.ts +3 -1
- package/build/types/asyncContext/types.d.ts.map +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/currentScopes.d.ts +20 -0
- package/build/types/currentScopes.d.ts.map +1 -1
- package/build/types/envelope.d.ts.map +1 -1
- package/build/types/index.d.ts +15 -6
- 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 -46
- package/build/types/tracing/ai/gen-ai-attributes.d.ts.map +1 -1
- package/build/types/tracing/ai/utils.d.ts +34 -9
- package/build/types/tracing/ai/utils.d.ts.map +1 -1
- package/build/types/tracing/anthropic-ai/constants.d.ts +24 -1
- package/build/types/tracing/anthropic-ai/constants.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/anthropic-ai/types.d.ts +5 -2
- package/build/types/tracing/anthropic-ai/types.d.ts.map +1 -1
- package/build/types/tracing/anthropic-ai/utils.d.ts +1 -5
- package/build/types/tracing/anthropic-ai/utils.d.ts.map +1 -1
- package/build/types/tracing/dynamicSamplingContext.d.ts.map +1 -1
- package/build/types/tracing/google-genai/constants.d.ts +22 -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/google-genai/types.d.ts +6 -2
- package/build/types/tracing/google-genai/types.d.ts.map +1 -1
- package/build/types/tracing/google-genai/utils.d.ts +0 -9
- package/build/types/tracing/google-genai/utils.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/constants.d.ts +14 -1
- package/build/types/tracing/openai/constants.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/types.d.ts +5 -2
- package/build/types/tracing/openai/types.d.ts.map +1 -1
- package/build/types/tracing/openai/utils.d.ts +4 -63
- 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/utils/traceData.d.ts +4 -0
- package/build/types/utils/traceData.d.ts.map +1 -1
- package/build/types-ts3.8/api.d.ts +1 -0
- package/build/types-ts3.8/asyncContext/types.d.ts +3 -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/currentScopes.d.ts +20 -0
- package/build/types-ts3.8/index.d.ts +15 -6
- 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 -46
- package/build/types-ts3.8/tracing/ai/utils.d.ts +34 -9
- package/build/types-ts3.8/tracing/anthropic-ai/constants.d.ts +24 -9
- package/build/types-ts3.8/tracing/anthropic-ai/types.d.ts +5 -2
- package/build/types-ts3.8/tracing/anthropic-ai/utils.d.ts +1 -5
- package/build/types-ts3.8/tracing/google-genai/constants.d.ts +22 -9
- package/build/types-ts3.8/tracing/google-genai/types.d.ts +6 -2
- package/build/types-ts3.8/tracing/google-genai/utils.d.ts +0 -9
- 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/constants.d.ts +14 -6
- package/build/types-ts3.8/tracing/openai/types.d.ts +5 -2
- package/build/types-ts3.8/tracing/openai/utils.d.ts +4 -63
- 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/build/types-ts3.8/utils/traceData.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SpanLink } from '../types-hoist/link';
|
|
2
|
-
import { SentrySpanArguments, Span, SpanAttributes, SpanAttributeValue, SpanContextData, SpanJSON, SpanTimeInput } from '../types-hoist/span';
|
|
2
|
+
import { SentrySpanArguments, Span, SpanAttributes, SpanAttributeValue, SpanContextData, SpanJSON, SpanTimeInput, StreamedSpanJSON } from '../types-hoist/span';
|
|
3
3
|
import { SpanStatus } from '../types-hoist/spanStatus';
|
|
4
4
|
import { TimedEvent } from '../types-hoist/timedEvent';
|
|
5
5
|
/**
|
|
@@ -77,6 +77,15 @@ export declare class SentrySpan implements Span {
|
|
|
77
77
|
* use `spanToJSON(span)` instead.
|
|
78
78
|
*/
|
|
79
79
|
getSpanJSON(): SpanJSON;
|
|
80
|
+
/**
|
|
81
|
+
* Get {@link StreamedSpanJSON} representation of this span.
|
|
82
|
+
*
|
|
83
|
+
* @hidden
|
|
84
|
+
* @internal This method is purely for internal purposes and should not be used outside
|
|
85
|
+
* of SDK code. If you need to get a JSON representation of a span,
|
|
86
|
+
* use `spanToStreamedSpanJSON(span)` instead.
|
|
87
|
+
*/
|
|
88
|
+
getStreamedSpanJSON(): StreamedSpanJSON;
|
|
80
89
|
/** @inheritdoc */
|
|
81
90
|
isRecording(): boolean;
|
|
82
91
|
/**
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { CoreOptions } from '../../types-hoist/options';
|
|
2
|
+
import { BeforeSendStreamedSpanCallback } from '../../types-hoist/options';
|
|
3
|
+
import { StreamedSpanJSON } from '../../types-hoist/span';
|
|
4
|
+
type StaticBeforeSendSpanCallback = CoreOptions['beforeSendSpan'];
|
|
5
|
+
/**
|
|
6
|
+
* A wrapper to use the new span format in your `beforeSendSpan` callback.
|
|
7
|
+
*
|
|
8
|
+
* When using `traceLifecycle: 'stream'`, wrap your callback with this function
|
|
9
|
+
* to receive and return {@link StreamedSpanJSON} instead of the standard {@link SpanJSON}.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
*
|
|
13
|
+
* Sentry.init({
|
|
14
|
+
* traceLifecycle: 'stream',
|
|
15
|
+
* beforeSendSpan: withStreamedSpan((span) => {
|
|
16
|
+
* // span is of type StreamedSpanJSON
|
|
17
|
+
* return span;
|
|
18
|
+
* }),
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* @param callback - The callback function that receives and returns a {@link StreamedSpanJSON}.
|
|
22
|
+
* @returns A callback that is compatible with the `beforeSendSpan` option when using `traceLifecycle: 'stream'`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function withStreamedSpan(callback: (span: StreamedSpanJSON) => StreamedSpanJSON): StaticBeforeSendSpanCallback & {
|
|
25
|
+
_streamed: true;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Typesafe check to identify if a `beforeSendSpan` callback expects the streamed span JSON format.
|
|
29
|
+
*
|
|
30
|
+
* @param callback - The `beforeSendSpan` callback to check.
|
|
31
|
+
* @returns `true` if the callback was wrapped with {@link withStreamedSpan}.
|
|
32
|
+
*/
|
|
33
|
+
export declare function isStreamedBeforeSendSpanCallback(callback: unknown): callback is BeforeSendStreamedSpanCallback;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=beforeSendSpan.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { RawAttributes } from '../../attributes';
|
|
2
|
+
import { Client } from '../../client';
|
|
3
|
+
import { SerializedStreamedSpan, Span, StreamedSpanJSON } from '../../types-hoist/span';
|
|
4
|
+
export type SerializedStreamedSpanWithSegmentSpan = SerializedStreamedSpan & {
|
|
5
|
+
_segmentSpan: Span;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Captures a span and returns a JSON representation to be enqueued for sending.
|
|
9
|
+
*
|
|
10
|
+
* IMPORTANT: This function converts the span to JSON immediately to avoid writing
|
|
11
|
+
* to an already-ended OTel span instance (which is blocked by the OTel Span class).
|
|
12
|
+
*
|
|
13
|
+
* @returns the final serialized span with a reference to its segment span. This reference
|
|
14
|
+
* is needed later on to compute the DSC for the span envelope.
|
|
15
|
+
*/
|
|
16
|
+
export declare function captureSpan(span: Span, client: Client): SerializedStreamedSpanWithSegmentSpan;
|
|
17
|
+
/**
|
|
18
|
+
* Apply a user-provided beforeSendSpan callback to a span JSON.
|
|
19
|
+
*/
|
|
20
|
+
export declare function applyBeforeSendSpanCallback(span: StreamedSpanJSON, beforeSendSpan: (span: StreamedSpanJSON) => StreamedSpanJSON): StreamedSpanJSON;
|
|
21
|
+
/**
|
|
22
|
+
* Safely set attributes on a span JSON.
|
|
23
|
+
* If an attribute already exists, it will not be overwritten.
|
|
24
|
+
*/
|
|
25
|
+
export declare function safeSetSpanJSONAttributes(spanJSON: StreamedSpanJSON, newAttributes: RawAttributes<Record<string, unknown>>): void;
|
|
26
|
+
//# sourceMappingURL=captureSpan.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Client } from '../../client';
|
|
2
|
+
import { DynamicSamplingContext, StreamedSpanEnvelope } from '../../types-hoist/envelope';
|
|
3
|
+
import { SerializedStreamedSpan } from '../../types-hoist/span';
|
|
4
|
+
/**
|
|
5
|
+
* Creates a span v2 span streaming envelope
|
|
6
|
+
*/
|
|
7
|
+
export declare function createStreamedSpanEnvelope(serializedSpans: Array<SerializedStreamedSpan>, dsc: Partial<DynamicSamplingContext>, client: Client): StreamedSpanEnvelope;
|
|
8
|
+
//# sourceMappingURL=envelope.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SerializedStreamedSpan } from '../../types-hoist/span';
|
|
2
|
+
/**
|
|
3
|
+
* Estimates the serialized byte size of a {@link SerializedStreamedSpan}.
|
|
4
|
+
*
|
|
5
|
+
* Uses 2 bytes per character as a UTF-16 approximation, and 8 bytes per number.
|
|
6
|
+
* The estimate is intentionally conservative and may be slightly lower than the
|
|
7
|
+
* actual byte size on the wire.
|
|
8
|
+
* We compensate for this by setting the span buffers internal limit well below the limit
|
|
9
|
+
* of how large an actual span v2 envelope may be.
|
|
10
|
+
*/
|
|
11
|
+
export declare function estimateSerializedSpanSizeInBytes(span: SerializedStreamedSpan): number;
|
|
12
|
+
//# sourceMappingURL=estimateSize.d.ts.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Client } from '../../client';
|
|
2
|
+
import { SerializedStreamedSpanWithSegmentSpan } from './captureSpan';
|
|
3
|
+
export interface SpanBufferOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Max spans per trace before auto-flush
|
|
6
|
+
* Must not exceed 1000.
|
|
7
|
+
*
|
|
8
|
+
* @default 1_000
|
|
9
|
+
*/
|
|
10
|
+
maxSpanLimit?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Per-trace flush timeout in ms. A timeout is started when a trace bucket is first created
|
|
13
|
+
* and fires flush() for that specific trace when it expires.
|
|
14
|
+
* Must be greater than 0.
|
|
15
|
+
*
|
|
16
|
+
* @default 5_000
|
|
17
|
+
*/
|
|
18
|
+
flushInterval?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Max accumulated byte weight of spans per trace before auto-flush.
|
|
21
|
+
* Size is estimated, not exact. Uses 2 bytes per character for strings (UTF-16).
|
|
22
|
+
*
|
|
23
|
+
* @default 5_000_000 (5 MB)
|
|
24
|
+
*/
|
|
25
|
+
maxTraceWeightInBytes?: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A buffer for serialized streamed span JSON objects that flushes them to Sentry in Span v2 envelopes.
|
|
29
|
+
* Handles per-trace timeout-based flushing, size thresholds, and graceful shutdown.
|
|
30
|
+
* Also handles computation of the Dynamic Sampling Context (DSC) for the trace, if it wasn't yet
|
|
31
|
+
* frozen onto the segment span.
|
|
32
|
+
*
|
|
33
|
+
* For this, we need the reference to the segment span instance, from
|
|
34
|
+
* which we compute the DSC. Doing this in the buffer ensures that we compute the DSC as late as possible,
|
|
35
|
+
* allowing span name and data updates up to this point. Worth noting here that the segment span is likely
|
|
36
|
+
* still active and modifyable when child spans are added to the buffer.
|
|
37
|
+
*/
|
|
38
|
+
export declare class SpanBuffer {
|
|
39
|
+
private _traceBuckets;
|
|
40
|
+
private _client;
|
|
41
|
+
private _maxSpanLimit;
|
|
42
|
+
private _flushInterval;
|
|
43
|
+
private _maxTraceWeight;
|
|
44
|
+
constructor(client: Client, options?: SpanBufferOptions);
|
|
45
|
+
/**
|
|
46
|
+
* Add a span to the buffer.
|
|
47
|
+
*/
|
|
48
|
+
add(spanJSON: SerializedStreamedSpanWithSegmentSpan): void;
|
|
49
|
+
/**
|
|
50
|
+
* Drain and flush all buffered traces.
|
|
51
|
+
*/
|
|
52
|
+
drain(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Flush spans of a specific trace.
|
|
55
|
+
* In contrast to {@link SpanBuffer.drain}, this method does not flush all traces, but only the one with the given traceId.
|
|
56
|
+
*/
|
|
57
|
+
flush(traceId: string): void;
|
|
58
|
+
private _removeTrace;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=spanBuffer.d.ts.map
|
|
@@ -11,7 +11,7 @@ import { Profile, ProfileChunk } from './profiling';
|
|
|
11
11
|
import { ReplayEvent, ReplayRecordingData } from './replay';
|
|
12
12
|
import { SdkInfo } from './sdkinfo';
|
|
13
13
|
import { SerializedSession, SessionAggregates } from './session';
|
|
14
|
-
import { SpanJSON } from './span';
|
|
14
|
+
import { SerializedStreamedSpanContainer, SpanJSON } from './span';
|
|
15
15
|
export type DynamicSamplingContext = {
|
|
16
16
|
trace_id: string;
|
|
17
17
|
public_key: DsnComponents['publicKey'];
|
|
@@ -87,6 +87,21 @@ type ProfileChunkItemHeaders = {
|
|
|
87
87
|
type SpanItemHeaders = {
|
|
88
88
|
type: 'span';
|
|
89
89
|
};
|
|
90
|
+
type SpanContainerItemHeaders = {
|
|
91
|
+
/**
|
|
92
|
+
* Same as v1 span item type but this envelope is distinguished by {@link SpanContainerItemHeaders.content_type}.
|
|
93
|
+
*/
|
|
94
|
+
type: 'span';
|
|
95
|
+
/**
|
|
96
|
+
* The number of span items in the container. This must be the same as the number of span items in the payload.
|
|
97
|
+
*/
|
|
98
|
+
item_count: number;
|
|
99
|
+
/**
|
|
100
|
+
* The content type of the span items. This must be `application/vnd.sentry.items.span.v2+json`.
|
|
101
|
+
* (the presence of this field also distinguishes the span item from the v1 span item)
|
|
102
|
+
*/
|
|
103
|
+
content_type: 'application/vnd.sentry.items.span.v2+json';
|
|
104
|
+
};
|
|
90
105
|
type LogContainerItemHeaders = {
|
|
91
106
|
type: 'log';
|
|
92
107
|
/**
|
|
@@ -120,6 +135,7 @@ export type FeedbackItem = BaseEnvelopeItem<FeedbackItemHeaders, FeedbackEvent>;
|
|
|
120
135
|
export type ProfileItem = BaseEnvelopeItem<ProfileItemHeaders, Profile>;
|
|
121
136
|
export type ProfileChunkItem = BaseEnvelopeItem<ProfileChunkItemHeaders, ProfileChunk>;
|
|
122
137
|
export type SpanItem = BaseEnvelopeItem<SpanItemHeaders, Partial<SpanJSON>>;
|
|
138
|
+
export type SpanContainerItem = BaseEnvelopeItem<SpanContainerItemHeaders, SerializedStreamedSpanContainer>;
|
|
123
139
|
export type LogContainerItem = BaseEnvelopeItem<LogContainerItemHeaders, SerializedLogContainer>;
|
|
124
140
|
export type MetricContainerItem = BaseEnvelopeItem<MetricContainerItemHeaders, SerializedMetricContainer>;
|
|
125
141
|
export type RawSecurityItem = BaseEnvelopeItem<RawSecurityHeaders, LegacyCSPReport>;
|
|
@@ -139,6 +155,9 @@ type ReplayEnvelopeHeaders = BaseEnvelopeHeaders;
|
|
|
139
155
|
type SpanEnvelopeHeaders = BaseEnvelopeHeaders & {
|
|
140
156
|
trace?: DynamicSamplingContext;
|
|
141
157
|
};
|
|
158
|
+
type StreamedSpanEnvelopeHeaders = BaseEnvelopeHeaders & {
|
|
159
|
+
trace?: DynamicSamplingContext;
|
|
160
|
+
};
|
|
142
161
|
type LogEnvelopeHeaders = BaseEnvelopeHeaders;
|
|
143
162
|
type MetricEnvelopeHeaders = BaseEnvelopeHeaders;
|
|
144
163
|
export type EventEnvelope = BaseEnvelope<EventEnvelopeHeaders, EventItem | AttachmentItem | UserFeedbackItem | FeedbackItem | ProfileItem>;
|
|
@@ -153,11 +172,12 @@ export type ReplayEnvelope = [
|
|
|
153
172
|
];
|
|
154
173
|
export type CheckInEnvelope = BaseEnvelope<CheckInEnvelopeHeaders, CheckInItem>;
|
|
155
174
|
export type SpanEnvelope = BaseEnvelope<SpanEnvelopeHeaders, SpanItem>;
|
|
175
|
+
export type StreamedSpanEnvelope = BaseEnvelope<StreamedSpanEnvelopeHeaders, SpanContainerItem>;
|
|
156
176
|
export type ProfileChunkEnvelope = BaseEnvelope<BaseEnvelopeHeaders, ProfileChunkItem>;
|
|
157
177
|
export type RawSecurityEnvelope = BaseEnvelope<BaseEnvelopeHeaders, RawSecurityItem>;
|
|
158
178
|
export type LogEnvelope = BaseEnvelope<LogEnvelopeHeaders, LogContainerItem>;
|
|
159
179
|
export type MetricEnvelope = BaseEnvelope<MetricEnvelopeHeaders, MetricContainerItem>;
|
|
160
|
-
export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ProfileChunkEnvelope | ReplayEnvelope | CheckInEnvelope | SpanEnvelope | RawSecurityEnvelope | LogEnvelope | MetricEnvelope;
|
|
180
|
+
export type Envelope = EventEnvelope | SessionEnvelope | ClientReportEnvelope | ProfileChunkEnvelope | ReplayEnvelope | CheckInEnvelope | SpanEnvelope | StreamedSpanEnvelope | RawSecurityEnvelope | LogEnvelope | MetricEnvelope;
|
|
161
181
|
export type EnvelopeItem = Envelope[1][number];
|
|
162
182
|
export {};
|
|
163
183
|
//# sourceMappingURL=envelope.d.ts.map
|
|
@@ -11,6 +11,14 @@ export interface Integration {
|
|
|
11
11
|
* It does not receives any arguments, and should only use for e.g. global monkey patching and similar things.
|
|
12
12
|
*/
|
|
13
13
|
setupOnce?(): void;
|
|
14
|
+
/**
|
|
15
|
+
* Called before the `setup` hook of any integration is called.
|
|
16
|
+
* This is useful if an integration needs to e.g. modify client options prior to other integrations
|
|
17
|
+
* reading client options.
|
|
18
|
+
*
|
|
19
|
+
* @param client
|
|
20
|
+
*/
|
|
21
|
+
beforeSetup?(client: Client): void;
|
|
14
22
|
/**
|
|
15
23
|
* Set up an integration for the given client.
|
|
16
24
|
* Receives the client as argument.
|
|
@@ -19,11 +19,11 @@ export interface SpanLink {
|
|
|
19
19
|
* Link interface for the event envelope item. It's a flattened representation of `SpanLink`.
|
|
20
20
|
* Can include additional fields defined by OTel.
|
|
21
21
|
*/
|
|
22
|
-
export interface SpanLinkJSON extends Record<string, unknown> {
|
|
22
|
+
export interface SpanLinkJSON<TAttributes = SpanLinkAttributes> extends Record<string, unknown> {
|
|
23
23
|
span_id: string;
|
|
24
24
|
trace_id: string;
|
|
25
25
|
sampled?: boolean;
|
|
26
|
-
attributes?:
|
|
26
|
+
attributes?: TAttributes;
|
|
27
27
|
}
|
|
28
28
|
export {};
|
|
29
29
|
//# sourceMappingURL=link.d.ts.map
|
|
@@ -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
|
|
@@ -10,6 +10,10 @@ import { SerializedTraceData } from '../types-hoist/tracing';
|
|
|
10
10
|
* This function also applies some validation to the generated sentry-trace and baggage values to ensure that
|
|
11
11
|
* only valid strings are returned.
|
|
12
12
|
*
|
|
13
|
+
* When an external propagation context is registered (e.g. via the OTLP integration) and there is no active
|
|
14
|
+
* Sentry span, this function returns an empty object to defer outgoing request propagation to the external
|
|
15
|
+
* propagator (e.g. an OpenTelemetry propagator).
|
|
16
|
+
*
|
|
13
17
|
* If (@param options.propagateTraceparent) is `true`, the function will also generate a `traceparent` value,
|
|
14
18
|
* following the W3C traceparent header format.
|
|
15
19
|
*
|
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",
|