@sentry/core 10.46.0 → 10.47.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.
Files changed (124) hide show
  1. package/build/cjs/api.js +1 -0
  2. package/build/cjs/api.js.map +1 -1
  3. package/build/cjs/currentScopes.js +33 -0
  4. package/build/cjs/currentScopes.js.map +1 -1
  5. package/build/cjs/index.js +6 -0
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/integrations/supabase.js +1 -1
  8. package/build/cjs/integrations/supabase.js.map +1 -1
  9. package/build/cjs/tracing/ai/gen-ai-attributes.js +0 -14
  10. package/build/cjs/tracing/ai/gen-ai-attributes.js.map +1 -1
  11. package/build/cjs/tracing/ai/utils.js +0 -35
  12. package/build/cjs/tracing/ai/utils.js.map +1 -1
  13. package/build/cjs/tracing/anthropic-ai/constants.js +10 -10
  14. package/build/cjs/tracing/anthropic-ai/constants.js.map +1 -1
  15. package/build/cjs/tracing/anthropic-ai/index.js +18 -9
  16. package/build/cjs/tracing/anthropic-ai/index.js.map +1 -1
  17. package/build/cjs/tracing/anthropic-ai/utils.js +0 -9
  18. package/build/cjs/tracing/anthropic-ai/utils.js.map +1 -1
  19. package/build/cjs/tracing/google-genai/constants.js +10 -8
  20. package/build/cjs/tracing/google-genai/constants.js.map +1 -1
  21. package/build/cjs/tracing/google-genai/index.js +44 -16
  22. package/build/cjs/tracing/google-genai/index.js.map +1 -1
  23. package/build/cjs/tracing/google-genai/utils.js +0 -25
  24. package/build/cjs/tracing/google-genai/utils.js.map +1 -1
  25. package/build/cjs/tracing/openai/constants.js +7 -7
  26. package/build/cjs/tracing/openai/constants.js.map +1 -1
  27. package/build/cjs/tracing/openai/index.js +18 -9
  28. package/build/cjs/tracing/openai/index.js.map +1 -1
  29. package/build/cjs/tracing/openai/utils.js +0 -39
  30. package/build/cjs/tracing/openai/utils.js.map +1 -1
  31. package/build/cjs/tracing/trace.js +5 -0
  32. package/build/cjs/tracing/trace.js.map +1 -1
  33. package/build/cjs/utils/traceData.js +11 -0
  34. package/build/cjs/utils/traceData.js.map +1 -1
  35. package/build/cjs/utils/version.js +1 -1
  36. package/build/esm/api.js +1 -1
  37. package/build/esm/api.js.map +1 -1
  38. package/build/esm/currentScopes.js +31 -1
  39. package/build/esm/currentScopes.js.map +1 -1
  40. package/build/esm/index.js +3 -2
  41. package/build/esm/index.js.map +1 -1
  42. package/build/esm/integrations/supabase.js +1 -1
  43. package/build/esm/integrations/supabase.js.map +1 -1
  44. package/build/esm/package.json +1 -1
  45. package/build/esm/tracing/ai/gen-ai-attributes.js +1 -14
  46. package/build/esm/tracing/ai/gen-ai-attributes.js.map +1 -1
  47. package/build/esm/tracing/ai/utils.js +1 -34
  48. package/build/esm/tracing/ai/utils.js.map +1 -1
  49. package/build/esm/tracing/anthropic-ai/constants.js +10 -10
  50. package/build/esm/tracing/anthropic-ai/constants.js.map +1 -1
  51. package/build/esm/tracing/anthropic-ai/index.js +21 -12
  52. package/build/esm/tracing/anthropic-ai/index.js.map +1 -1
  53. package/build/esm/tracing/anthropic-ai/utils.js +1 -9
  54. package/build/esm/tracing/anthropic-ai/utils.js.map +1 -1
  55. package/build/esm/tracing/google-genai/constants.js +10 -8
  56. package/build/esm/tracing/google-genai/constants.js.map +1 -1
  57. package/build/esm/tracing/google-genai/index.js +48 -20
  58. package/build/esm/tracing/google-genai/index.js.map +1 -1
  59. package/build/esm/tracing/google-genai/utils.js +1 -24
  60. package/build/esm/tracing/google-genai/utils.js.map +1 -1
  61. package/build/esm/tracing/openai/constants.js +7 -7
  62. package/build/esm/tracing/openai/constants.js.map +1 -1
  63. package/build/esm/tracing/openai/index.js +21 -12
  64. package/build/esm/tracing/openai/index.js.map +1 -1
  65. package/build/esm/tracing/openai/utils.js +2 -38
  66. package/build/esm/tracing/openai/utils.js.map +1 -1
  67. package/build/esm/tracing/trace.js +5 -0
  68. package/build/esm/tracing/trace.js.map +1 -1
  69. package/build/esm/utils/traceData.js +12 -1
  70. package/build/esm/utils/traceData.js.map +1 -1
  71. package/build/esm/utils/version.js +1 -1
  72. package/build/types/api.d.ts +1 -0
  73. package/build/types/api.d.ts.map +1 -1
  74. package/build/types/asyncContext/types.d.ts +3 -1
  75. package/build/types/asyncContext/types.d.ts.map +1 -1
  76. package/build/types/currentScopes.d.ts +20 -0
  77. package/build/types/currentScopes.d.ts.map +1 -1
  78. package/build/types/index.d.ts +3 -2
  79. package/build/types/index.d.ts.map +1 -1
  80. package/build/types/tracing/ai/gen-ai-attributes.d.ts +0 -8
  81. package/build/types/tracing/ai/gen-ai-attributes.d.ts.map +1 -1
  82. package/build/types/tracing/ai/utils.d.ts +15 -9
  83. package/build/types/tracing/ai/utils.d.ts.map +1 -1
  84. package/build/types/tracing/anthropic-ai/constants.d.ts +24 -1
  85. package/build/types/tracing/anthropic-ai/constants.d.ts.map +1 -1
  86. package/build/types/tracing/anthropic-ai/index.d.ts.map +1 -1
  87. package/build/types/tracing/anthropic-ai/types.d.ts +5 -2
  88. package/build/types/tracing/anthropic-ai/types.d.ts.map +1 -1
  89. package/build/types/tracing/anthropic-ai/utils.d.ts +1 -5
  90. package/build/types/tracing/anthropic-ai/utils.d.ts.map +1 -1
  91. package/build/types/tracing/google-genai/constants.d.ts +22 -1
  92. package/build/types/tracing/google-genai/constants.d.ts.map +1 -1
  93. package/build/types/tracing/google-genai/index.d.ts.map +1 -1
  94. package/build/types/tracing/google-genai/types.d.ts +6 -2
  95. package/build/types/tracing/google-genai/types.d.ts.map +1 -1
  96. package/build/types/tracing/google-genai/utils.d.ts +0 -9
  97. package/build/types/tracing/google-genai/utils.d.ts.map +1 -1
  98. package/build/types/tracing/openai/constants.d.ts +14 -1
  99. package/build/types/tracing/openai/constants.d.ts.map +1 -1
  100. package/build/types/tracing/openai/index.d.ts.map +1 -1
  101. package/build/types/tracing/openai/types.d.ts +5 -2
  102. package/build/types/tracing/openai/types.d.ts.map +1 -1
  103. package/build/types/tracing/openai/utils.d.ts +1 -15
  104. package/build/types/tracing/openai/utils.d.ts.map +1 -1
  105. package/build/types/tracing/trace.d.ts.map +1 -1
  106. package/build/types/utils/traceData.d.ts +4 -0
  107. package/build/types/utils/traceData.d.ts.map +1 -1
  108. package/build/types-ts3.8/api.d.ts +1 -0
  109. package/build/types-ts3.8/asyncContext/types.d.ts +3 -1
  110. package/build/types-ts3.8/currentScopes.d.ts +20 -0
  111. package/build/types-ts3.8/index.d.ts +3 -2
  112. package/build/types-ts3.8/tracing/ai/gen-ai-attributes.d.ts +0 -8
  113. package/build/types-ts3.8/tracing/ai/utils.d.ts +15 -9
  114. package/build/types-ts3.8/tracing/anthropic-ai/constants.d.ts +24 -9
  115. package/build/types-ts3.8/tracing/anthropic-ai/types.d.ts +5 -2
  116. package/build/types-ts3.8/tracing/anthropic-ai/utils.d.ts +1 -5
  117. package/build/types-ts3.8/tracing/google-genai/constants.d.ts +22 -7
  118. package/build/types-ts3.8/tracing/google-genai/types.d.ts +6 -2
  119. package/build/types-ts3.8/tracing/google-genai/utils.d.ts +0 -9
  120. package/build/types-ts3.8/tracing/openai/constants.d.ts +14 -6
  121. package/build/types-ts3.8/tracing/openai/types.d.ts +5 -2
  122. package/build/types-ts3.8/tracing/openai/utils.d.ts +1 -15
  123. package/build/types-ts3.8/utils/traceData.d.ts +4 -0
  124. package/package.json +1 -1
