@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.
- package/build/cjs/api.js +1 -0
- package/build/cjs/api.js.map +1 -1
- package/build/cjs/currentScopes.js +33 -0
- package/build/cjs/currentScopes.js.map +1 -1
- package/build/cjs/index.js +6 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/integrations/supabase.js +1 -1
- package/build/cjs/integrations/supabase.js.map +1 -1
- package/build/cjs/tracing/ai/gen-ai-attributes.js +0 -14
- package/build/cjs/tracing/ai/gen-ai-attributes.js.map +1 -1
- package/build/cjs/tracing/ai/utils.js +0 -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 -9
- package/build/cjs/tracing/anthropic-ai/index.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/google-genai/constants.js +10 -8
- package/build/cjs/tracing/google-genai/constants.js.map +1 -1
- package/build/cjs/tracing/google-genai/index.js +44 -16
- package/build/cjs/tracing/google-genai/index.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/openai/constants.js +7 -7
- package/build/cjs/tracing/openai/constants.js.map +1 -1
- package/build/cjs/tracing/openai/index.js +18 -9
- package/build/cjs/tracing/openai/index.js.map +1 -1
- package/build/cjs/tracing/openai/utils.js +0 -39
- package/build/cjs/tracing/openai/utils.js.map +1 -1
- package/build/cjs/tracing/trace.js +5 -0
- package/build/cjs/tracing/trace.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/currentScopes.js +31 -1
- package/build/esm/currentScopes.js.map +1 -1
- package/build/esm/index.js +3 -2
- package/build/esm/index.js.map +1 -1
- 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/tracing/ai/gen-ai-attributes.js +1 -14
- package/build/esm/tracing/ai/gen-ai-attributes.js.map +1 -1
- package/build/esm/tracing/ai/utils.js +1 -34
- 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 -12
- package/build/esm/tracing/anthropic-ai/index.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/google-genai/constants.js +10 -8
- package/build/esm/tracing/google-genai/constants.js.map +1 -1
- package/build/esm/tracing/google-genai/index.js +48 -20
- package/build/esm/tracing/google-genai/index.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/openai/constants.js +7 -7
- package/build/esm/tracing/openai/constants.js.map +1 -1
- package/build/esm/tracing/openai/index.js +21 -12
- package/build/esm/tracing/openai/index.js.map +1 -1
- package/build/esm/tracing/openai/utils.js +2 -38
- package/build/esm/tracing/openai/utils.js.map +1 -1
- package/build/esm/tracing/trace.js +5 -0
- package/build/esm/tracing/trace.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/currentScopes.d.ts +20 -0
- package/build/types/currentScopes.d.ts.map +1 -1
- package/build/types/index.d.ts +3 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/tracing/ai/gen-ai-attributes.d.ts +0 -8
- package/build/types/tracing/ai/gen-ai-attributes.d.ts.map +1 -1
- package/build/types/tracing/ai/utils.d.ts +15 -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/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/google-genai/constants.d.ts +22 -1
- 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/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/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/types.d.ts +5 -2
- package/build/types/tracing/openai/types.d.ts.map +1 -1
- package/build/types/tracing/openai/utils.d.ts +1 -15
- package/build/types/tracing/openai/utils.d.ts.map +1 -1
- package/build/types/tracing/trace.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/currentScopes.d.ts +20 -0
- package/build/types-ts3.8/index.d.ts +3 -2
- package/build/types-ts3.8/tracing/ai/gen-ai-attributes.d.ts +0 -8
- package/build/types-ts3.8/tracing/ai/utils.d.ts +15 -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 -7
- 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/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 +1 -15
- package/build/types-ts3.8/utils/traceData.d.ts +4 -0
- package/package.json +1 -1
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import type { Span } from '../../types-hoist/span';
|
|
2
|
-
import type { ChatCompletionChunk,
|
|
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;
|
|
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;AAwBnD,OAAO,KAAK,EACV,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,4BAA4B,EAC5B,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAEjB;;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;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,mBAAmB,CAOlF;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,0BAA0B,EACpC,aAAa,CAAC,EAAE,OAAO,GACtB,IAAI,CAkCN;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,oBAAoB,EAAE,aAAa,CAAC,EAAE,OAAO,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,gBAAgB,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,GAAG,CAAC,CAgDtF;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CA+ChH;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAkCjE;AAED;;;;;;;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
|
|
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
|
-
*
|
|
8
|
-
*
|
|
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
|
|
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
|
|
13
|
-
*
|
|
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
|
|
21
|
+
export type InstrumentedMethodRegistry = Record<string, InstrumentedMethodEntry>;
|
|
16
22
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
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
|
|
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
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 {
|
|
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
|
-
|
|
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 {
|
|
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
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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 {
|
|
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
|
-
|
|
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
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 {
|
|
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
|
-
|
|
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,
|
|
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.
|
|
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",
|