Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small info when reviewing this: All the files have exactly the same changes :)

Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ test.describe('distributed tracing', () => {
expect(page.getByText(`Param: ${PARAM}`)).toBeVisible(),
]);

const baggageMetaTagContent = await page.locator('meta[name="baggage"]').getAttribute('content');

expect(baggageMetaTagContent).toContain(`sentry-trace_id=${serverTxnEvent.contexts?.trace?.trace_id}`);
expect(baggageMetaTagContent).toContain(`sentry-transaction=GET%20%2Ftest-param%2F${PARAM}`); // URL-encoded for 'GET /test-param/s0me-param'
expect(baggageMetaTagContent).toContain('sentry-sampled=true');
expect(baggageMetaTagContent).toContain('sentry-sample_rate=1');

const sentryTraceMetaTagContent = await page.locator('meta[name="sentry-trace"]').getAttribute('content');
const [metaTraceId, metaParentSpanId, metaSampled] = sentryTraceMetaTagContent?.split('-') || [];

expect(metaSampled).toBe('1');

expect(clientTxnEvent).toMatchObject({
transaction: '/test-param/:param()',
transaction_info: { source: 'route' },
Expand All @@ -28,12 +40,14 @@ test.describe('distributed tracing', () => {
trace: {
op: 'pageload',
origin: 'auto.pageload.vue',
trace_id: metaTraceId,
parent_span_id: metaParentSpanId,
},
},
});

expect(serverTxnEvent).toMatchObject({
transaction: 'GET /test-param/s0me-param', // todo: parametrize (nitro)
transaction: `GET /test-param/${PARAM}`, // todo: parametrize (nitro)
transaction_info: { source: 'url' },
type: 'transaction',
contexts: {
Expand All @@ -45,7 +59,11 @@ test.describe('distributed tracing', () => {
});

// connected trace
expect(clientTxnEvent.contexts?.trace?.trace_id).toBeDefined();
expect(clientTxnEvent.contexts?.trace?.parent_span_id).toBeDefined();

expect(clientTxnEvent.contexts?.trace?.trace_id).toBe(serverTxnEvent.contexts?.trace?.trace_id);
expect(clientTxnEvent.contexts?.trace?.parent_span_id).toBe(serverTxnEvent.contexts?.trace?.span_id);
expect(serverTxnEvent.contexts?.trace?.trace_id).toBe(metaTraceId);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ test.describe('distributed tracing', () => {
expect(page.getByText(`Param: ${PARAM}`)).toBeVisible(),
]);

const baggageMetaTagContent = await page.locator('meta[name="baggage"]').getAttribute('content');

expect(baggageMetaTagContent).toContain(`sentry-trace_id=${serverTxnEvent.contexts?.trace?.trace_id}`);
expect(baggageMetaTagContent).toContain(`sentry-transaction=GET%20%2Ftest-param%2F${PARAM}`); // URL-encoded for 'GET /test-param/s0me-param'
expect(baggageMetaTagContent).toContain('sentry-sampled=true');
expect(baggageMetaTagContent).toContain('sentry-sample_rate=1');

const sentryTraceMetaTagContent = await page.locator('meta[name="sentry-trace"]').getAttribute('content');
const [metaTraceId, metaParentSpanId, metaSampled] = sentryTraceMetaTagContent?.split('-') || [];

expect(metaSampled).toBe('1');

expect(clientTxnEvent).toMatchObject({
transaction: '/test-param/:param()',
transaction_info: { source: 'route' },
Expand All @@ -28,12 +40,14 @@ test.describe('distributed tracing', () => {
trace: {
op: 'pageload',
origin: 'auto.pageload.vue',
trace_id: metaTraceId,
parent_span_id: metaParentSpanId,
},
},
});

expect(serverTxnEvent).toMatchObject({
transaction: 'GET /test-param/s0me-param', // todo: parametrize (nitro)
transaction: `GET /test-param/${PARAM}`, // todo: parametrize (nitro)
transaction_info: { source: 'url' },
type: 'transaction',
contexts: {
Expand All @@ -45,7 +59,11 @@ test.describe('distributed tracing', () => {
});

// connected trace
expect(clientTxnEvent.contexts?.trace?.trace_id).toBeDefined();
expect(clientTxnEvent.contexts?.trace?.parent_span_id).toBeDefined();

expect(clientTxnEvent.contexts?.trace?.trace_id).toBe(serverTxnEvent.contexts?.trace?.trace_id);
expect(clientTxnEvent.contexts?.trace?.parent_span_id).toBe(serverTxnEvent.contexts?.trace?.span_id);
expect(serverTxnEvent.contexts?.trace?.trace_id).toBe(metaTraceId);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ test.describe('distributed tracing', () => {
expect(page.getByText(`Param: ${PARAM}`)).toBeVisible(),
]);

const baggageMetaTagContent = await page.locator('meta[name="baggage"]').getAttribute('content');

expect(baggageMetaTagContent).toContain(`sentry-trace_id=${serverTxnEvent.contexts?.trace?.trace_id}`);
expect(baggageMetaTagContent).toContain(`sentry-transaction=GET%20%2Ftest-param%2F${PARAM}`); // URL-encoded for 'GET /test-param/s0me-param'
expect(baggageMetaTagContent).toContain('sentry-sampled=true');
expect(baggageMetaTagContent).toContain('sentry-sample_rate=1');

const sentryTraceMetaTagContent = await page.locator('meta[name="sentry-trace"]').getAttribute('content');
const [metaTraceId, metaParentSpanId, metaSampled] = sentryTraceMetaTagContent?.split('-') || [];

expect(metaSampled).toBe('1');

expect(clientTxnEvent).toMatchObject({
transaction: '/test-param/:param()',
transaction_info: { source: 'route' },
Expand All @@ -28,12 +40,14 @@ test.describe('distributed tracing', () => {
trace: {
op: 'pageload',
origin: 'auto.pageload.vue',
trace_id: metaTraceId,
parent_span_id: metaParentSpanId,
},
},
});

expect(serverTxnEvent).toMatchObject({
transaction: 'GET /test-param/s0me-param', // todo: parametrize (nitro)
transaction: `GET /test-param/${PARAM}`, // todo: parametrize (nitro)
transaction_info: { source: 'url' },
type: 'transaction',
contexts: {
Expand All @@ -45,7 +59,11 @@ test.describe('distributed tracing', () => {
});

// connected trace
expect(clientTxnEvent.contexts?.trace?.trace_id).toBeDefined();
expect(clientTxnEvent.contexts?.trace?.parent_span_id).toBeDefined();

expect(clientTxnEvent.contexts?.trace?.trace_id).toBe(serverTxnEvent.contexts?.trace?.trace_id);
expect(clientTxnEvent.contexts?.trace?.parent_span_id).toBe(serverTxnEvent.contexts?.trace?.span_id);
expect(serverTxnEvent.contexts?.trace?.trace_id).toBe(metaTraceId);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ test.describe('distributed tracing', () => {
expect(page.getByText(`Param: ${PARAM}`)).toBeVisible(),
]);

const baggageMetaTagContent = await page.locator('meta[name="baggage"]').getAttribute('content');

expect(baggageMetaTagContent).toContain(`sentry-trace_id=${serverTxnEvent.contexts?.trace?.trace_id}`);
expect(baggageMetaTagContent).toContain(`sentry-transaction=GET%20%2Ftest-param%2F${PARAM}`); // URL-encoded for 'GET /test-param/s0me-param'
expect(baggageMetaTagContent).toContain('sentry-sampled=true');
expect(baggageMetaTagContent).toContain('sentry-sample_rate=1');

const sentryTraceMetaTagContent = await page.locator('meta[name="sentry-trace"]').getAttribute('content');
const [metaTraceId, metaParentSpanId, metaSampled] = sentryTraceMetaTagContent?.split('-') || [];

expect(metaSampled).toBe('1');

expect(clientTxnEvent).toMatchObject({
transaction: '/test-param/:param()',
transaction_info: { source: 'route' },
Expand All @@ -28,12 +40,14 @@ test.describe('distributed tracing', () => {
trace: {
op: 'pageload',
origin: 'auto.pageload.vue',
trace_id: metaTraceId,
parent_span_id: metaParentSpanId,
},
},
});

expect(serverTxnEvent).toMatchObject({
transaction: 'GET /test-param/s0me-param', // todo: parametrize (nitro)
transaction: `GET /test-param/${PARAM}`, // todo: parametrize (nitro)
transaction_info: { source: 'url' },
type: 'transaction',
contexts: {
Expand All @@ -45,7 +59,11 @@ test.describe('distributed tracing', () => {
});

// connected trace
expect(clientTxnEvent.contexts?.trace?.trace_id).toBeDefined();
expect(clientTxnEvent.contexts?.trace?.parent_span_id).toBeDefined();

expect(clientTxnEvent.contexts?.trace?.trace_id).toBe(serverTxnEvent.contexts?.trace?.trace_id);
expect(clientTxnEvent.contexts?.trace?.parent_span_id).toBe(serverTxnEvent.contexts?.trace?.span_id);
expect(serverTxnEvent.contexts?.trace?.trace_id).toBe(metaTraceId);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@ test.describe('distributed tracing', () => {
expect(page.getByText(`Param: ${PARAM}`)).toBeVisible(),
]);

const baggageMetaTagContent = await page.locator('meta[name="baggage"]').getAttribute('content');

expect(baggageMetaTagContent).toContain(`sentry-trace_id=${serverTxnEvent.contexts?.trace?.trace_id}`);
expect(baggageMetaTagContent).toContain(`sentry-transaction=GET%20%2Ftest-param%2F${PARAM}`); // URL-encoded for 'GET /test-param/s0me-param'
expect(baggageMetaTagContent).toContain('sentry-sampled=true');
expect(baggageMetaTagContent).toContain('sentry-sample_rate=1');

const sentryTraceMetaTagContent = await page.locator('meta[name="sentry-trace"]').getAttribute('content');
const [metaTraceId, metaParentSpanId, metaSampled] = sentryTraceMetaTagContent?.split('-') || [];

expect(metaSampled).toBe('1');

expect(clientTxnEvent).toMatchObject({
transaction: '/test-param/:param()',
transaction_info: { source: 'route' },
Expand All @@ -28,12 +40,14 @@ test.describe('distributed tracing', () => {
trace: {
op: 'pageload',
origin: 'auto.pageload.vue',
trace_id: metaTraceId,
parent_span_id: metaParentSpanId,
},
},
});

expect(serverTxnEvent).toMatchObject({
transaction: 'GET /test-param/s0me-param', // todo: parametrize (nitro)
transaction: `GET /test-param/${PARAM}`, // todo: parametrize (nitro)
transaction_info: { source: 'url' },
type: 'transaction',
contexts: {
Expand All @@ -45,7 +59,11 @@ test.describe('distributed tracing', () => {
});

// connected trace
expect(clientTxnEvent.contexts?.trace?.trace_id).toBeDefined();
expect(clientTxnEvent.contexts?.trace?.parent_span_id).toBeDefined();

expect(clientTxnEvent.contexts?.trace?.trace_id).toBe(serverTxnEvent.contexts?.trace?.trace_id);
expect(clientTxnEvent.contexts?.trace?.parent_span_id).toBe(serverTxnEvent.contexts?.trace?.span_id);
expect(serverTxnEvent.contexts?.trace?.trace_id).toBe(metaTraceId);
});
});
Loading