@@ -1,19 +1,5 @@
1
1
  import type { Span } from '../../types-hoist/span';
2
- import type { ChatCompletionChunk, InstrumentedMethod, OpenAiChatCompletionObject, OpenAIConversationObject, OpenAICreateEmbeddingsObject, OpenAIResponseObject, ResponseStreamingEvent } from './types';
3
- /**
4
- * Maps OpenAI method paths to OpenTelemetry semantic convention operation names
5
- * @see https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/#llm-request-spans
6
- */
7
- export declare function getOperationName(methodPath: string): string;
8
- /**
9
- * Get the span operation for OpenAI methods
10
- * Following Sentry's convention: "gen_ai.{operation_name}"
11
- */
12
- export declare function getSpanOperation(methodPath: string): string;
13
- /**
14
- * Check if a method path should be instrumented
15
- */
16
- export declare function shouldInstrument(methodPath: string): methodPath is InstrumentedMethod;
2
+ import type { ChatCompletionChunk, OpenAiChatCompletionObject, OpenAIConversationObject, OpenAICreateEmbeddingsObject, OpenAIResponseObject, ResponseStreamingEvent } from './types';
17
3
  /**
18
4
  * Check if response is a Chat Completion object
19
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/tracing/openai/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AA0BnD,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAc3D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,IAAI,kBAAkB,CAErF;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,0BAA0B,CAOlG;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,oBAAoB,CAO1F;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,4BAA4B,CAUhG;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,wBAAwB,CAO9F;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,sBAAsB,CAQzF;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;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,EAC7B,SAAS;IACP,WAAW,EAAE,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC,CAAC,CAAC,CAAC;IACjE,OAAO,EAAE,UAAU,CAAC,OAAO,6BAA6B,CAAC,CAAC,CAAC,CAAC,CAAC;CAC9D,EACD,UAAU,MAAM,CAAC,KAChB,CAqBF,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,CAAC,GAAG,CAAC,CAUrF;AAED,4FAA4F;AAC5F,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAkBvD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAcrD"}
@@ -10,6 +10,10 @@ import type { 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
  *
@@ -1 +1 @@
1
- {"version":3,"file":"traceData.d.ts","sourceRoot":"","sources":["../../../src/utils/traceData.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAMlE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC1B,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC5F,mBAAmB,CAkCrB"}
1
+ {"version":3,"file":"traceData.d.ts","sourceRoot":"","sources":["../../../src/utils/traceData.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGxC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAMlE;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,GAAE;IAAE,IAAI,CAAC,EAAE,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAAO,GAC5F,mBAAmB,CAyCrB"}
@@ -1,6 +1,7 @@
1
1
  import { ReportDialogOptions } from './report-dialog';
2
2
  import { DsnComponents, DsnLike } from './types-hoist/dsn';
3
3
  import { SdkInfo } from './types-hoist/sdkinfo';
4
+ export declare const SENTRY_API_VERSION = "7";
4
5
  /**
5
6
  * Returns the envelope endpoint URL with auth in the query string.
6
7
  *
@@ -1,6 +1,6 @@
1
1
  import { Scope } from '../scope';
2
2
  import { getTraceData } from '../utils/traceData';
3
- import { continueTrace, startInactiveSpan, startSpan, startSpanManual, suppressTracing, withActiveSpan } from './../tracing/trace';
3
+ import { continueTrace, startInactiveSpan, startNewTrace, startSpan, startSpanManual, suppressTracing, withActiveSpan } from './../tracing/trace';
4
4
  import { getActiveSpan } from './../utils/spanUtils';
5
5
  /**
6
6
  * @private Private API with no semver guarantees!
@@ -52,5 +52,7 @@ export interface AsyncContextStrategy {
52
52
  * and `<meta name="baggage">` HTML tags.
53
53
  */
