@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stacktrace.d.ts","sourceRoot":"","sources":["../../../src/utils/stacktrace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG9D,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAKpC;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,OAAO,EAAE,eAAe,EAAE,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"stacktrace.d.ts","sourceRoot":"","sources":["../../../src/utils/stacktrace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG9D,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAKpC;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,OAAO,EAAE,eAAe,EAAE,GAAG,WAAW,CA6C5E;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,WAAW,GAAG,eAAe,EAAE,GAAG,WAAW,CAK3G;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,UAAU,EAAE,CAqC1F;AAQD;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,CAWnD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU,EAAE,GAAG,SAAS,CAoBzE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,KAAK,GAAG,MAAM,CAKtE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAOpF"}
|
|
@@ -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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src/utils/string.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,MAAU,GAAG,MAAM,CAK7D;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAiC5D;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CA0BrE;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src/utils/string.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,GAAE,MAAU,GAAG,MAAM,CAK7D;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAiC5D;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CA0BrE;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,EACvD,uBAAuB,GAAE,OAAe,GACvC,OAAO,CAgBT;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,MAAM,EAClB,QAAQ,GAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAM,EACpE,uBAAuB,GAAE,OAAe,GACvC,OAAO,CAET"}
|
|
@@ -66,5 +66,10 @@ export declare function attributeValueToTypedAttributeValue(rawValue: unknown, u
|
|
|
66
66
|
* @returns The serialized attributes.
|
|
67
67
|
*/
|
|
68
68
|
export declare function serializeAttributes<T>(attributes: RawAttributes<T> | undefined, fallback?: boolean | 'skip-undefined'): Attributes;
|
|
69
|
+
/**
|
|
70
|
+
* Estimates the serialized byte size of {@link Attributes},
|
|
71
|
+
* with a couple of heuristics for performance.
|
|
72
|
+
*/
|
|
73
|
+
export declare function estimateTypedAttributesSizeInBytes(attributes: Attributes | undefined): number;
|
|
69
74
|
export {};
|
|
70
75
|
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -18,7 +18,7 @@ import { RequestEventData } from './types-hoist/request';
|
|
|
18
18
|
import { SdkMetadata } from './types-hoist/sdkmetadata';
|
|
19
19
|
import { Session, SessionAggregates } from './types-hoist/session';
|
|
20
20
|
import { SeverityLevel } from './types-hoist/severity';
|
|
21
|
-
import { Span, SpanAttributes, SpanContextData } from './types-hoist/span';
|
|
21
|
+
import { Span, SpanAttributes, SpanContextData, StreamedSpanJSON } from './types-hoist/span';
|
|
22
22
|
import { StartSpanOptions } from './types-hoist/startSpanOptions';
|
|
23
23
|
import { Transport, TransportMakeRequestResponse } from './types-hoist/transport';
|
|
24
24
|
import { PromiseBuffer } from './utils/promisebuffer';
|
|
@@ -210,6 +210,24 @@ export declare abstract class Client<O extends ClientOptions = ClientOptions> {
|
|
|
210
210
|
* @returns {() => void} A function that, when executed, removes the registered callback.
|
|
211
211
|
*/
|
|
212
212
|
on(hook: 'spanEnd', callback: (span: Span) => void): () => void;
|
|
213
|
+
/**
|
|
214
|
+
* Register a callback for after a span is ended and the `spanEnd` hook has run.
|
|
215
|
+
* NOTE: The span cannot be mutated anymore in this callback.
|
|
216
|
+
*/
|
|
217
|
+
on(hook: 'afterSpanEnd', callback: (immutableSegmentSpan: Readonly<Span>) => void): () => void;
|
|
218
|
+
/**
|
|
219
|
+
* Register a callback for after a segment span is ended and the `segmentSpanEnd` hook has run.
|
|
220
|
+
* NOTE: The segment span cannot be mutated anymore in this callback.
|
|
221
|
+
*/
|
|
222
|
+
on(hook: 'afterSegmentSpanEnd', callback: (immutableSegmentSpan: Readonly<Span>) => void): () => void;
|
|
223
|
+
/**
|
|
224
|
+
* Register a callback for when a span JSON is processed, to add some data to the span JSON.
|
|
225
|
+
*/
|
|
226
|
+
on(hook: 'processSpan', callback: (streamedSpanJSON: StreamedSpanJSON) => void): () => void;
|
|
227
|
+
/**
|
|
228
|
+
* Register a callback for when a segment span JSON is processed, to add some data to the segment span JSON.
|
|
229
|
+
*/
|
|
230
|
+
on(hook: 'processSegmentSpan', callback: (streamedSpanJSON: StreamedSpanJSON) => void): () => void;
|
|
213
231
|
/**
|
|
214
232
|
* Register a callback for when an idle span is allowed to auto-finish.
|
|
215
233
|
* @returns {() => void} A function that, when executed, removes the registered callback.
|
|
@@ -405,6 +423,22 @@ export declare abstract class Client<O extends ClientOptions = ClientOptions> {
|
|
|
405
423
|
}): void;
|
|
406
424
|
/** Fire a hook whenever a span ends. */
|
|
407
425
|
emit(hook: 'spanEnd', span: Span): void;
|
|
426
|
+
/**
|
|
427
|
+
* Fire a hook event after a span ends and the `spanEnd` hook has run.
|
|
428
|
+
*/
|
|
429
|
+
emit(hook: 'afterSpanEnd', immutableSpan: Readonly<Span>): void;
|
|
430
|
+
/**
|
|
431
|
+
* Fire a hook event after a segment span ends and the `spanEnd` hook has run.
|
|
432
|
+
*/
|
|
433
|
+
emit(hook: 'afterSegmentSpanEnd', immutableSegmentSpan: Readonly<Span>): void;
|
|
434
|
+
/**
|
|
435
|
+
* Fire a hook event when a span JSON is processed, to add some data to the span JSON.
|
|
436
|
+
*/
|
|
437
|
+
emit(hook: 'processSpan', streamedSpanJSON: StreamedSpanJSON): void;
|
|
438
|
+
/**
|
|
439
|
+
* Fire a hook event for when a segment span JSON is processed, to add some data to the segment span JSON.
|
|
440
|
+
*/
|
|
441
|
+
emit(hook: 'processSegmentSpan', streamedSpanJSON: StreamedSpanJSON): void;
|
|
408
442
|
/**
|
|
409
443
|
* Fire a hook indicating that an idle span is allowed to auto finish.
|
|
410
444
|
*/
|
|
@@ -31,6 +31,8 @@ export { prepareEvent } from './utils/prepareEvent';
|
|
|
31
31
|
export { ExclusiveEventHintOrCaptureContext } from './utils/prepareEvent';
|
|
32
32
|
export { createCheckInEnvelope } from './checkin';
|
|
33
33
|
export { hasSpansEnabled } from './utils/hasSpansEnabled';
|
|
34
|
+
export { withStreamedSpan } from './tracing/spans/beforeSendSpan';
|
|
35
|
+
export { isStreamedBeforeSendSpanCallback } from './tracing/spans/beforeSendSpan';
|
|
34
36
|
export { isSentryRequestUrl } from './utils/isSentryRequestUrl';
|
|
35
37
|
export { handleCallbackErrors } from './utils/handleCallbackErrors';
|
|
36
38
|
export { parameterize, fmt } from './utils/parameterize';
|
|
@@ -38,7 +40,7 @@ export { HandleTunnelRequestOptions } from './utils/tunnel';
|
|
|
38
40
|
export { handleTunnelRequest } from './utils/tunnel';
|
|
39
41
|
export { addAutoIpAddressToSession } from './utils/ipAddress';
|
|
40
42
|
export { addAutoIpAddressToUser } from './utils/ipAddress';
|
|
41
|
-
export { convertSpanLinksForEnvelope, spanToTraceHeader, spanToJSON, spanIsSampled, spanToTraceContext, getSpanDescendants, getStatusMessage, getRootSpan, getActiveSpan, addChildSpanToSpan, spanTimeInputToSeconds, updateSpanName, } from './utils/spanUtils';
|
|
43
|
+
export { convertSpanLinksForEnvelope, spanToTraceHeader, spanToJSON, spanToStreamedSpanJSON, spanIsSampled, spanToTraceContext, getSpanDescendants, getStatusMessage, getRootSpan, INTERNAL_getSegmentSpan, getActiveSpan, addChildSpanToSpan, spanTimeInputToSeconds, updateSpanName, } from './utils/spanUtils';
|
|
42
44
|
export { _setSpanForScope as _INTERNAL_setSpanForScope } from './utils/spanOnScope';
|
|
43
45
|
export { parseSampleRate } from './utils/parseSampleRate';
|
|
44
46
|
export { applySdkMetadata } from './utils/sdkMetadata';
|
|
@@ -46,6 +48,7 @@ export { getTraceData } from './utils/traceData';
|
|
|
46
48
|
export { shouldPropagateTraceForUrl } from './utils/tracePropagationTargets';
|
|
47
49
|
export { getTraceMetaTags } from './utils/meta';
|
|
48
50
|
export { debounce } from './utils/debounce';
|
|
51
|
+
export { shouldIgnoreSpan } from './utils/should-ignore-span';
|
|
49
52
|
export { winterCGHeadersToDict, winterCGRequestToRequestData, httpRequestToRequestData, extractQueryParamsFromUrl, headersToDict, httpHeadersToSpanAttributes, } from './utils/request';
|
|
50
53
|
export { DEFAULT_ENVIRONMENT, DEV_ENVIRONMENT } from './constants';
|
|
51
54
|
export { addBreadcrumb } from './breadcrumbs';
|
|
@@ -56,6 +59,8 @@ export { linkedErrorsIntegration } from './integrations/linkederrors';
|
|
|
56
59
|
export { moduleMetadataIntegration } from './integrations/moduleMetadata';
|
|
57
60
|
export { requestDataIntegration } from './integrations/requestdata';
|
|
58
61
|
export { captureConsoleIntegration } from './integrations/captureconsole';
|
|
62
|
+
export { patchExpressModule, setupExpressErrorHandler, expressErrorHandler } from './integrations/express/index';
|
|
63
|
+
export { ExpressIntegrationOptions, ExpressHandlerOptions, ExpressMiddleware, ExpressErrorMiddleware, } from './integrations/express/types';
|
|
59
64
|
export { dedupeIntegration } from './integrations/dedupe';
|
|
60
65
|
export { extraErrorDataIntegration } from './integrations/extraerrordata';
|
|
61
66
|
export { rewriteFramesIntegration } from './integrations/rewriteframes';
|
|
@@ -92,7 +97,7 @@ export { ANTHROPIC_AI_INTEGRATION_NAME } from './tracing/anthropic-ai/constants'
|
|
|
92
97
|
export { instrumentGoogleGenAIClient } from './tracing/google-genai';
|
|
93
98
|
export { GOOGLE_GENAI_INTEGRATION_NAME } from './tracing/google-genai/constants';
|
|
94
99
|
export { GoogleGenAIResponse } from './tracing/google-genai/types';
|
|
95
|
-
export { createLangChainCallbackHandler } from './tracing/langchain';
|
|
100
|
+
export { createLangChainCallbackHandler, instrumentLangChainEmbeddings } from './tracing/langchain';
|
|
96
101
|
export { LANGCHAIN_INTEGRATION_NAME } from './tracing/langchain/constants';
|
|
97
102
|
export { LangChainOptions, LangChainIntegration } from './tracing/langchain/types';
|
|
98
103
|
export { instrumentStateGraphCompile, instrumentLangGraph } from './tracing/langgraph';
|
|
@@ -101,6 +106,9 @@ export { LangGraphOptions, LangGraphIntegration, CompiledGraph } from './tracing
|
|
|
101
106
|
export { OpenAiClient, OpenAiOptions, InstrumentedMethod } from './tracing/openai/types';
|
|
102
107
|
export { AnthropicAiClient, AnthropicAiOptions, AnthropicAiInstrumentedMethod, AnthropicAiResponse, } from './tracing/anthropic-ai/types';
|
|
103
108
|
export { GoogleGenAIClient, GoogleGenAIChat, GoogleGenAIOptions, GoogleGenAIIstrumentedMethod, } from './tracing/google-genai/types';
|
|
109
|
+
export { SpanBuffer } from './tracing/spans/spanBuffer';
|
|
110
|
+
export { hasSpanStreamingEnabled } from './tracing/spans/hasSpanStreamingEnabled';
|
|
111
|
+
export { spanStreamingIntegration } from './integrations/spanStreaming';
|
|
104
112
|
export { FeatureFlag } from './utils/featureFlags';
|
|
105
113
|
export { _INTERNAL_copyFlagsFromScopeToEvent, _INTERNAL_insertFlagToScope, _INTERNAL_addFeatureFlagToActiveSpan, _INTERNAL_FLAG_BUFFER_SIZE, _INTERNAL_MAX_FLAGS_PER_SPAN, } from './utils/featureFlags';
|
|
106
114
|
export { applyAggregateErrorsToEvent } from './utils/aggregate-errors';
|
|
@@ -160,7 +168,7 @@ export { Context, Contexts, DeviceContext, OsContext, AppContext, CultureContext
|
|
|
160
168
|
export { DataCategory } from './types-hoist/datacategory';
|
|
161
169
|
export { DsnComponents, DsnLike, DsnProtocol } from './types-hoist/dsn';
|
|
162
170
|
export { DebugImage, DebugMeta } from './types-hoist/debugMeta';
|
|
163
|
-
export { AttachmentItem, BaseEnvelopeHeaders, BaseEnvelopeItemHeaders, ClientReportEnvelope, ClientReportItem, DynamicSamplingContext, Envelope, EnvelopeItemType, EnvelopeItem, EventEnvelope, EventEnvelopeHeaders, EventItem, ReplayEnvelope, FeedbackItem, SessionEnvelope, SessionItem, UserFeedbackItem, CheckInItem, CheckInEnvelope, RawSecurityEnvelope, RawSecurityItem, ProfileItem, ProfileChunkEnvelope, ProfileChunkItem, SpanEnvelope, SpanItem, LogEnvelope, MetricEnvelope, } from './types-hoist/envelope';
|
|
171
|
+
export { AttachmentItem, BaseEnvelopeHeaders, BaseEnvelopeItemHeaders, ClientReportEnvelope, ClientReportItem, DynamicSamplingContext, Envelope, EnvelopeItemType, EnvelopeItem, EventEnvelope, EventEnvelopeHeaders, EventItem, ReplayEnvelope, FeedbackItem, SessionEnvelope, SessionItem, UserFeedbackItem, CheckInItem, CheckInEnvelope, RawSecurityEnvelope, RawSecurityItem, ProfileItem, ProfileChunkEnvelope, ProfileChunkItem, SpanEnvelope, StreamedSpanEnvelope, SpanItem, LogEnvelope, MetricEnvelope, } from './types-hoist/envelope';
|
|
164
172
|
export { ExtendedError } from './types-hoist/error';
|
|
165
173
|
export { Event, EventHint, EventType, ErrorEvent, TransactionEvent } from './types-hoist/event';
|
|
166
174
|
export { EventProcessor } from './types-hoist/eventprocessor';
|
|
@@ -181,7 +189,7 @@ export { SdkInfo } from './types-hoist/sdkinfo';
|
|
|
181
189
|
export { SdkMetadata } from './types-hoist/sdkmetadata';
|
|
182
190
|
export { SessionAggregates, AggregationCounts, Session, SessionContext, SessionStatus, SerializedSession, } from './types-hoist/session';
|
|
183
191
|
export { SeverityLevel } from './types-hoist/severity';
|
|
184
|
-
export { Span, SentrySpanArguments, SpanOrigin, SpanAttributeValue, SpanAttributes, SpanTimeInput, SpanJSON, SpanContextData, TraceFlag, } from './types-hoist/span';
|
|
192
|
+
export { Span, SentrySpanArguments, SpanOrigin, SpanAttributeValue, SpanAttributes, SpanTimeInput, SpanJSON, SpanContextData, TraceFlag, SerializedStreamedSpan, SerializedStreamedSpanContainer, StreamedSpanJSON, } from './types-hoist/span';
|
|
185
193
|
export { SpanStatus } from './types-hoist/spanStatus';
|
|
186
194
|
export { Log, LogSeverityLevel } from './types-hoist/log';
|
|
187
195
|
export { Metric, MetricType, SerializedMetric, SerializedMetricContainer, SerializedMetricAttributeValue, } from './types-hoist/metric';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-portable Express tracing integration.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*
|
|
6
|
+
* This Sentry integration is a derivative work based on the OpenTelemetry
|
|
7
|
+
* Express instrumentation.
|
|
8
|
+
*
|
|
9
|
+
* <https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-express>
|
|
10
|
+
*
|
|
11
|
+
* Extended under the terms of the Apache 2.0 license linked below:
|
|
12
|
+
*
|
|
13
|
+
* ----
|
|
14
|
+
*
|
|
15
|
+
* Copyright The OpenTelemetry Authors
|
|
16
|
+
*
|
|
17
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License.
|
|
19
|
+
* You may obtain a copy of the License at
|
|
20
|
+
*
|
|
21
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
24
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
25
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
|
+
* See the License for the specific language governing permissions and
|
|
27
|
+
* limitations under the License.
|
|
28
|
+
*/
|
|
29
|
+
import { ExpressErrorMiddleware, ExpressExport, ExpressHandlerOptions, ExpressIntegrationOptions } from './types';
|
|
30
|
+
/**
|
|
31
|
+
* This is a portable instrumentatiton function that works in any environment
|
|
32
|
+
* where Express can be loaded, without depending on OpenTelemetry.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```javascript
|
|
36
|
+
* import express from 'express';
|
|
37
|
+
* import * as Sentry from '@sentry/deno'; // or any SDK that extends core
|
|
38
|
+
*
|
|
39
|
+
* Sentry.patchExpressModule({ express })
|
|
40
|
+
*/
|
|
41
|
+
export declare const patchExpressModule: (options: ExpressIntegrationOptions) => ExpressExport;
|
|
42
|
+
/**
|
|
43
|
+
* An Express-compatible error handler, used by setupExpressErrorHandler
|
|
44
|
+
*/
|
|
45
|
+
export declare function expressErrorHandler(options?: ExpressHandlerOptions): ExpressErrorMiddleware;
|
|
46
|
+
/**
|
|
47
|
+
* Add an Express error handler to capture errors to Sentry.
|
|
48
|
+
*
|
|
49
|
+
* The error handler must be before any other middleware and after all controllers.
|
|
50
|
+
*
|
|
51
|
+
* @param app The Express instances
|
|
52
|
+
* @param options {ExpressHandlerOptions} Configuration options for the handler
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```javascript
|
|
56
|
+
* import * as Sentry from 'sentry/deno'; // or any other @sentry/<platform>
|
|
57
|
+
* import * as express from 'express';
|
|
58
|
+
*
|
|
59
|
+
* Sentry.instrumentExpress(express);
|
|
60
|
+
*
|
|
61
|
+
* const app = express();
|
|
62
|
+
*
|
|
63
|
+
* // Add your routes, etc.
|
|
64
|
+
*
|
|
65
|
+
* // Add this after all routes,
|
|
66
|
+
* // but before any and other error-handling middlewares are defined
|
|
67
|
+
* Sentry.setupExpressErrorHandler(app);
|
|
68
|
+
*
|
|
69
|
+
* app.listen(3000);
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare function setupExpressErrorHandler(app: {
|
|
73
|
+
use: (middleware: any) => unknown;
|
|
74
|
+
}, options?: ExpressHandlerOptions): void;
|
|
75
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Platform-portable Express tracing integration.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*
|
|
6
|
+
* This Sentry integration is a derivative work based on the OpenTelemetry
|
|
7
|
+
* Express instrumentation.
|
|
8
|
+
*
|
|
9
|
+
* <https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-express>
|
|
10
|
+
*
|
|
11
|
+
* Extended under the terms of the Apache 2.0 license linked below:
|
|
12
|
+
*
|
|
13
|
+
* ----
|
|
14
|
+
*
|
|
15
|
+
* Copyright The OpenTelemetry Authors
|
|
16
|
+
*
|
|
17
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License.
|
|
19
|
+
* You may obtain a copy of the License at
|
|
20
|
+
*
|
|
21
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
24
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
25
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
|
+
* See the License for the specific language governing permissions and
|
|
27
|
+
* limitations under the License.
|
|
28
|
+
*/
|
|
29
|
+
import { ExpressIntegrationOptions, ExpressLayer } from './types';
|
|
30
|
+
export type ExpressPatchLayerOptions = Pick<ExpressIntegrationOptions, 'onRouteResolved' | 'ignoreLayers' | 'ignoreLayersType'>;
|
|
31
|
+
export declare function patchLayer(options: ExpressPatchLayerOptions, maybeLayer?: ExpressLayer, layerPath?: string): void;
|
|
32
|
+
//# sourceMappingURL=patch-layer.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-portable Express tracing integration.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*
|
|
6
|
+
* This Sentry integration is a derivative work based on the OpenTelemetry
|
|
7
|
+
* Express instrumentation.
|
|
8
|
+
*
|
|
9
|
+
* <https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-express>
|
|
10
|
+
*
|
|
11
|
+
* Extended under the terms of the Apache 2.0 license linked below:
|
|
12
|
+
*
|
|
13
|
+
* ----
|
|
14
|
+
*
|
|
15
|
+
* Copyright The OpenTelemetry Authors
|
|
16
|
+
*
|
|
17
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License.
|
|
19
|
+
* You may obtain a copy of the License at
|
|
20
|
+
*
|
|
21
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
24
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
25
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
|
+
* See the License for the specific language governing permissions and
|
|
27
|
+
* limitations under the License.
|
|
28
|
+
*/
|
|
29
|
+
import { ExpressRequest } from './types';
|
|
30
|
+
export declare const storeLayer: (req: ExpressRequest, layer: string) => void;
|
|
31
|
+
export declare const getStoredLayers: (req: ExpressRequest) => string[];
|
|
32
|
+
//# sourceMappingURL=request-layer-store.d.ts.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-portable Express tracing integration.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*
|
|
6
|
+
* This Sentry integration is a derivative work based on the OpenTelemetry
|
|
7
|
+
* Express instrumentation.
|
|
8
|
+
*
|
|
9
|
+
* <https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-express>
|
|
10
|
+
*
|
|
11
|
+
* Extended under the terms of the Apache 2.0 license linked below:
|
|
12
|
+
*
|
|
13
|
+
* ----
|
|
14
|
+
*
|
|
15
|
+
* Copyright The OpenTelemetry Authors
|
|
16
|
+
*
|
|
17
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License.
|
|
19
|
+
* You may obtain a copy of the License at
|
|
20
|
+
*
|
|
21
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
24
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
25
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
|
+
* See the License for the specific language governing permissions and
|
|
27
|
+
* limitations under the License.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Abstract this out because we call it in multiple places, and it's cheaper to
|
|
31
|
+
* only do one time for any given request.
|
|
32
|
+
*/
|
|
33
|
+
import { ExpressRequest } from './types';
|
|
34
|
+
export declare function setSDKProcessingMetadata(request: ExpressRequest): void;
|
|
35
|
+
//# sourceMappingURL=set-sdk-processing-metadata.d.ts.map
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-portable Express tracing integration.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*
|
|
6
|
+
* This Sentry integration is a derivative work based on the OpenTelemetry
|
|
7
|
+
* Express instrumentation.
|
|
8
|
+
*
|
|
9
|
+
* <https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-express>
|
|
10
|
+
*
|
|
11
|
+
* Extended under the terms of the Apache 2.0 license linked below:
|
|
12
|
+
*
|
|
13
|
+
* ----
|
|
14
|
+
*
|
|
15
|
+
* Copyright The OpenTelemetry Authors
|
|
16
|
+
*
|
|
17
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License.
|
|
19
|
+
* You may obtain a copy of the License at
|
|
20
|
+
*
|
|
21
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
24
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
25
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
|
+
* See the License for the specific language governing permissions and
|
|
27
|
+
* limitations under the License.
|
|
28
|
+
*/
|
|
29
|
+
import { RequestEventData } from '../../types-hoist/request';
|
|
30
|
+
import { SpanAttributes } from '../../types-hoist/span';
|
|
31
|
+
export declare const ATTR_EXPRESS_NAME = "express.name";
|
|
32
|
+
export declare const ATTR_HTTP_ROUTE = "http.route";
|
|
33
|
+
export declare const ATTR_EXPRESS_TYPE = "express.type";
|
|
34
|
+
export type ExpressExport = {
|
|
35
|
+
Router: ExpressRouterv5 | ExpressRouterv4;
|
|
36
|
+
application: ExpressApplication;
|
|
37
|
+
};
|
|
38
|
+
export type ExpressExportv5 = ExpressExport & {
|
|
39
|
+
Router: ExpressRouterv5;
|
|
40
|
+
};
|
|
41
|
+
export type ExpressExportv4 = ExpressExport & {
|
|
42
|
+
Router: ExpressRouterv4;
|
|
43
|
+
};
|
|
44
|
+
export type ExpressModuleExport = ExpressExport | {
|
|
45
|
+
default: ExpressExport;
|
|
46
|
+
};
|
|
47
|
+
export interface ExpressRequest extends RequestEventData {
|
|
48
|
+
originalUrl: string;
|
|
49
|
+
route: unknown;
|
|
50
|
+
res?: ExpressResponse;
|
|
51
|
+
}
|
|
52
|
+
export interface ExpressResponse {
|
|
53
|
+
once(ev: string, listener: Function): this;
|
|
54
|
+
removeListener(ev: string, listener?: Function): this;
|
|
55
|
+
emit(ev: string, ...data: unknown[]): this;
|
|
56
|
+
}
|
|
57
|
+
export interface NextFunction {
|
|
58
|
+
(err?: unknown): void;
|
|
59
|
+
/**
|
|
60
|
+
* "Break-out" of a router by calling {next('router')};
|
|
61
|
+
* @see {https://expressjs.com/en/guide/using-middleware.html#middleware.router}
|
|
62
|
+
*/
|
|
63
|
+
(deferToNext: 'router'): void;
|
|
64
|
+
/**
|
|
65
|
+
* "Break-out" of a route by calling {next('route')};
|
|
66
|
+
* @see {https://expressjs.com/en/guide/using-middleware.html#middleware.application}
|
|
67
|
+
*/
|
|
68
|
+
(deferToNext: 'route'): void;
|
|
69
|
+
}
|
|
70
|
+
export type ExpressApplicationRequestHandler = (...handlers: any[]) => any;
|
|
71
|
+
export type ExpressRequestInfo<T = unknown> = {
|
|
72
|
+
/** An express request object */
|
|
73
|
+
request: T;
|
|
74
|
+
route: string;
|
|
75
|
+
layerType: ExpressLayerType;
|
|
76
|
+
};
|
|
77
|
+
export type ExpressLayerType = 'router' | 'middleware' | 'request_handler';
|
|
78
|
+
export declare const ExpressLayerType_ROUTER = "router";
|
|
79
|
+
export declare const ExpressLayerType_MIDDLEWARE = "middleware";
|
|
80
|
+
export declare const ExpressLayerType_REQUEST_HANDLER = "request_handler";
|
|
81
|
+
export type PathParams = string | RegExp | Array<string | RegExp>;
|
|
82
|
+
export type LayerPathSegment = string | RegExp | number;
|
|
83
|
+
export interface ExpressRoute {
|
|
84
|
+
path: string;
|
|
85
|
+
stack: ExpressLayer[];
|
|
86
|
+
}
|
|
87
|
+
export type ExpressRouterv4 = ExpressRouter;
|
|
88
|
+
export interface ExpressRouterv5 {
|
|
89
|
+
prototype: ExpressRouter;
|
|
90
|
+
}
|
|
91
|
+
export type ExpressLayer = {
|
|
92
|
+
handle: Function & Record<string, unknown> & {
|
|
93
|
+
stack?: ExpressLayer[];
|
|
94
|
+
};
|
|
95
|
+
name: string;
|
|
96
|
+
params: {
|
|
97
|
+
[key: string]: string;
|
|
98
|
+
};
|
|
99
|
+
path?: string;
|
|
100
|
+
regexp: RegExp;
|
|
101
|
+
route?: ExpressLayer;
|
|
102
|
+
};
|
|
103
|
+
export type ExpressRouter = {
|
|
104
|
+
params: {
|
|
105
|
+
[key: string]: string;
|
|
106
|
+
};
|
|
107
|
+
_params: string[];
|
|
108
|
+
caseSensitive: boolean;
|
|
109
|
+
mergeParams: boolean;
|
|
110
|
+
strict: boolean;
|
|
111
|
+
stack: ExpressLayer[];
|
|
112
|
+
route(prefix: PathParams): ExpressRoute;
|
|
113
|
+
use(...handlers: unknown[]): unknown;
|
|
114
|
+
};
|
|
115
|
+
export type IgnoreMatcher = string | RegExp | ((name: string) => boolean);
|
|
116
|
+
export type ExpressIntegrationOptions = {
|
|
117
|
+
express: ExpressModuleExport;
|
|
118
|
+
/** Ignore specific based on their name */
|
|
119
|
+
ignoreLayers?: IgnoreMatcher[];
|
|
120
|
+
/** Ignore specific layers based on their type */
|
|
121
|
+
ignoreLayersType?: ExpressLayerType[];
|
|
122
|
+
/**
|
|
123
|
+
* Optional callback invoked each time a layer resolves the matched HTTP route.
|
|
124
|
+
* Platform-specific integrations (e.g. Node.js) use this to propagate the
|
|
125
|
+
* resolved route to the underlying transport layer (e.g. OTel RPCMetadata).
|
|
126
|
+
*/
|
|
127
|
+
onRouteResolved?: (route: string | undefined) => void;
|
|
128
|
+
};
|
|
129
|
+
export type LayerMetadata = {
|
|
130
|
+
attributes: SpanAttributes;
|
|
131
|
+
name: string;
|
|
132
|
+
};
|
|
133
|
+
export interface ExpressApplication {
|
|
134
|
+
stack: ExpressLayer[];
|
|
135
|
+
use: ExpressApplicationRequestHandler;
|
|
136
|
+
}
|
|
137
|
+
export interface MiddlewareError extends Error {
|
|
138
|
+
status?: number | string;
|
|
139
|
+
statusCode?: number | string;
|
|
140
|
+
status_code?: number | string;
|
|
141
|
+
output?: {
|
|
142
|
+
statusCode?: number | string;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
export type ExpressMiddleware = (req: ExpressRequest, res: ExpressResponse, next: () => void) => void;
|
|
146
|
+
export type ExpressErrorMiddleware = (error: MiddlewareError, req: ExpressRequest, res: ExpressResponse, next: (error: MiddlewareError) => void) => void;
|
|
147
|
+
export interface ExpressHandlerOptions {
|
|
148
|
+
/**
|
|
149
|
+
* Callback method deciding whether error should be captured and sent to Sentry
|
|
150
|
+
* @param error Captured middleware error
|
|
151
|
+
*/
|
|
152
|
+
shouldHandleError?(this: void, error: MiddlewareError): boolean;
|
|
153
|
+
}
|
|
154
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform-portable Express tracing integration.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*
|
|
6
|
+
* This Sentry integration is a derivative work based on the OpenTelemetry
|
|
7
|
+
* Express instrumentation.
|
|
8
|
+
*
|
|
9
|
+
* <https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/instrumentation-express>
|
|
10
|
+
*
|
|
11
|
+
* Extended under the terms of the Apache 2.0 license linked below:
|
|
12
|
+
*
|
|
13
|
+
* ----
|
|
14
|
+
*
|
|
15
|
+
* Copyright The OpenTelemetry Authors
|
|
16
|
+
*
|
|
17
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License.
|
|
19
|
+
* You may obtain a copy of the License at
|
|
20
|
+
*
|
|
21
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
24
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
25
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
|
+
* See the License for the specific language governing permissions and
|
|
27
|
+
* limitations under the License.
|
|
28
|
+
*/
|
|
29
|
+
import { SpanAttributes } from '../../types-hoist/span';
|
|
30
|
+
import { ExpressExport, ExpressIntegrationOptions, ExpressLayer, ExpressLayerType, ExpressRequest, MiddlewareError, ExpressExportv5, ExpressExportv4 } from './types';
|
|
31
|
+
import { ATTR_EXPRESS_NAME, ATTR_EXPRESS_TYPE } from './types';
|
|
32
|
+
/**
|
|
33
|
+
* Converts a user-provided error value into an error and error message pair
|
|
34
|
+
*
|
|
35
|
+
* @param error - User-provided error value
|
|
36
|
+
* @returns Both an Error or string representation of the value and an error message
|
|
37
|
+
*/
|
|
38
|
+
export declare const asErrorAndMessage: (error: unknown) => [
|
|
39
|
+
string | Error,
|
|
40
|
+
string
|
|
41
|
+
];
|
|
42
|
+
/**
|
|
43
|
+
* Checks if a route contains parameter patterns (e.g., :id, :userId)
|
|
44
|
+
* which are valid even if they don't exactly match the original URL
|
|
45
|
+
*/
|
|
46
|
+
export declare function isRoutePattern(route: string): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Parse express layer context to retrieve a name and attributes.
|
|
49
|
+
* @param route The route of the layer
|
|
50
|
+
* @param layer Express layer
|
|
51
|
+
* @param [layerPath] if present, the path on which the layer has been mounted
|
|
52
|
+
*/
|
|
53
|
+
export declare const getLayerMetadata: (route: string, layer: ExpressLayer, layerPath?: string) => {
|
|
54
|
+
attributes: SpanAttributes & {
|
|
55
|
+
[ATTR_EXPRESS_NAME]: string;
|
|
56
|
+
[ATTR_EXPRESS_TYPE]: ExpressLayerType;
|
|
57
|
+
};
|
|
58
|
+
name: string;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Recursively search the router path from layer stack
|
|
62
|
+
* @param path The path to reconstruct
|
|
63
|
+
* @param layer The layer to reconstruct from
|
|
64
|
+
* @returns The reconstructed path
|
|
65
|
+
*/
|
|
66
|
+
export declare const getRouterPath: (path: string, layer: ExpressLayer) => string;
|
|
67
|
+
/**
|
|
68
|
+
* Check whether the given request is ignored by configuration
|
|
69
|
+
* It will not re-throw exceptions from `list` provided by the client
|
|
70
|
+
* @param constant e.g URL of request
|
|
71
|
+
* @param [list] List of ignore patterns
|
|
72
|
+
* @param [onException] callback for doing something when an exception has
|
|
73
|
+
* occurred
|
|
74
|
+
*/
|
|
75
|
+
export type ExpressIsLayerIgnoredOptions = Pick<ExpressIntegrationOptions, 'ignoreLayersType' | 'ignoreLayers'>;
|
|
76
|
+
export declare const isLayerIgnored: (name: string, type: ExpressLayerType, config?: ExpressIsLayerIgnoredOptions) => boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Extracts the actual matched route from Express request for OpenTelemetry instrumentation.
|
|
79
|
+
* Returns the route that should be used as the http.route attribute.
|
|
80
|
+
*
|
|
81
|
+
* @param req - The Express request object with layers store
|
|
82
|
+
* @param constructedRoute - The constructed route from `getConstructedRoute`
|
|
83
|
+
* @returns The matched route string or undefined if no valid route is found
|
|
84
|
+
*/
|
|
85
|
+
export declare function getActualMatchedRoute(req: ExpressRequest, constructedRoute: string): string | undefined;
|
|
86
|
+
export declare function getConstructedRoute(req: ExpressRequest): string;
|
|
87
|
+
export declare const getLayerPath: (args: unknown[]) => string | undefined;
|
|
88
|
+
export declare const isExpressWithRouterPrototype: (express: unknown) => express is ExpressExportv5;
|
|
89
|
+
export declare const isExpressWithoutRouterPrototype: (express: unknown) => express is ExpressExportv4;
|
|
90
|
+
export declare const hasDefaultProp: (express: unknown) => express is {
|
|
91
|
+
[k: string]: unknown;
|
|
92
|
+
default: ExpressExport;
|
|
93
|
+
};
|
|
94
|
+
/** Returns true if response code is internal server error */
|
|
95
|
+
export declare function defaultShouldHandleError(error: MiddlewareError): boolean;
|
|
96
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -25,8 +25,9 @@ export declare function storeSpanForRequest(transport: MCPTransport, requestId:
|
|
|
25
25
|
* @param requestId - Request identifier
|
|
26
26
|
* @param result - Execution result for attribute extraction
|
|
27
27
|
* @param options - Resolved MCP options
|
|
28
|
+
* @param hasError - Whether the JSON-RPC response contained an error
|
|
28
29
|
*/
|
|
29
|
-
export declare function completeSpanWithResults(transport: MCPTransport, requestId: RequestId, result: unknown, options: ResolvedMcpOptions): void;
|
|
30
|
+
export declare function completeSpanWithResults(transport: MCPTransport, requestId: RequestId, result: unknown, options: ResolvedMcpOptions, hasError?: boolean): void;
|
|
30
31
|
/**
|
|
31
32
|
* Cleans up pending spans for a specific transport (when that transport closes)
|
|
32
33
|
* @param transport - MCP transport instance
|
|
@@ -6,22 +6,27 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { MCPServerInstance } from './types';
|
|
8
8
|
/**
|
|
9
|
-
* Wraps tool handlers to associate them with request spans
|
|
9
|
+
* Wraps tool handlers to associate them with request spans.
|
|
10
|
+
* Instruments both `tool` (legacy API) and `registerTool` (new API) if present.
|
|
10
11
|
* @param serverInstance - MCP server instance
|
|
11
12
|
*/
|
|
12
13
|
export declare function wrapToolHandlers(serverInstance: MCPServerInstance): void;
|
|
13
14
|
/**
|
|
14
|
-
* Wraps resource handlers to associate them with request spans
|
|
15
|
+
* Wraps resource handlers to associate them with request spans.
|
|
16
|
+
* Instruments both `resource` (legacy API) and `registerResource` (new API) if present.
|
|
15
17
|
* @param serverInstance - MCP server instance
|
|
16
18
|
*/
|
|
17
19
|
export declare function wrapResourceHandlers(serverInstance: MCPServerInstance): void;
|
|
18
20
|
/**
|
|
19
|
-
* Wraps prompt handlers to associate them with request spans
|
|
21
|
+
* Wraps prompt handlers to associate them with request spans.
|
|
22
|
+
* Instruments both `prompt` (legacy API) and `registerPrompt` (new API) if present.
|
|
20
23
|
* @param serverInstance - MCP server instance
|
|
21
24
|
*/
|
|
22
25
|
export declare function wrapPromptHandlers(serverInstance: MCPServerInstance): void;
|
|
23
26
|
/**
|
|
24
|
-
* Wraps all MCP handler types
|
|
27
|
+
* Wraps all MCP handler types for span correlation.
|
|
28
|
+
* Supports both the legacy API (`tool`, `resource`, `prompt`) and the newer API
|
|
29
|
+
* (`registerTool`, `registerResource`, `registerPrompt`), instrumenting whichever methods are present.
|
|
25
30
|
* @param serverInstance - MCP server instance
|
|
26
31
|
*/
|
|
27
32
|
export declare function wrapAllMCPHandlers(serverInstance: MCPServerInstance): void;
|
|
@@ -2,7 +2,8 @@ import { McpServerWrapperOptions } from './types';
|
|
|
2
2
|
/**
|
|
3
3
|
* Wraps a MCP Server instance from the `@modelcontextprotocol/sdk` package with Sentry instrumentation.
|
|
4
4
|
*
|
|
5
|
-
* Compatible with versions `^1.9.0` of the `@modelcontextprotocol/sdk` package
|
|
5
|
+
* Compatible with versions `^1.9.0` of the `@modelcontextprotocol/sdk` package (legacy `tool`/`resource`/`prompt` API)
|
|
6
|
+
* and versions that expose the newer `registerTool`/`registerResource`/`registerPrompt` API (introduced in 1.x, sole API in 2.x).
|
|
6
7
|
* Automatically instruments transport methods and handler functions for comprehensive monitoring.
|
|
7
8
|
*
|
|
8
9
|
* @example
|