Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d0cb9d0
feat(core): Send gen_ai spans as v2 envelope items
andreiborza Apr 16, 2026
69b5cf8
Remove SDK-side enrichment and redundant op/origin backfill
andreiborza Apr 16, 2026
257c9fb
Pre-check wether transactions have gen_ai spans when we construct tra…
andreiborza Apr 16, 2026
eeb7812
Inline span conversion
andreiborza Apr 16, 2026
fd67edd
Merge remote-tracking branch 'origin/develop' into ab/gen-ai-span-v2-poc
andreiborza Apr 20, 2026
dc21b49
Stringify array attributes in Vercel AI integration for v2 serializat…
andreiborza Apr 20, 2026
d97c7f2
Update Vercel AI Node tests
andreiborza Apr 20, 2026
d51f4f2
Update Vercel AI E2E tests
andreiborza Apr 20, 2026
bed75f7
Update Anthropic Node tests
andreiborza Apr 20, 2026
0474787
Update Anthropic Cloudflare tests
andreiborza Apr 20, 2026
2630a24
Update OpenAI Node tests
andreiborza Apr 20, 2026
7eea494
Update OpenAI Cloudflare tests
andreiborza Apr 20, 2026
5d2ec5a
Update LangChain Node tests
andreiborza Apr 20, 2026
9968bc8
Update LangChain Cloudflare tests
andreiborza Apr 20, 2026
9e8767b
Update LangGraph Node tests
andreiborza Apr 20, 2026
6a62f0b
Update LangGraph Cloudflare tests
andreiborza Apr 20, 2026
0667e9d
Update Google GenAI Node tests
andreiborza Apr 20, 2026
26f9157
Update Google GenAI Cloudflare tests
andreiborza Apr 20, 2026
76d835c
Update size limits
andreiborza Apr 20, 2026
5f5d49e
Flip `enableTruncation` default to false
andreiborza Apr 20, 2026
7fc4b17
Merge remote-tracking branch 'origin/develop' into ab/gen-ai-span-v2-poc
andreiborza Apr 21, 2026
e6ecd23
Bump size limit
andreiborza Apr 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = [
path: 'packages/browser/build/npm/esm/prod/index.js',
import: createImport('init'),
gzip: true,
limit: '26 KB',
limit: '27 KB',
Comment thread
andreiborza marked this conversation as resolved.
},
{
name: '@sentry/browser - with treeshaking flags',
Expand Down Expand Up @@ -38,7 +38,7 @@ module.exports = [
path: 'packages/browser/build/npm/esm/prod/index.js',
import: createImport('init', 'browserTracingIntegration'),
gzip: true,
limit: '44 KB',
limit: '45 KB',
},
{
name: '@sentry/browser (incl. Tracing + Span Streaming)',
Expand All @@ -52,14 +52,14 @@ module.exports = [
path: 'packages/browser/build/npm/esm/prod/index.js',
import: createImport('init', 'browserTracingIntegration', 'browserProfilingIntegration'),
gzip: true,
limit: '49 KB',
limit: '50 KB',
},
{
name: '@sentry/browser (incl. Tracing, Replay)',
path: 'packages/browser/build/npm/esm/prod/index.js',
import: createImport('init', 'browserTracingIntegration', 'replayIntegration'),
gzip: true,
limit: '83 KB',
limit: '84 KB',
},
{
name: '@sentry/browser (incl. Tracing, Replay) - with treeshaking flags',
Expand Down Expand Up @@ -89,21 +89,21 @@ module.exports = [
path: 'packages/browser/build/npm/esm/prod/index.js',
import: createImport('init', 'browserTracingIntegration', 'replayIntegration', 'replayCanvasIntegration'),
gzip: true,
limit: '88 KB',
limit: '89 KB',
},
{
name: '@sentry/browser (incl. Tracing, Replay, Feedback)',
path: 'packages/browser/build/npm/esm/prod/index.js',
import: createImport('init', 'browserTracingIntegration', 'replayIntegration', 'feedbackIntegration'),
gzip: true,
limit: '100 KB',
limit: '101 KB',
},
{
name: '@sentry/browser (incl. Feedback)',
path: 'packages/browser/build/npm/esm/prod/index.js',
import: createImport('init', 'feedbackIntegration'),
gzip: true,
limit: '43 KB',
limit: '44 KB',
},
{
name: '@sentry/browser (incl. sendFeedback)',
Expand All @@ -117,7 +117,7 @@ module.exports = [
path: 'packages/browser/build/npm/esm/prod/index.js',
import: createImport('init', 'feedbackAsyncIntegration'),
gzip: true,
limit: '36 KB',
limit: '37 KB',
},
{
name: '@sentry/browser (incl. Metrics)',
Expand All @@ -138,7 +138,7 @@ module.exports = [
path: 'packages/browser/build/npm/esm/prod/index.js',
import: createImport('init', 'metrics', 'logger'),
gzip: true,
limit: '28 KB',
limit: '29 KB',
},
// React SDK (ESM)
{
Expand All @@ -147,7 +147,7 @@ module.exports = [
import: createImport('init', 'ErrorBoundary'),
ignore: ['react/jsx-runtime'],
gzip: true,
limit: '28 KB',
limit: '29 KB',
},
{
name: '@sentry/react (incl. Tracing)',
Expand All @@ -163,22 +163,22 @@ module.exports = [
path: 'packages/vue/build/esm/index.js',
import: createImport('init'),
gzip: true,
limit: '31 KB',
limit: '32 KB',
},
{
name: '@sentry/vue (incl. Tracing)',
path: 'packages/vue/build/esm/index.js',
import: createImport('init', 'browserTracingIntegration'),
gzip: true,
limit: '46 KB',
limit: '47 KB',
},
// Svelte SDK (ESM)
{
name: '@sentry/svelte',
path: 'packages/svelte/build/esm/index.js',
import: createImport('init'),
gzip: true,
limit: '26 KB',
limit: '27 KB',
},
// Browser CDN bundles
{
Expand All @@ -191,13 +191,13 @@ module.exports = [
name: 'CDN Bundle (incl. Tracing)',
path: createCDNPath('bundle.tracing.min.js'),
gzip: true,
limit: '45 KB',
limit: '46 KB',
},
{
name: 'CDN Bundle (incl. Logs, Metrics)',
path: createCDNPath('bundle.logs.metrics.min.js'),
gzip: true,
limit: '30 KB',
limit: '31 KB',
},
{
name: 'CDN Bundle (incl. Tracing, Logs, Metrics)',
Expand All @@ -209,19 +209,19 @@ module.exports = [
name: 'CDN Bundle (incl. Replay, Logs, Metrics)',
path: createCDNPath('bundle.replay.logs.metrics.min.js'),
gzip: true,
limit: '69 KB',
limit: '70 KB',
},
{
name: 'CDN Bundle (incl. Tracing, Replay)',
path: createCDNPath('bundle.tracing.replay.min.js'),
gzip: true,
limit: '82 KB',
limit: '83 KB',
},
{
name: 'CDN Bundle (incl. Tracing, Replay, Logs, Metrics)',
path: createCDNPath('bundle.tracing.replay.logs.metrics.min.js'),
gzip: true,
limit: '83 KB',
limit: '84 KB',
},
{
name: 'CDN Bundle (incl. Tracing, Replay, Feedback)',
Expand All @@ -241,28 +241,28 @@ module.exports = [
path: createCDNPath('bundle.min.js'),
gzip: false,
brotli: false,
limit: '84 KB',
limit: '85 KB',
},
{
name: 'CDN Bundle (incl. Tracing) - uncompressed',
path: createCDNPath('bundle.tracing.min.js'),
gzip: false,
brotli: false,
limit: '135 KB',
limit: '136 KB',
},
{
name: 'CDN Bundle (incl. Logs, Metrics) - uncompressed',
path: createCDNPath('bundle.logs.metrics.min.js'),
gzip: false,
brotli: false,
limit: '88 KB',
limit: '89 KB',
},
{
name: 'CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed',
path: createCDNPath('bundle.tracing.logs.metrics.min.js'),
gzip: false,
brotli: false,
limit: '138 KB',
limit: '139 KB',
},
{
name: 'CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed',
Expand All @@ -276,28 +276,28 @@ module.exports = [
path: createCDNPath('bundle.tracing.replay.min.js'),
gzip: false,
brotli: false,
limit: '252 KB',
limit: '253 KB',
},
{
name: 'CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed',
path: createCDNPath('bundle.tracing.replay.logs.metrics.min.js'),
gzip: false,
brotli: false,
limit: '255 KB',
limit: '257 KB',
},
{
name: 'CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed',
path: createCDNPath('bundle.tracing.replay.feedback.min.js'),
gzip: false,
brotli: false,
limit: '265 KB',
limit: '266 KB',
},
{
name: 'CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed',
path: createCDNPath('bundle.tracing.replay.feedback.logs.metrics.min.js'),
gzip: false,
brotli: false,
limit: '268 KB',
limit: '269 KB',
},
// Next.js SDK (ESM)
{
Expand All @@ -306,7 +306,7 @@ module.exports = [
import: createImport('init'),
ignore: ['next/router', 'next/constants'],
gzip: true,
limit: '49 KB',
limit: '50 KB',
},
// SvelteKit SDK (ESM)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/core';
import { expect, it } from 'vitest';
import {
GEN_AI_OPERATION_NAME_ATTRIBUTE,
Expand All @@ -21,30 +20,36 @@ it('traces a basic message creation request', async ({ signal }) => {
const runner = createRunner(__dirname)
.ignore('event')
.expect(envelope => {
// Transaction item (first item in envelope)
const transactionEvent = envelope[1]?.[0]?.[1] as any;

expect(transactionEvent.transaction).toBe('GET /');
expect(transactionEvent.spans).toEqual(
expect.arrayContaining([
expect.objectContaining({
data: expect.objectContaining({
[GEN_AI_OPERATION_NAME_ATTRIBUTE]: 'chat',
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'gen_ai.chat',
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ai.anthropic',
[GEN_AI_SYSTEM_ATTRIBUTE]: 'anthropic',
[GEN_AI_REQUEST_MODEL_ATTRIBUTE]: 'claude-3-haiku-20240307',
[GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE]: 0.7,
[GEN_AI_RESPONSE_MODEL_ATTRIBUTE]: 'claude-3-haiku-20240307',
[GEN_AI_RESPONSE_ID_ATTRIBUTE]: 'msg_mock123',
[GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]: 10,
[GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]: 15,
}),
description: 'chat claude-3-haiku-20240307',
op: 'gen_ai.chat',
origin: 'auto.ai.anthropic',
}),
]),
);

// Span container item (second item in same envelope)
const container = envelope[1]?.[1]?.[1] as any;
expect(container).toBeDefined();

expect(container.items).toHaveLength(1);
const [firstSpan] = container.items;

// [0] chat claude-3-haiku-20240307
expect(firstSpan!.name).toBe('chat claude-3-haiku-20240307');
expect(firstSpan!.status).toBe('ok');
expect(firstSpan!.attributes[GEN_AI_OPERATION_NAME_ATTRIBUTE]).toEqual({ type: 'string', value: 'chat' });
expect(firstSpan!.attributes['sentry.op']).toEqual({ type: 'string', value: 'gen_ai.chat' });
expect(firstSpan!.attributes['sentry.origin']).toEqual({ type: 'string', value: 'auto.ai.anthropic' });
expect(firstSpan!.attributes[GEN_AI_SYSTEM_ATTRIBUTE]).toEqual({ type: 'string', value: 'anthropic' });
expect(firstSpan!.attributes[GEN_AI_REQUEST_MODEL_ATTRIBUTE]).toEqual({
type: 'string',
value: 'claude-3-haiku-20240307',
});
expect(firstSpan!.attributes[GEN_AI_REQUEST_TEMPERATURE_ATTRIBUTE]).toEqual({ type: 'double', value: 0.7 });
expect(firstSpan!.attributes[GEN_AI_RESPONSE_MODEL_ATTRIBUTE]).toEqual({
type: 'string',
value: 'claude-3-haiku-20240307',
});
expect(firstSpan!.attributes[GEN_AI_RESPONSE_ID_ATTRIBUTE]).toEqual({ type: 'string', value: 'msg_mock123' });
expect(firstSpan!.attributes[GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]).toEqual({ type: 'integer', value: 10 });
expect(firstSpan!.attributes[GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]).toEqual({ type: 'integer', value: 15 });
})
.start(signal);
await runner.makeRequest('get', '/');
Expand Down
Loading
Loading