54
54
  continueTrace?: typeof continueTrace;
55
+ /** Start a new trace, ensuring all spans in the callback share the same traceId. */
56
+ startNewTrace?: typeof startNewTrace;
55
57
  }
56
58
  //# sourceMappingURL=types.d.ts.map
@@ -1,6 +1,26 @@
1
1
  import { Client } from './client';
2
2
  import { Scope } from './scope';
3
3
  import { TraceContext } from './types-hoist/context';
4
+ /**
5
+ * Register an external propagation context provider function.
6
+ * When registered, trace context will be read from the external source (e.g. OpenTelemetry)
7
+ * instead of from the Sentry scope's propagation context.
8
+ */
9
+ export declare function registerExternalPropagationContext(fn: () => {
10
+ traceId: string;
11
+ spanId: string;
12
+ } | undefined): void;
13
+ /**
14
+ * Get the external propagation context, if a provider has been registered.
15
+ */
16
+ export declare function getExternalPropagationContext(): {
17
+ traceId: string;
18
+ spanId: string;
19
+ } | undefined;
20
+ /**
21
+ * Check if an external propagation context provider has been registered.
22
+ */
23
+ export declare function hasExternalPropagationContext(): boolean;
4
24
  /**
5
25
  * Get the currently active scope.
6
26
  */
