@sentry/core 10.39.0-alpha.0 → 10.40.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.map +1 -1
- package/build/cjs/client.js +7 -13
- package/build/cjs/client.js.map +1 -1
- package/build/cjs/envelope.js +7 -41
- package/build/cjs/envelope.js.map +1 -1
- package/build/cjs/exports.js +4 -2
- package/build/cjs/exports.js.map +1 -1
- package/build/cjs/fetch.js +8 -4
- package/build/cjs/fetch.js.map +1 -1
- package/build/cjs/index.js +3 -48
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/integration.js +0 -12
- package/build/cjs/integration.js.map +1 -1
- package/build/cjs/integrations/eventFilters.js +1 -1
- package/build/cjs/integrations/eventFilters.js.map +1 -1
- package/build/cjs/integrations/requestdata.js +6 -72
- package/build/cjs/integrations/requestdata.js.map +1 -1
- package/build/cjs/semanticAttributes.js +0 -84
- package/build/cjs/semanticAttributes.js.map +1 -1
- package/build/cjs/tracing/langgraph/index.js +1 -1
- package/build/cjs/tracing/langgraph/index.js.map +1 -1
- package/build/cjs/tracing/sentrySpan.js +0 -32
- package/build/cjs/tracing/sentrySpan.js.map +1 -1
- package/build/cjs/tracing/trace.js +0 -1
- package/build/cjs/tracing/trace.js.map +1 -1
- package/build/cjs/tracing/vercel-ai/index.js +0 -1
- package/build/cjs/tracing/vercel-ai/index.js.map +1 -1
- package/build/cjs/utils/featureFlags.js +0 -1
- package/build/cjs/utils/featureFlags.js.map +1 -1
- package/build/cjs/utils/misc.js +7 -0
- package/build/cjs/utils/misc.js.map +1 -1
- package/build/cjs/utils/node-stack-trace.js +11 -2
- package/build/cjs/utils/node-stack-trace.js.map +1 -1
- package/build/cjs/utils/scopeData.js +0 -4
- package/build/cjs/utils/scopeData.js.map +1 -1
- package/build/cjs/utils/should-ignore-span.js +9 -31
- package/build/cjs/utils/should-ignore-span.js.map +1 -1
- package/build/cjs/utils/spanUtils.js +2 -90
- package/build/cjs/utils/spanUtils.js.map +1 -1
- package/build/cjs/utils/tunnel.js +74 -0
- package/build/cjs/utils/tunnel.js.map +1 -0
- package/build/cjs/utils/version.js +1 -1
- package/build/cjs/utils/version.js.map +1 -1
- package/build/cjs/utils/worldwide.js.map +1 -1
- package/build/esm/attributes.js.map +1 -1
- package/build/esm/client.js +3 -9
- package/build/esm/client.js.map +1 -1
- package/build/esm/envelope.js +8 -41
- package/build/esm/envelope.js.map +1 -1
- package/build/esm/exports.js +4 -2
- package/build/esm/exports.js.map +1 -1
- package/build/esm/fetch.js +8 -4
- package/build/esm/fetch.js.map +1 -1
- package/build/esm/index.js +5 -11
- package/build/esm/index.js.map +1 -1
- package/build/esm/integration.js +1 -12
- package/build/esm/integration.js.map +1 -1
- package/build/esm/integrations/eventFilters.js +1 -1
- package/build/esm/integrations/eventFilters.js.map +1 -1
- package/build/esm/integrations/requestdata.js +6 -72
- package/build/esm/integrations/requestdata.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/semanticAttributes.js +1 -57
- package/build/esm/semanticAttributes.js.map +1 -1
- package/build/esm/tracing/langgraph/index.js +1 -1
- package/build/esm/tracing/langgraph/index.js.map +1 -1
- package/build/esm/tracing/sentrySpan.js +1 -33
- package/build/esm/tracing/sentrySpan.js.map +1 -1
- package/build/esm/tracing/trace.js +0 -1
- package/build/esm/tracing/trace.js.map +1 -1
- package/build/esm/tracing/vercel-ai/index.js +0 -1
- package/build/esm/tracing/vercel-ai/index.js.map +1 -1
- package/build/esm/utils/featureFlags.js +0 -1
- package/build/esm/utils/featureFlags.js.map +1 -1
- package/build/esm/utils/misc.js +7 -1
- package/build/esm/utils/misc.js.map +1 -1
- package/build/esm/utils/node-stack-trace.js +11 -2
- package/build/esm/utils/node-stack-trace.js.map +1 -1
- package/build/esm/utils/scopeData.js +0 -4
- package/build/esm/utils/scopeData.js.map +1 -1
- package/build/esm/utils/should-ignore-span.js +9 -31
- package/build/esm/utils/should-ignore-span.js.map +1 -1
- package/build/esm/utils/spanUtils.js +3 -87
- package/build/esm/utils/spanUtils.js.map +1 -1
- package/build/esm/utils/tunnel.js +72 -0
- package/build/esm/utils/tunnel.js.map +1 -0
- package/build/esm/utils/version.js +1 -1
- package/build/esm/utils/version.js.map +1 -1
- package/build/esm/utils/worldwide.js.map +1 -1
- package/build/types/attributes.d.ts +1 -1
- package/build/types/attributes.d.ts.map +1 -1
- package/build/types/client.d.ts +2 -40
- package/build/types/client.d.ts.map +1 -1
- package/build/types/envelope.d.ts +1 -6
- package/build/types/envelope.d.ts.map +1 -1
- package/build/types/exports.d.ts.map +1 -1
- package/build/types/fetch.d.ts.map +1 -1
- package/build/types/index.d.ts +7 -12
- package/build/types/index.d.ts.map +1 -1
- package/build/types/integration.d.ts +0 -4
- package/build/types/integration.d.ts.map +1 -1
- package/build/types/integrations/requestdata.d.ts.map +1 -1
- package/build/types/semanticAttributes.d.ts +0 -38
- package/build/types/semanticAttributes.d.ts.map +1 -1
- package/build/types/tracing/sentrySpan.d.ts +1 -10
- package/build/types/tracing/sentrySpan.d.ts.map +1 -1
- package/build/types/tracing/vercel-ai/index.d.ts.map +1 -1
- package/build/types/types-hoist/envelope.d.ts +2 -22
- package/build/types/types-hoist/envelope.d.ts.map +1 -1
- package/build/types/types-hoist/integration.d.ts +0 -7
- 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 +2 -18
- package/build/types/types-hoist/options.d.ts.map +1 -1
- package/build/types/types-hoist/span.d.ts +0 -27
- 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/misc.d.ts +7 -0
- package/build/types/utils/misc.d.ts.map +1 -1
- package/build/types/utils/node-stack-trace.d.ts.map +1 -1
- package/build/types/utils/scopeData.d.ts.map +1 -1
- package/build/types/utils/should-ignore-span.d.ts +3 -3
- package/build/types/utils/should-ignore-span.d.ts.map +1 -1
- package/build/types/utils/spanUtils.d.ts +2 -22
- package/build/types/utils/spanUtils.d.ts.map +1 -1
- package/build/types/utils/tunnel.d.ts +16 -0
- package/build/types/utils/tunnel.d.ts.map +1 -0
- package/build/types/utils/worldwide.d.ts +0 -2
- package/build/types/utils/worldwide.d.ts.map +1 -1
- package/build/types-ts3.8/attributes.d.ts +1 -1
- package/build/types-ts3.8/client.d.ts +2 -40
- package/build/types-ts3.8/envelope.d.ts +1 -6
- package/build/types-ts3.8/index.d.ts +7 -12
- package/build/types-ts3.8/integration.d.ts +0 -4
- package/build/types-ts3.8/semanticAttributes.d.ts +0 -38
- package/build/types-ts3.8/tracing/sentrySpan.d.ts +1 -10
- package/build/types-ts3.8/types-hoist/envelope.d.ts +2 -22
- package/build/types-ts3.8/types-hoist/integration.d.ts +0 -7
- package/build/types-ts3.8/types-hoist/link.d.ts +2 -2
- package/build/types-ts3.8/types-hoist/options.d.ts +2 -18
- package/build/types-ts3.8/types-hoist/span.d.ts +0 -27
- package/build/types-ts3.8/utils/misc.d.ts +7 -0
- package/build/types-ts3.8/utils/should-ignore-span.d.ts +3 -3
- package/build/types-ts3.8/utils/spanUtils.d.ts +2 -22
- package/build/types-ts3.8/utils/tunnel.d.ts +16 -0
- package/build/types-ts3.8/utils/worldwide.d.ts +0 -2
- package/package.json +2 -3
- package/build/cjs/integrations/spanStreaming.js +0 -54
- package/build/cjs/integrations/spanStreaming.js.map +0 -1
- package/build/cjs/spans/captureSpan.js +0 -104
- package/build/cjs/spans/captureSpan.js.map +0 -1
- package/build/cjs/spans/spanBuffer.js +0 -121
- package/build/cjs/spans/spanBuffer.js.map +0 -1
- package/build/cjs/spans/spanFirstUtils.js +0 -186
- package/build/cjs/spans/spanFirstUtils.js.map +0 -1
- package/build/cjs/utils/beforeSendSpan.js +0 -36
- package/build/cjs/utils/beforeSendSpan.js.map +0 -1
- package/build/cjs/utils/hasSpanStreamingEnabled.js +0 -21
- package/build/cjs/utils/hasSpanStreamingEnabled.js.map +0 -1
- package/build/esm/integrations/spanStreaming.js +0 -52
- package/build/esm/integrations/spanStreaming.js.map +0 -1
- package/build/esm/spans/captureSpan.js +0 -102
- package/build/esm/spans/captureSpan.js.map +0 -1
- package/build/esm/spans/spanBuffer.js +0 -119
- package/build/esm/spans/spanBuffer.js.map +0 -1
- package/build/esm/spans/spanFirstUtils.js +0 -182
- package/build/esm/spans/spanFirstUtils.js.map +0 -1
- package/build/esm/utils/beforeSendSpan.js +0 -33
- package/build/esm/utils/beforeSendSpan.js.map +0 -1
- package/build/esm/utils/hasSpanStreamingEnabled.js +0 -19
- package/build/esm/utils/hasSpanStreamingEnabled.js.map +0 -1
- package/build/types/integrations/spanStreaming.d.ts +0 -11
- package/build/types/integrations/spanStreaming.d.ts.map +0 -1
- package/build/types/spans/captureSpan.d.ts +0 -10
- package/build/types/spans/captureSpan.d.ts.map +0 -1
- package/build/types/spans/spanBuffer.d.ts +0 -35
- package/build/types/spans/spanBuffer.d.ts.map +0 -1
- package/build/types/spans/spanFirstUtils.d.ts +0 -20
- package/build/types/spans/spanFirstUtils.d.ts.map +0 -1
- package/build/types/types-hoist/attributes.d.ts +0 -19
- package/build/types/types-hoist/attributes.d.ts.map +0 -1
- package/build/types/utils/beforeSendSpan.d.ts +0 -22
- package/build/types/utils/beforeSendSpan.d.ts.map +0 -1
- package/build/types/utils/hasSpanStreamingEnabled.d.ts +0 -9
- package/build/types/utils/hasSpanStreamingEnabled.d.ts.map +0 -1
- package/build/types-ts3.8/integrations/spanStreaming.d.ts +0 -11
- package/build/types-ts3.8/spans/captureSpan.d.ts +0 -10
- package/build/types-ts3.8/spans/spanBuffer.d.ts +0 -35
- package/build/types-ts3.8/spans/spanFirstUtils.d.ts +0 -20
- package/build/types-ts3.8/types-hoist/attributes.d.ts +0 -19
- package/build/types-ts3.8/utils/beforeSendSpan.d.ts +0 -22
- package/build/types-ts3.8/utils/hasSpanStreamingEnabled.d.ts +0 -9
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { isAttributeObject, attributeValueToTypedAttributeValue } from '../attributes.js';
|
|
2
|
-
import { isPrimitive } from '../utils/is.js';
|
|
3
|
-
import { showSpanDropWarning } from '../utils/spanUtils.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Only set a span JSON attribute if it is not already set.
|
|
7
|
-
* This is used to safely set attributes on JSON objects without mutating already-ended span instances.
|
|
8
|
-
*/
|
|
9
|
-
function safeSetSpanJSONAttributes(
|
|
10
|
-
spanJSON,
|
|
11
|
-
newAttributes,
|
|
12
|
-
) {
|
|
13
|
-
if (!spanJSON.attributes) {
|
|
14
|
-
spanJSON.attributes = {};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const originalAttributes = spanJSON.attributes;
|
|
18
|
-
|
|
19
|
-
Object.keys(newAttributes).forEach(key => {
|
|
20
|
-
if (!originalAttributes?.[key]) {
|
|
21
|
-
setAttributeOnSpanJSONWithMaybeUnit(
|
|
22
|
-
// type-casting here because we ensured above that the attributes object exists
|
|
23
|
-
spanJSON ,
|
|
24
|
-
key,
|
|
25
|
-
newAttributes[key],
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Apply a user-provided beforeSendSpan callback to a span JSON.
|
|
33
|
-
*/
|
|
34
|
-
function applyBeforeSendSpanCallback(
|
|
35
|
-
span,
|
|
36
|
-
beforeSendSpan,
|
|
37
|
-
) {
|
|
38
|
-
const modifedSpan = beforeSendSpan(span);
|
|
39
|
-
if (!modifedSpan) {
|
|
40
|
-
showSpanDropWarning();
|
|
41
|
-
return span;
|
|
42
|
-
}
|
|
43
|
-
return modifedSpan;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function setAttributeOnSpanJSONWithMaybeUnit(
|
|
47
|
-
spanJSON,
|
|
48
|
-
attributeKey,
|
|
49
|
-
attributeValue,
|
|
50
|
-
) {
|
|
51
|
-
const { value, unit } = isAttributeObject(attributeValue)
|
|
52
|
-
? attributeValue
|
|
53
|
-
: { value: attributeValue, unit: undefined };
|
|
54
|
-
const typedAttributeValue = attributeValueToTypedAttributeValue(value);
|
|
55
|
-
|
|
56
|
-
if (typedAttributeValue && isSupportedSerializableType(value)) {
|
|
57
|
-
spanJSON.attributes[attributeKey] = typedAttributeValue;
|
|
58
|
-
if (unit) {
|
|
59
|
-
spanJSON.attributes[attributeKey].unit = unit;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function isSupportedSerializableType(value) {
|
|
65
|
-
return ['string', 'number', 'boolean'].includes(typeof value) || Array.isArray(value);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// map of attributes->context keys for those attributes that don't correspond 1:1 to the context key
|
|
69
|
-
const explicitAttributeToContextMapping = {
|
|
70
|
-
'os.build_id': 'os.build',
|
|
71
|
-
'app.name': 'app.app_name',
|
|
72
|
-
'app.identifier': 'app.app_identifier',
|
|
73
|
-
'app.version': 'app.app_version',
|
|
74
|
-
'app.memory': 'app.app_memory',
|
|
75
|
-
'app.start_time': 'app.app_start_time',
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
const knownContexts = [
|
|
79
|
-
// set by `nodeContextIntegration`
|
|
80
|
-
'app',
|
|
81
|
-
'os',
|
|
82
|
-
'device',
|
|
83
|
-
'culture',
|
|
84
|
-
'cloud_resource',
|
|
85
|
-
'runtime',
|
|
86
|
-
|
|
87
|
-
// TODO: These need more thorough checking if they're all setting expected attributes
|
|
88
|
-
|
|
89
|
-
// set by the `instrumentPostgresJs`
|
|
90
|
-
'postgresjsConnection',
|
|
91
|
-
// set by `ensureIsWrapped`
|
|
92
|
-
'missing_instrumentation',
|
|
93
|
-
// set by `nodeProfilingIntegration`
|
|
94
|
-
'profile',
|
|
95
|
-
// set by angular `init`
|
|
96
|
-
'angular',
|
|
97
|
-
// set by AWS Lambda SDK
|
|
98
|
-
'aws.lambda',
|
|
99
|
-
'aws.cloudwatch.logs',
|
|
100
|
-
// set by `instrumentBunServe`
|
|
101
|
-
'response',
|
|
102
|
-
// set by `trpcMiddleware`
|
|
103
|
-
'trpc',
|
|
104
|
-
// set by `instrumentSupabaseClient`
|
|
105
|
-
'supabase',
|
|
106
|
-
// set by `gcp.function.context`
|
|
107
|
-
'gcp.function.context',
|
|
108
|
-
// set by nextjs SDK
|
|
109
|
-
'nextjs',
|
|
110
|
-
// set by react SDK `captureReactException`, `init`
|
|
111
|
-
'react',
|
|
112
|
-
// set by react SDK `createReduxEnhancer`
|
|
113
|
-
'state',
|
|
114
|
-
// set by `replayIntegration`
|
|
115
|
-
'Replays',
|
|
116
|
-
// Other information:
|
|
117
|
-
// - no need to handler feature flags `flags` context because it's already added to the active span
|
|
118
|
-
];
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Converts a context object to a set of attributes.
|
|
122
|
-
* Only includes attributes that are primitives (for now).
|
|
123
|
-
* @param contexts - The context object to convert.
|
|
124
|
-
* @returns The attributes object.
|
|
125
|
-
*/
|
|
126
|
-
function contextsToAttributes(contexts) {
|
|
127
|
-
function contextToAttribute(context) {
|
|
128
|
-
return Object.keys(context).reduce(
|
|
129
|
-
(acc, key) => {
|
|
130
|
-
if (!isPrimitive(context[key])) {
|
|
131
|
-
return acc;
|
|
132
|
-
}
|
|
133
|
-
acc[key] = context[key];
|
|
134
|
-
return acc;
|
|
135
|
-
},
|
|
136
|
-
{} ,
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
const contextsWithPrimitiveValues = Object.keys(contexts).reduce((acc, key) => {
|
|
141
|
-
if (!knownContexts.includes(key)) {
|
|
142
|
-
return acc;
|
|
143
|
-
}
|
|
144
|
-
const context = contexts[key];
|
|
145
|
-
if (context) {
|
|
146
|
-
acc[key] = contextToAttribute(context);
|
|
147
|
-
}
|
|
148
|
-
return acc;
|
|
149
|
-
}, {} );
|
|
150
|
-
|
|
151
|
-
const explicitlyMappedAttributes = Object.entries(explicitAttributeToContextMapping).reduce(
|
|
152
|
-
(acc, [attributeKey, contextKey]) => {
|
|
153
|
-
const [contextName, contextValueKey] = contextKey.split('.');
|
|
154
|
-
if (contextName && contextValueKey && contextsWithPrimitiveValues[contextName]?.[contextValueKey]) {
|
|
155
|
-
acc[attributeKey] = contextsWithPrimitiveValues[contextName]?.[contextValueKey];
|
|
156
|
-
// now we delete this key from `contextsWithPrimitiveValues` so we don't include it in the next step
|
|
157
|
-
delete contextsWithPrimitiveValues[contextName]?.[contextValueKey];
|
|
158
|
-
}
|
|
159
|
-
return acc;
|
|
160
|
-
},
|
|
161
|
-
{} ,
|
|
162
|
-
);
|
|
163
|
-
|
|
164
|
-
return {
|
|
165
|
-
...explicitlyMappedAttributes,
|
|
166
|
-
...Object.entries(contextsWithPrimitiveValues).reduce(
|
|
167
|
-
(acc, [contextName, contextObj]) => {
|
|
168
|
-
contextObj &&
|
|
169
|
-
Object.entries(contextObj).forEach(([key, value]) => {
|
|
170
|
-
if (value) {
|
|
171
|
-
acc[`${contextName}.${key}`] = value;
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
return acc;
|
|
175
|
-
},
|
|
176
|
-
{} ,
|
|
177
|
-
),
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
export { applyBeforeSendSpanCallback, contextsToAttributes, safeSetSpanJSONAttributes };
|
|
182
|
-
//# sourceMappingURL=spanFirstUtils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spanFirstUtils.js","sources":["../../../src/spans/spanFirstUtils.ts"],"sourcesContent":["import type { RawAttributes } from '../attributes';\nimport { attributeValueToTypedAttributeValue, isAttributeObject } from '../attributes';\nimport type { Context, Contexts } from '../types-hoist/context';\nimport type { SpanV2JSON } from '../types-hoist/span';\nimport { isPrimitive } from '../utils/is';\nimport { showSpanDropWarning } from '../utils/spanUtils';\n\n/**\n * Only set a span JSON attribute if it is not already set.\n * This is used to safely set attributes on JSON objects without mutating already-ended span instances.\n */\nexport function safeSetSpanJSONAttributes(\n spanJSON: SpanV2JSON,\n newAttributes: RawAttributes<Record<string, unknown>>,\n): void {\n if (!spanJSON.attributes) {\n spanJSON.attributes = {};\n }\n\n const originalAttributes = spanJSON.attributes;\n\n Object.keys(newAttributes).forEach(key => {\n if (!originalAttributes?.[key]) {\n setAttributeOnSpanJSONWithMaybeUnit(\n // type-casting here because we ensured above that the attributes object exists\n spanJSON as SpanV2JSON & Required<Pick<SpanV2JSON, 'attributes'>>,\n key,\n newAttributes[key],\n );\n }\n });\n}\n\n/**\n * Apply a user-provided beforeSendSpan callback to a span JSON.\n */\nexport function applyBeforeSendSpanCallback(\n span: SpanV2JSON,\n beforeSendSpan: (span: SpanV2JSON) => SpanV2JSON,\n): SpanV2JSON {\n const modifedSpan = beforeSendSpan(span);\n if (!modifedSpan) {\n showSpanDropWarning();\n return span;\n }\n return modifedSpan;\n}\n\nfunction setAttributeOnSpanJSONWithMaybeUnit(\n spanJSON: SpanV2JSON & Required<Pick<SpanV2JSON, 'attributes'>>,\n attributeKey: string,\n attributeValue: unknown,\n): void {\n const { value, unit } = isAttributeObject(attributeValue)\n ? attributeValue\n : { value: attributeValue, unit: undefined };\n const typedAttributeValue = attributeValueToTypedAttributeValue(value);\n\n if (typedAttributeValue && isSupportedSerializableType(value)) {\n spanJSON.attributes[attributeKey] = typedAttributeValue;\n if (unit) {\n spanJSON.attributes[attributeKey].unit = unit;\n }\n }\n}\n\nfunction isSupportedSerializableType(value: unknown): boolean {\n return ['string', 'number', 'boolean'].includes(typeof value) || Array.isArray(value);\n}\n\n// map of attributes->context keys for those attributes that don't correspond 1:1 to the context key\nconst explicitAttributeToContextMapping = {\n 'os.build_id': 'os.build',\n 'app.name': 'app.app_name',\n 'app.identifier': 'app.app_identifier',\n 'app.version': 'app.app_version',\n 'app.memory': 'app.app_memory',\n 'app.start_time': 'app.app_start_time',\n};\n\nconst knownContexts = [\n // set by `nodeContextIntegration`\n 'app',\n 'os',\n 'device',\n 'culture',\n 'cloud_resource',\n 'runtime',\n\n // TODO: These need more thorough checking if they're all setting expected attributes\n\n // set by the `instrumentPostgresJs`\n 'postgresjsConnection',\n // set by `ensureIsWrapped`\n 'missing_instrumentation',\n // set by `nodeProfilingIntegration`\n 'profile',\n // set by angular `init`\n 'angular',\n // set by AWS Lambda SDK\n 'aws.lambda',\n 'aws.cloudwatch.logs',\n // set by `instrumentBunServe`\n 'response',\n // set by `trpcMiddleware`\n 'trpc',\n // set by `instrumentSupabaseClient`\n 'supabase',\n // set by `gcp.function.context`\n 'gcp.function.context',\n // set by nextjs SDK\n 'nextjs',\n // set by react SDK `captureReactException`, `init`\n 'react',\n // set by react SDK `createReduxEnhancer`\n 'state',\n // set by `replayIntegration`\n 'Replays',\n // Other information:\n // - no need to handler feature flags `flags` context because it's already added to the active span\n];\n\n/**\n * Converts a context object to a set of attributes.\n * Only includes attributes that are primitives (for now).\n * @param contexts - The context object to convert.\n * @returns The attributes object.\n */\nexport function contextsToAttributes(contexts: Contexts): RawAttributes<Record<string, unknown>> {\n function contextToAttribute(context: Context): Context {\n return Object.keys(context).reduce(\n (acc, key) => {\n if (!isPrimitive(context[key])) {\n return acc;\n }\n acc[key] = context[key];\n return acc;\n },\n {} as Record<string, unknown>,\n );\n }\n\n const contextsWithPrimitiveValues = Object.keys(contexts).reduce((acc, key) => {\n if (!knownContexts.includes(key)) {\n return acc;\n }\n const context = contexts[key];\n if (context) {\n acc[key] = contextToAttribute(context);\n }\n return acc;\n }, {} as Contexts);\n\n const explicitlyMappedAttributes = Object.entries(explicitAttributeToContextMapping).reduce(\n (acc, [attributeKey, contextKey]) => {\n const [contextName, contextValueKey] = contextKey.split('.');\n if (contextName && contextValueKey && contextsWithPrimitiveValues[contextName]?.[contextValueKey]) {\n acc[attributeKey] = contextsWithPrimitiveValues[contextName]?.[contextValueKey];\n // now we delete this key from `contextsWithPrimitiveValues` so we don't include it in the next step\n delete contextsWithPrimitiveValues[contextName]?.[contextValueKey];\n }\n return acc;\n },\n {} as Record<string, unknown>,\n );\n\n return {\n ...explicitlyMappedAttributes,\n ...Object.entries(contextsWithPrimitiveValues).reduce(\n (acc, [contextName, contextObj]) => {\n contextObj &&\n Object.entries(contextObj).forEach(([key, value]) => {\n if (value) {\n acc[`${contextName}.${key}`] = value;\n }\n });\n return acc;\n },\n {} as Record<string, unknown>,\n ),\n };\n}\n"],"names":[],"mappings":"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"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { addNonEnumerableProperty } from './object.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* A wrapper to use the new span format in your `beforeSendSpan` callback.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
*
|
|
8
|
-
* Sentry.init({
|
|
9
|
-
* beforeSendSpan: withStreamSpan((span) => {
|
|
10
|
-
* return span;
|
|
11
|
-
* }),
|
|
12
|
-
* });
|
|
13
|
-
*
|
|
14
|
-
* @param callback
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
function withStreamSpan(callback) {
|
|
18
|
-
addNonEnumerableProperty(callback, '_v2', true);
|
|
19
|
-
// type-casting here because TS can't infer the type correctly
|
|
20
|
-
return callback ;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Typesafe check to identify the expected span json format of the `beforeSendSpan` callback.
|
|
25
|
-
*/
|
|
26
|
-
function isV2BeforeSendSpanCallback(
|
|
27
|
-
callback,
|
|
28
|
-
) {
|
|
29
|
-
return !!callback && '_v2' in callback && !!callback._v2;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { isV2BeforeSendSpanCallback, withStreamSpan };
|
|
33
|
-
//# sourceMappingURL=beforeSendSpan.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"beforeSendSpan.js","sources":["../../../src/utils/beforeSendSpan.ts"],"sourcesContent":["import type { ClientOptions, SpanV2CompatibleBeforeSendSpanCallback } from '../types-hoist/options';\nimport type { SpanV2JSON } from '../types-hoist/span';\nimport { addNonEnumerableProperty } from './object';\n\n/**\n * A wrapper to use the new span format in your `beforeSendSpan` callback.\n *\n * @example\n *\n * Sentry.init({\n * beforeSendSpan: withStreamSpan((span) => {\n * return span;\n * }),\n * });\n *\n * @param callback\n * @returns\n */\nexport function withStreamSpan(callback: (span: SpanV2JSON) => SpanV2JSON): SpanV2CompatibleBeforeSendSpanCallback {\n addNonEnumerableProperty(callback, '_v2', true);\n // type-casting here because TS can't infer the type correctly\n return callback as SpanV2CompatibleBeforeSendSpanCallback;\n}\n\n/**\n * Typesafe check to identify the expected span json format of the `beforeSendSpan` callback.\n */\nexport function isV2BeforeSendSpanCallback(\n callback: ClientOptions['beforeSendSpan'],\n): callback is SpanV2CompatibleBeforeSendSpanCallback {\n return !!callback && '_v2' in callback && !!callback._v2;\n}\n"],"names":[],"mappings":";;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,QAAQ,EAA4E;AACnH,EAAE,wBAAwB,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC;AACjD;AACA,EAAE,OAAO,QAAA;AACT;;AAEA;AACA;AACA;AACO,SAAS,0BAA0B;AAC1C,EAAE,QAAQ;AACV,EAAsD;AACtD,EAAE,OAAO,CAAC,CAAC,QAAA,IAAY,KAAA,IAAS,QAAA,IAAY,CAAC,CAAC,QAAQ,CAAC,GAAG;AAC1D;;;;"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { getClient } from '../currentScopes.js';
|
|
2
|
-
|
|
3
|
-
// Treeshakable guard to remove all code related to tracing
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Determines if the SDK is configured for span streaming.
|
|
7
|
-
* Span streaming is enabled when `traceLifecycle` is set to `stream`.
|
|
8
|
-
* (In Browser, users must add `spanStreamingIntegration` as well but it
|
|
9
|
-
* already checks itself and configures `traceLifecycle` appropriately)
|
|
10
|
-
*/
|
|
11
|
-
function hasSpanStreamingEnabled(maybeClient = getClient()) {
|
|
12
|
-
if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
return (maybeClient ?? getClient())?.getOptions()?.traceLifecycle === 'stream';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export { hasSpanStreamingEnabled };
|
|
19
|
-
//# sourceMappingURL=hasSpanStreamingEnabled.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hasSpanStreamingEnabled.js","sources":["../../../src/utils/hasSpanStreamingEnabled.ts"],"sourcesContent":["import type { Client } from '../client';\nimport { getClient } from '../currentScopes';\n\n// Treeshakable guard to remove all code related to tracing\ndeclare const __SENTRY_TRACING__: boolean | undefined;\n\n/**\n * Determines if the SDK is configured for span streaming.\n * Span streaming is enabled when `traceLifecycle` is set to `stream`.\n * (In Browser, users must add `spanStreamingIntegration` as well but it\n * already checks itself and configures `traceLifecycle` appropriately)\n */\nexport function hasSpanStreamingEnabled(maybeClient: Client | undefined = getClient()): boolean {\n if (typeof __SENTRY_TRACING__ === 'boolean' && !__SENTRY_TRACING__) {\n return false;\n }\n return (maybeClient ?? getClient())?.getOptions()?.traceLifecycle === 'stream';\n}\n"],"names":[],"mappings":";;AAGA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,uBAAuB,CAAC,WAAW,GAAuB,SAAS,EAAE,EAAW;AAChG,EAAE,IAAI,OAAO,kBAAA,KAAuB,SAAA,IAAa,CAAC,kBAAkB,EAAE;AACtE,IAAI,OAAO,KAAK;AAChB,EAAE;AACF,EAAE,OAAO,CAAC,WAAA,IAAe,SAAS,EAAE,GAAG,UAAU,EAAE,EAAE,cAAA,KAAmB,QAAQ;AAChF;;;;"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface ServerSpanStreamingOptions {
|
|
2
|
-
/** Max spans per envelope batch (default: 1000) */
|
|
3
|
-
maxSpanLimit?: number;
|
|
4
|
-
/** Flush interval in ms (default: 5000) */
|
|
5
|
-
flushInterval?: number;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Span streaming integration used by server runtime SDKs.
|
|
9
|
-
*/
|
|
10
|
-
export declare const spanStreamingIntegration: (options?: ServerSpanStreamingOptions | undefined) => import("../types-hoist/integration").Integration;
|
|
11
|
-
//# sourceMappingURL=spanStreaming.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spanStreaming.d.ts","sourceRoot":"","sources":["../../../src/integrations/spanStreaming.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,0BAA0B;IACzC,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAwCD;;GAEG;AACH,eAAO,MAAM,wBAAwB,wGAA+C,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Client } from '../client';
|
|
2
|
-
import type { Span } from '../types-hoist/span';
|
|
3
|
-
/**
|
|
4
|
-
* Captures a span and returns a JSON representation to be enqueued for sending.
|
|
5
|
-
*
|
|
6
|
-
* IMPORTANT: This function converts the span to JSON immediately to avoid writing
|
|
7
|
-
* to an already-ended OTel span instance (which is blocked by the OTel Span class).
|
|
8
|
-
*/
|
|
9
|
-
export declare function captureSpan(span: Span, client?: Client<import("..").ClientOptions<import("..").BaseTransportOptions>> | undefined): void;
|
|
10
|
-
//# sourceMappingURL=captureSpan.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"captureSpan.d.ts","sourceRoot":"","sources":["../../../src/spans/captureSpan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAmBxC,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,qBAAqB,CAAC;AAM5D;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,oFAAc,GAAG,IAAI,CA8ClE"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Client } from '../client';
|
|
2
|
-
import type { SpanV2JSONWithSegmentRef } from '../types-hoist/span';
|
|
3
|
-
export interface SpanBufferOptions {
|
|
4
|
-
/** Max spans per trace before auto-flush (default: 1000) */
|
|
5
|
-
maxSpanLimit?: number;
|
|
6
|
-
/** Flush interval in ms (default: 5000) */
|
|
7
|
-
flushInterval?: number;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* A buffer for span JSON objects that flushes them to Sentry in Span v2 envelopes.
|
|
11
|
-
* Handles interval-based flushing, size thresholds, and graceful shutdown.
|
|
12
|
-
*/
|
|
13
|
-
export declare class SpanBuffer {
|
|
14
|
-
private _spanTreeMap;
|
|
15
|
-
private _flushIntervalId;
|
|
16
|
-
private _client;
|
|
17
|
-
private _maxSpanLimit;
|
|
18
|
-
private _flushInterval;
|
|
19
|
-
constructor(client: Client, options?: SpanBufferOptions);
|
|
20
|
-
/**
|
|
21
|
-
* Add a span to the buffer.
|
|
22
|
-
*/
|
|
23
|
-
addSpan(spanJSON: SpanV2JSONWithSegmentRef): void;
|
|
24
|
-
/**
|
|
25
|
-
* Flush all buffered traces.
|
|
26
|
-
*/
|
|
27
|
-
flush(): void;
|
|
28
|
-
/**
|
|
29
|
-
* Flush spans of a specific trace.
|
|
30
|
-
* In contrast to {@link SpanBuffer.flush}, this method does not flush all traces, but only the one with the given traceId.
|
|
31
|
-
*/
|
|
32
|
-
flushTrace(traceId: string): void;
|
|
33
|
-
private _debounceFlushInterval;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=spanBuffer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spanBuffer.d.ts","sourceRoot":"","sources":["../../../src/spans/spanBuffer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAIxC,OAAO,KAAK,EAAc,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAGhF,MAAM,WAAW,iBAAiB;IAChC,4DAA4D;IAC5D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,YAAY,CAA6C;IACjE,OAAO,CAAC,gBAAgB,CAAwC;IAChE,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,cAAc,CAAS;gBAEZ,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB;IAkB9D;;OAEG;IACI,OAAO,CAAC,QAAQ,EAAE,wBAAwB,GAAG,IAAI;IAgBxD;;OAEG;IACI,KAAK,IAAI,IAAI;IAapB;;;OAGG;IACI,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAuCxC,OAAO,CAAC,sBAAsB;CAQ/B"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { RawAttributes } from '../attributes';
|
|
2
|
-
import type { Contexts } from '../types-hoist/context';
|
|
3
|
-
import type { SpanV2JSON } from '../types-hoist/span';
|
|
4
|
-
/**
|
|
5
|
-
* Only set a span JSON attribute if it is not already set.
|
|
6
|
-
* This is used to safely set attributes on JSON objects without mutating already-ended span instances.
|
|
7
|
-
*/
|
|
8
|
-
export declare function safeSetSpanJSONAttributes(spanJSON: SpanV2JSON, newAttributes: RawAttributes<Record<string, unknown>>): void;
|
|
9
|
-
/**
|
|
10
|
-
* Apply a user-provided beforeSendSpan callback to a span JSON.
|
|
11
|
-
*/
|
|
12
|
-
export declare function applyBeforeSendSpanCallback(span: SpanV2JSON, beforeSendSpan: (span: SpanV2JSON) => SpanV2JSON): SpanV2JSON;
|
|
13
|
-
/**
|
|
14
|
-
* Converts a context object to a set of attributes.
|
|
15
|
-
* Only includes attributes that are primitives (for now).
|
|
16
|
-
* @param contexts - The context object to convert.
|
|
17
|
-
* @returns The attributes object.
|
|
18
|
-
*/
|
|
19
|
-
export declare function contextsToAttributes(contexts: Contexts): RawAttributes<Record<string, unknown>>;
|
|
20
|
-
//# sourceMappingURL=spanFirstUtils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spanFirstUtils.d.ts","sourceRoot":"","sources":["../../../src/spans/spanFirstUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAW,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAItD;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,UAAU,EACpB,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACpD,IAAI,CAiBN;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,UAAU,EAChB,cAAc,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,UAAU,GAC/C,UAAU,CAOZ;AA4ED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAqD/F"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { AttributeUnit } from '../attributes';
|
|
2
|
-
export type SerializedAttributes = Record<string, SerializedAttribute>;
|
|
3
|
-
export type SerializedAttribute = ({
|
|
4
|
-
type: 'string';
|
|
5
|
-
value: string;
|
|
6
|
-
} | {
|
|
7
|
-
type: 'integer';
|
|
8
|
-
value: number;
|
|
9
|
-
} | {
|
|
10
|
-
type: 'double';
|
|
11
|
-
value: number;
|
|
12
|
-
} | {
|
|
13
|
-
type: 'boolean';
|
|
14
|
-
value: boolean;
|
|
15
|
-
}) & {
|
|
16
|
-
unit?: AttributeUnit;
|
|
17
|
-
};
|
|
18
|
-
export type SerializedAttributeType = 'string' | 'integer' | 'double' | 'boolean';
|
|
19
|
-
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../../../src/types-hoist/attributes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;AACvE,MAAM,MAAM,mBAAmB,GAAG,CAC9B;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB,CACJ,GAAG;IAAE,IAAI,CAAC,EAAE,aAAa,CAAA;CAAE,CAAC;AAC7B,MAAM,MAAM,uBAAuB,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ClientOptions, SpanV2CompatibleBeforeSendSpanCallback } from '../types-hoist/options';
|
|
2
|
-
import type { SpanV2JSON } from '../types-hoist/span';
|
|
3
|
-
/**
|
|
4
|
-
* A wrapper to use the new span format in your `beforeSendSpan` callback.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
*
|
|
8
|
-
* Sentry.init({
|
|
9
|
-
* beforeSendSpan: withStreamSpan((span) => {
|
|
10
|
-
* return span;
|
|
11
|
-
* }),
|
|
12
|
-
* });
|
|
13
|
-
*
|
|
14
|
-
* @param callback
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
export declare function withStreamSpan(callback: (span: SpanV2JSON) => SpanV2JSON): SpanV2CompatibleBeforeSendSpanCallback;
|
|
18
|
-
/**
|
|
19
|
-
* Typesafe check to identify the expected span json format of the `beforeSendSpan` callback.
|
|
20
|
-
*/
|
|
21
|
-
export declare function isV2BeforeSendSpanCallback(callback: ClientOptions['beforeSendSpan']): callback is SpanV2CompatibleBeforeSendSpanCallback;
|
|
22
|
-
//# sourceMappingURL=beforeSendSpan.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"beforeSendSpan.d.ts","sourceRoot":"","sources":["../../../src/utils/beforeSendSpan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,sCAAsC,EAAE,MAAM,wBAAwB,CAAC;AACpG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAGtD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,UAAU,GAAG,sCAAsC,CAIjH;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,aAAa,CAAC,gBAAgB,CAAC,GACxC,QAAQ,IAAI,sCAAsC,CAEpD"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Client } from '../client';
|
|
2
|
-
/**
|
|
3
|
-
* Determines if the SDK is configured for span streaming.
|
|
4
|
-
* Span streaming is enabled when `traceLifecycle` is set to `stream`.
|
|
5
|
-
* (In Browser, users must add `spanStreamingIntegration` as well but it
|
|
6
|
-
* already checks itself and configures `traceLifecycle` appropriately)
|
|
7
|
-
*/
|
|
8
|
-
export declare function hasSpanStreamingEnabled(maybeClient?: Client | undefined): boolean;
|
|
9
|
-
//# sourceMappingURL=hasSpanStreamingEnabled.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hasSpanStreamingEnabled.d.ts","sourceRoot":"","sources":["../../../src/utils/hasSpanStreamingEnabled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAMxC;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,GAAE,MAAM,GAAG,SAAuB,GAAG,OAAO,CAK9F"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export interface ServerSpanStreamingOptions {
|
|
2
|
-
/** Max spans per envelope batch (default: 1000) */
|
|
3
|
-
maxSpanLimit?: number;
|
|
4
|
-
/** Flush interval in ms (default: 5000) */
|
|
5
|
-
flushInterval?: number;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Span streaming integration used by server runtime SDKs.
|
|
9
|
-
*/
|
|
10
|
-
export declare const spanStreamingIntegration: (options?: ServerSpanStreamingOptions | undefined) => import("../types-hoist/integration").Integration;
|
|
11
|
-
//# sourceMappingURL=spanStreaming.d.ts.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Client } from '../client';
|
|
2
|
-
import { Span } from '../types-hoist/span';
|
|
3
|
-
/**
|
|
4
|
-
* Captures a span and returns a JSON representation to be enqueued for sending.
|
|
5
|
-
*
|
|
6
|
-
* IMPORTANT: This function converts the span to JSON immediately to avoid writing
|
|
7
|
-
* to an already-ended OTel span instance (which is blocked by the OTel Span class).
|
|
8
|
-
*/
|
|
9
|
-
export declare function captureSpan(span: Span, client?: Client<import("..").ClientOptions<import("..").BaseTransportOptions>> | undefined): void;
|
|
10
|
-
//# sourceMappingURL=captureSpan.d.ts.map
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { Client } from '../client';
|
|
2
|
-
import { SpanV2JSONWithSegmentRef } from '../types-hoist/span';
|
|
3
|
-
export interface SpanBufferOptions {
|
|
4
|
-
/** Max spans per trace before auto-flush (default: 1000) */
|
|
5
|
-
maxSpanLimit?: number;
|
|
6
|
-
/** Flush interval in ms (default: 5000) */
|
|
7
|
-
flushInterval?: number;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* A buffer for span JSON objects that flushes them to Sentry in Span v2 envelopes.
|
|
11
|
-
* Handles interval-based flushing, size thresholds, and graceful shutdown.
|
|
12
|
-
*/
|
|
13
|
-
export declare class SpanBuffer {
|
|
14
|
-
private _spanTreeMap;
|
|
15
|
-
private _flushIntervalId;
|
|
16
|
-
private _client;
|
|
17
|
-
private _maxSpanLimit;
|
|
18
|
-
private _flushInterval;
|
|
19
|
-
constructor(client: Client, options?: SpanBufferOptions);
|
|
20
|
-
/**
|
|
21
|
-
* Add a span to the buffer.
|
|
22
|
-
*/
|
|
23
|
-
addSpan(spanJSON: SpanV2JSONWithSegmentRef): void;
|
|
24
|
-
/**
|
|
25
|
-
* Flush all buffered traces.
|
|
26
|
-
*/
|
|
27
|
-
flush(): void;
|
|
28
|
-
/**
|
|
29
|
-
* Flush spans of a specific trace.
|
|
30
|
-
* In contrast to {@link SpanBuffer.flush}, this method does not flush all traces, but only the one with the given traceId.
|
|
31
|
-
*/
|
|
32
|
-
flushTrace(traceId: string): void;
|
|
33
|
-
private _debounceFlushInterval;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=spanBuffer.d.ts.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { RawAttributes } from '../attributes';
|
|
2
|
-
import { Contexts } from '../types-hoist/context';
|
|
3
|
-
import { SpanV2JSON } from '../types-hoist/span';
|
|
4
|
-
/**
|
|
5
|
-
* Only set a span JSON attribute if it is not already set.
|
|
6
|
-
* This is used to safely set attributes on JSON objects without mutating already-ended span instances.
|
|
7
|
-
*/
|
|
8
|
-
export declare function safeSetSpanJSONAttributes(spanJSON: SpanV2JSON, newAttributes: RawAttributes<Record<string, unknown>>): void;
|
|
9
|
-
/**
|
|
10
|
-
* Apply a user-provided beforeSendSpan callback to a span JSON.
|
|
11
|
-
*/
|
|
12
|
-
export declare function applyBeforeSendSpanCallback(span: SpanV2JSON, beforeSendSpan: (span: SpanV2JSON) => SpanV2JSON): SpanV2JSON;
|
|
13
|
-
/**
|
|
14
|
-
* Converts a context object to a set of attributes.
|
|
15
|
-
* Only includes attributes that are primitives (for now).
|
|
16
|
-
* @param contexts - The context object to convert.
|
|
17
|
-
* @returns The attributes object.
|
|
18
|
-
*/
|
|
19
|
-
export declare function contextsToAttributes(contexts: Contexts): RawAttributes<Record<string, unknown>>;
|
|
20
|
-
//# sourceMappingURL=spanFirstUtils.d.ts.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { AttributeUnit } from '../attributes';
|
|
2
|
-
export type SerializedAttributes = Record<string, SerializedAttribute>;
|
|
3
|
-
export type SerializedAttribute = ({
|
|
4
|
-
type: 'string';
|
|
5
|
-
value: string;
|
|
6
|
-
} | {
|
|
7
|
-
type: 'integer';
|
|
8
|
-
value: number;
|
|
9
|
-
} | {
|
|
10
|
-
type: 'double';
|
|
11
|
-
value: number;
|
|
12
|
-
} | {
|
|
13
|
-
type: 'boolean';
|
|
14
|
-
value: boolean;
|
|
15
|
-
}) & {
|
|
16
|
-
unit?: AttributeUnit;
|
|
17
|
-
};
|
|
18
|
-
export type SerializedAttributeType = 'string' | 'integer' | 'double' | 'boolean';
|
|
19
|
-
//# sourceMappingURL=attributes.d.ts.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ClientOptions, SpanV2CompatibleBeforeSendSpanCallback } from '../types-hoist/options';
|
|
2
|
-
import { SpanV2JSON } from '../types-hoist/span';
|
|
3
|
-
/**
|
|
4
|
-
* A wrapper to use the new span format in your `beforeSendSpan` callback.
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
*
|
|
8
|
-
* Sentry.init({
|
|
9
|
-
* beforeSendSpan: withStreamSpan((span) => {
|
|
10
|
-
* return span;
|
|
11
|
-
* }),
|
|
12
|
-
* });
|
|
13
|
-
*
|
|
14
|
-
* @param callback
|
|
15
|
-
* @returns
|
|
16
|
-
*/
|
|
17
|
-
export declare function withStreamSpan(callback: (span: SpanV2JSON) => SpanV2JSON): SpanV2CompatibleBeforeSendSpanCallback;
|
|
18
|
-
/**
|
|
19
|
-
* Typesafe check to identify the expected span json format of the `beforeSendSpan` callback.
|
|
20
|
-
*/
|
|
21
|
-
export declare function isV2BeforeSendSpanCallback(callback: ClientOptions['beforeSendSpan']): callback is SpanV2CompatibleBeforeSendSpanCallback;
|
|
22
|
-
//# sourceMappingURL=beforeSendSpan.d.ts.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Client } from '../client';
|
|
2
|
-
/**
|
|
3
|
-
* Determines if the SDK is configured for span streaming.
|
|
4
|
-
* Span streaming is enabled when `traceLifecycle` is set to `stream`.
|
|
5
|
-
* (In Browser, users must add `spanStreamingIntegration` as well but it
|
|
6
|
-
* already checks itself and configures `traceLifecycle` appropriately)
|
|
7
|
-
*/
|
|
8
|
-
export declare function hasSpanStreamingEnabled(maybeClient?: Client | undefined): boolean;
|
|
9
|
-
//# sourceMappingURL=hasSpanStreamingEnabled.d.ts.map
|