@@ -8,7 +8,7 @@ export * from './tracing';
8
8
  export * from './semanticAttributes';
9
9
  export { createEventEnvelope, createSessionEnvelope, createSpanEnvelope } from './envelope';
10
10
  export { captureCheckIn, withMonitor, captureException, captureEvent, captureMessage, lastEventId, close, flush, setContext, setExtra, setExtras, setTag, setTags, setUser, setConversationId, isInitialized, isEnabled, startSession, endSession, captureSession, addEventProcessor, } from './exports';
11
- export { getCurrentScope, getIsolationScope, getGlobalScope, withScope, withIsolationScope, getClient, getTraceContextFromScope, } from './currentScopes';
11
+ export { getCurrentScope, getIsolationScope, getGlobalScope, withScope, withIsolationScope, getClient, getTraceContextFromScope, registerExternalPropagationContext, getExternalPropagationContext, hasExternalPropagationContext, } from './currentScopes';
12
12
  export { getDefaultCurrentScope, getDefaultIsolationScope } from './defaultScopes';
13
13
  export { setAsyncContextStrategy } from './asyncContext';
14
14
  export { getGlobalSingleton, getMainCarrier } from './carrier';
@@ -16,7 +16,7 @@ export { makeSession, closeSession, updateSession } from './session';
16
16
  export { Scope } from './scope';
17
17
  export { CaptureContext, ScopeContext, ScopeData } from './scope';
18
18
  export { notifyEventProcessors } from './eventProcessors';
19
- export { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint } from './api';
19
+ export { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint, SENTRY_API_VERSION } from './api';
20
20
  export { Client } from './client';
21
21
  export { ServerRuntimeClient } from './server-runtime-client';
22
22
  export { initAndBind, setCurrentClient } from './sdk';
@@ -208,4 +208,5 @@ export { LegacyCSPReport } from './types-hoist/csp';
208
208
  export { SerializedLog, SerializedLogContainer } from './types-hoist/log';
209
209
  export { BuildTimeOptionsBase, UnstableVitePluginOptions, UnstableRollupPluginOptions, UnstableWebpackPluginOptions, } from './build-time-plugins/buildTimeOptionsBase';
210
210
  export { withRandomSafeContext as _INTERNAL_withRandomSafeContext, RandomSafeContextRunner as _INTERNAL_RandomSafeContextRunner, safeMathRandom as _INTERNAL_safeMathRandom, safeDateNow as _INTERNAL_safeDateNow } from './utils/randomSafeContext';
211
+ export { safeUnref as _INTERNAL_safeUnref } from './utils/timer';
211
212
  //# sourceMappingURL=index.d.ts.map
@@ -246,14 +246,6 @@ export declare const OPENAI_USAGE_COMPLETION_TOKENS_ATTRIBUTE = "openai.usage.co
246
246
  * The number of prompt tokens used
247
247
  */
248
248
  export declare const OPENAI_USAGE_PROMPT_TOKENS_ATTRIBUTE = "openai.usage.prompt_tokens";
249
- /**
250
- * OpenAI API operations following OpenTelemetry semantic conventions
251
- * @see https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/#llm-request-spans
252
- */
253
- export declare const OPENAI_OPERATIONS: {
254
- readonly CHAT: "chat";
255
- readonly EMBEDDINGS: "embeddings";
256
- };
257
249
  /**
258
250
  * The response timestamp from Anthropic AI (ISO string)
259
251
  */
@@ -4,20 +4,26 @@ export interface AIRecordingOptions {
4
4
  recordOutputs?: boolean;
5
5
  }
6
6
  /**
7
- * Resolves AI recording options by falling back to the client's `sendDefaultPii` setting.
8
- * Precedence: explicit option > sendDefaultPii > false
7
+ * A method registry entry describes a single instrumented method:
8
+ * which gen_ai operation it maps to and whether it is intrinsically streaming.
9
9
  */
10
- export declare function resolveAIRecordingOptions<T extends AIRecordingOptions>(options?: T): T & Required<AIRecordingOptions>;
10
+ export interface InstrumentedMethodEntry {
11
+ /** Operation name (e.g. 'chat', 'embeddings', 'generate_content') */
12
+ operation: string;
13
+ /** True if the method itself is always streaming (not param-based) */
14
+ streaming?: boolean;
15
+ }
11
16
  /**
12
- * Maps AI method paths to OpenTelemetry semantic convention operation names
13
- * @see https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/#llm-request-spans
17
+ * Maps method paths to their registry entries.
18
+ * Used by proxy-based AI client instrumentations to determine which methods
19
+ * to instrument, what operation name to use, and whether they stream.
14
20
  */
15
- export declare function getFinalOperationName(methodPath: string): string;
21
+ export type InstrumentedMethodRegistry = Record<string, InstrumentedMethodEntry>;
16
22
  /**
17
- * Get the span operation for AI methods
18
- * Following Sentry's convention: "gen_ai.{operation_name}"
23
+ * Resolves AI recording options by falling back to the client's `sendDefaultPii` setting.
24
+ * Precedence: explicit option > sendDefaultPii > false
19
25
  */
20
- export declare function getSpanOperation(methodPath: string): string;
26
+ export declare function resolveAIRecordingOptions<T extends AIRecordingOptions>(options?: T): T & Required<AIRecordingOptions>;
21
27
  /**
22
28
  * Build method path from current traversal
23
29
  */
@@ -1,11 +1,26 @@
1
1
  export declare const ANTHROPIC_AI_INTEGRATION_NAME = "Anthropic_AI";
2
- export declare const ANTHROPIC_AI_INSTRUMENTED_METHODS: readonly [
3
- "messages.create",
4
- "messages.stream",
5
- "messages.countTokens",
6
- "models.get",
7
- "completions.create",
8
- "models.retrieve",
9
- "beta.messages.create"
10
- ];
2
+ export declare const ANTHROPIC_METHOD_REGISTRY: {
3
+ readonly 'messages.create': {
4
+ readonly operation: "chat";
5
+ };
6
+ readonly 'messages.stream': {
7
+ readonly operation: "chat";
8
+ readonly streaming: true;
9
+ };
10
+ readonly 'messages.countTokens': {
11
+ readonly operation: "chat";
12
+ };
13
+ readonly 'models.get': {
14
+ readonly operation: "models";
15
+ };
16
+ readonly 'completions.create': {
17
+ readonly operation: "chat";
18
+ };
19
+ readonly 'models.retrieve': {
20
+ readonly operation: "models";
21
+ };
22
+ readonly 'beta.messages.create': {
23
+ readonly operation: "chat";
24
+ };
25
+ };
11
26
  //# sourceMappingURL=constants.d.ts.map
@@ -1,4 +1,4 @@
1
- import { ANTHROPIC_AI_INSTRUMENTED_METHODS } from './constants';
1
+ import { ANTHROPIC_METHOD_REGISTRY } from './constants';
2
2
  export interface AnthropicAiOptions {
3
3
  /**
4
4
  * Enable or disable input recording.
@@ -74,7 +74,10 @@ export interface AnthropicAiIntegration {
74
74
  name: string;
75
75
  options: AnthropicAiOptions;
76
76
  }
77
- export type AnthropicAiInstrumentedMethod = (typeof ANTHROPIC_AI_INSTRUMENTED_METHODS)[number];
77
+ /**
78
+ * @deprecated This type is no longer used and will be removed in the next major version.
79
+ */
80
+ export type AnthropicAiInstrumentedMethod = keyof typeof ANTHROPIC_METHOD_REGISTRY;
78
81
  /**
79
82
  * Message type for Anthropic AI
80
83
  */
@@ -1,10 +1,6 @@
1
1
  import { Span } from '../../types-hoist/span';
2
2
  import { SpanStatusType } from '../../types-hoist/spanStatus';
3
- import { AnthropicAiInstrumentedMethod, AnthropicAiResponse } from './types';
4
- /**
5
- * Check if a method path should be instrumented
6
- */
7
- export declare function shouldInstrument(methodPath: string): methodPath is AnthropicAiInstrumentedMethod;
3
+ import { AnthropicAiResponse } from './types';
8
4
  /**
9
5
  * Set the messages and messages original length attributes.
10
6
  * Extracts system instructions before truncation.
@@ -1,11 +1,26 @@
1
1
  export declare const GOOGLE_GENAI_INTEGRATION_NAME = "Google_GenAI";
2
- export declare const GOOGLE_GENAI_INSTRUMENTED_METHODS: readonly [
3
- "models.generateContent",
4
- "models.generateContentStream",
5
- "chats.create",
6
- "sendMessage",
7
- "sendMessageStream"
8
- ];
2
+ export declare const GOOGLE_GENAI_METHOD_REGISTRY: {
3
+ readonly 'models.generateContent': {
4
+ readonly operation: "generate_content";
5
+ };
6
+ readonly 'models.generateContentStream': {
7
+ readonly operation: "generate_content";
8
+ readonly streaming: true;
9
+ };
10
+ readonly 'models.embedContent': {
11
+ readonly operation: "embeddings";
12
+ };
13
+ readonly 'chats.create': {
14
+ readonly operation: "chat";
15
+ };
16
+ readonly 'chat.sendMessage': {
17
+ readonly operation: "chat";
18
+ };
19
+ readonly 'chat.sendMessageStream': {
20
+ readonly operation: "chat";
21
+ readonly streaming: true;
22
+ };
23
+ };
9
24
  export declare const GOOGLE_GENAI_SYSTEM_NAME = "google_genai";
10
25
  export declare const CHATS_CREATE_METHOD = "chats.create";
11
26
  export declare const CHAT_PATH = "chat";
@@ -1,4 +1,4 @@
1
- import { GOOGLE_GENAI_INSTRUMENTED_METHODS } from './constants';
1
+ import { GOOGLE_GENAI_METHOD_REGISTRY } from './constants';
2
2
  export interface GoogleGenAIOptions {
3
3
  /**
4
4
  * Enable or disable input recording.
@@ -152,6 +152,7 @@ export interface GoogleGenAIClient {
152
152
  models: {
153
153
  generateContent: (...args: unknown[]) => Promise<GenerateContentResponse>;
154
154
  generateContentStream: (...args: unknown[]) => Promise<AsyncGenerator<GenerateContentResponse, any, unknown>>;
155
+ embedContent: (...args: unknown[]) => Promise<unknown>;
155
156
  };
156
157
  chats: {
157
158
  create: (...args: unknown[]) => GoogleGenAIChat;
@@ -164,7 +165,10 @@ export interface GoogleGenAIChat {
164
165
  sendMessage: (...args: unknown[]) => Promise<GenerateContentResponse>;
165
166
  sendMessageStream: (...args: unknown[]) => Promise<AsyncGenerator<GenerateContentResponse, any, unknown>>;
166
167
  }
167
- export type GoogleGenAIIstrumentedMethod = (typeof GOOGLE_GENAI_INSTRUMENTED_METHODS)[number];
168
+ /**
169
+ * @deprecated This type is no longer used and will be removed in the next major version.
170
+ */
171
+ export type GoogleGenAIIstrumentedMethod = keyof typeof GOOGLE_GENAI_METHOD_REGISTRY;
168
172
  export type GoogleGenAIResponse = GenerateContentResponse;
169
173
  export {};
170
174
  //# sourceMappingURL=types.d.ts.map
@@ -1,12 +1,3 @@
1
- import { GoogleGenAIIstrumentedMethod } from './types';
2
- /**
3
- * Check if a method path should be instrumented
4
- */
5
- export declare function shouldInstrument(methodPath: string): methodPath is GoogleGenAIIstrumentedMethod;
6
- /**
7
- * Check if a method is a streaming method
8
- */
9
- export declare function isStreamingMethod(methodPath: string): boolean;
10
1
  export type ContentListUnion = Content | Content[] | PartListUnion;
11
2
  export type ContentUnion = Content | PartUnion[] | PartUnion;
12
3
  export type Content = {
@@ -1,10 +1,18 @@
1
1
  export declare const OPENAI_INTEGRATION_NAME = "OpenAI";
2
- export declare const INSTRUMENTED_METHODS: readonly [
3
- "responses.create",
4
- "chat.completions.create",
5
- "embeddings.create",
6
- "conversations.create"
7
- ];
2
+ export declare const OPENAI_METHOD_REGISTRY: {
3
+ readonly 'responses.create': {
4
+ readonly operation: "chat";
5
+ };
6
+ readonly 'chat.completions.create': {
7
+ readonly operation: "chat";
8
+ };
9
+ readonly 'embeddings.create': {
10
+ readonly operation: "embeddings";
11
+ };
12
+ readonly 'conversations.create': {
13
+ readonly operation: "chat";
14
+ };
15
+ };
8
16
  export declare const RESPONSES_TOOL_CALL_EVENT_TYPES: readonly [
9
17
  "response.output_item.added",
10
18
  "response.function_call_arguments.delta",
@@ -1,4 +1,4 @@
1
- import { INSTRUMENTED_METHODS } from './constants';
1
+ import { OPENAI_METHOD_REGISTRY } from './constants';
2
2
  /**
3
3
  * Attribute values may be any non-nullish primitive value except an object.
4
4
  *
@@ -313,6 +313,9 @@ export interface OpenAiIntegration {
313
313
  name: string;
314
314
  options: OpenAiOptions;
315
315
  }
316
- export type InstrumentedMethod = (typeof INSTRUMENTED_METHODS)[number];
316
+ /**
317
+ * @deprecated This type is no longer used and will be removed in the next major version.
318
+ */
319
+ export type InstrumentedMethod = keyof typeof OPENAI_METHOD_REGISTRY;
317
320
  export {};
318
321
  //# sourceMappingURL=types.d.ts.map
@@ -1,19 +1,5 @@
1
1
  import { Span } from '../../types-hoist/span';
2
- import { ChatCompletionChunk, InstrumentedMethod, OpenAiChatCompletionObject, OpenAIConversationObject, OpenAICreateEmbeddingsObject, OpenAIResponseObject, ResponseStreamingEvent } from './types';
3
- /**
4
- * Maps OpenAI method paths to OpenTelemetry semantic convention operation names
5
- * @see https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/#llm-request-spans
6
- */
7
- export declare function getOperationName(methodPath: string): string;
8
- /**
9
- * Get the span operation for OpenAI methods
10
- * Following Sentry's convention: "gen_ai.{operation_name}"
11
- */
12
- export declare function getSpanOperation(methodPath: string): string;
13
- /**
14
- * Check if a method path should be instrumented
15
- */
16
- export declare function shouldInstrument(methodPath: string): methodPath is InstrumentedMethod;
2
+ import { ChatCompletionChunk, OpenAiChatCompletionObject, OpenAIConversationObject, OpenAICreateEmbeddingsObject, OpenAIResponseObject, ResponseStreamingEvent } from './types';
17
3
  /**
18
4
  * Check if response is a Chat Completion object
19
5
  */
@@ -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.46.0",
3
+ "version": "10.47.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",