Skip to content

Commit

Permalink
feat(meta-sdks): Remove runtime tags (#13105)
Browse files Browse the repository at this point in the history
Runtime tags are already set by e.g. Relay, so the Meta-Framework SDKs
do not need to set them anymore.

Comment why this change was made:
#13101 (review)
  • Loading branch information
s1gr1d authored Jul 31, 2024
1 parent 7150e3f commit e15885a
Show file tree
Hide file tree
Showing 37 changed files with 36 additions and 223 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ test('Sends a pageload transaction to Sentry', async ({ page }) => {
expect(transactionEvent).toEqual(
expect.objectContaining({
transaction: '/',
tags: { runtime: 'browser' },
transaction_info: { source: 'route' },
type: 'transaction',
contexts: {
Expand Down Expand Up @@ -59,7 +58,6 @@ test('captures a navigation transcation to Sentry', async ({ page }) => {
expect(clientTxnEvent).toEqual(
expect.objectContaining({
transaction: '/user/[id]',
tags: { runtime: 'browser' },
transaction_info: { source: 'route' },
type: 'transaction',
contexts: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ test('Sends server-side transactions to Sentry', async ({ baseURL }) => {
}),
status: 'ok',
},
runtime: {
name: 'node',
version: expect.any(String),
},
}),
spans: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ test('Sends a pageload transaction', async ({ page }) => {
expect(transactionEvent).toEqual(
expect.objectContaining({
transaction: '/',
tags: { runtime: 'browser' },
transaction_info: { source: 'url' },
type: 'transaction',
contexts: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ test.describe('client-side errors', () => {
},
transaction: '/client-error',
});
expect(error.tags).toMatchObject({ runtime: 'browser' });
expect(error.transaction).toEqual('/client-error');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ test.describe('server-side errors', () => {

const error = await errorEventPromise;

expect(error.tags).toMatchObject({ runtime: 'node' });
expect(error).toMatchObject({
exception: {
values: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ test.describe('client-side errors', () => {
}),
);

expect(errorEvent.tags).toMatchObject({ runtime: 'browser' });

expect(errorEvent.transaction).toEqual('/client-error');
});

Expand All @@ -53,7 +51,6 @@ test.describe('client-side errors', () => {
}),
);

expect(errorEvent.tags).toMatchObject({ runtime: 'browser' });
expect(errorEvent.transaction).toEqual('/universal-load-error');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ test.describe('server-side errors', () => {
}),
);

expect(errorEvent.tags).toMatchObject({ runtime: 'node' });

expect(errorEvent.request).toEqual({
cookies: {},
headers: expect.objectContaining({
Expand Down Expand Up @@ -49,8 +47,6 @@ test.describe('server-side errors', () => {
}),
);

expect(errorEvent.tags).toMatchObject({ runtime: 'node' });

expect(errorEvent.request).toEqual({
cookies: {},
headers: expect.objectContaining({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ test('server pageload request span has nested request span for sub request', asy

expect(serverTxnEvent).toMatchObject({
transaction: 'GET /server-load-fetch',
tags: { runtime: 'node' },
transaction_info: { source: 'route' },
type: 'transaction',
contexts: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ test.describe('performance events', () => {

expect(clientTxnEvent).toMatchObject({
transaction: '/users/[id]',
tags: { runtime: 'browser' },
transaction_info: { source: 'route' },
type: 'transaction',
contexts: {
Expand All @@ -34,7 +33,6 @@ test.describe('performance events', () => {

expect(serverTxnEvent).toMatchObject({
transaction: 'GET /users/[id]',
tags: { runtime: 'node' },
transaction_info: { source: 'route' },
type: 'transaction',
contexts: {
Expand Down Expand Up @@ -77,7 +75,6 @@ test.describe('performance events', () => {

expect(clientTxnEvent).toMatchObject({
transaction: '/users',
tags: { runtime: 'browser' },
transaction_info: { source: 'route' },
type: 'transaction',
contexts: {
Expand All @@ -90,7 +87,6 @@ test.describe('performance events', () => {

expect(serverTxnEvent).toMatchObject({
transaction: 'GET /users',
tags: { runtime: 'node' },
transaction_info: { source: 'route' },
type: 'transaction',
contexts: {
Expand Down Expand Up @@ -130,7 +126,6 @@ test.describe('performance events', () => {

expect(clientTxnEvent).toMatchObject({
transaction: '/universal-load-fetch',
tags: { runtime: 'browser' },
transaction_info: { source: 'route' },
type: 'transaction',
contexts: {
Expand All @@ -143,7 +138,6 @@ test.describe('performance events', () => {

expect(serverTxnEvent).toMatchObject({
transaction: 'GET /api/users',
tags: { runtime: 'node' },
transaction_info: { source: 'route' },
type: 'transaction',
contexts: {
Expand Down Expand Up @@ -186,11 +180,11 @@ test.describe('performance events', () => {

test('captures a navigation transaction directly after pageload', async ({ page }) => {
const clientPageloadTxnPromise = waitForTransaction('sveltekit-2-svelte-5', txnEvent => {
return txnEvent?.contexts?.trace?.op === 'pageload' && txnEvent?.tags?.runtime === 'browser';
return txnEvent?.contexts?.trace?.op === 'pageload';
});

const clientNavigationTxnPromise = waitForTransaction('sveltekit-2-svelte-5', txnEvent => {
return txnEvent?.contexts?.trace?.op === 'navigation' && txnEvent?.tags?.runtime === 'browser';
return txnEvent?.contexts?.trace?.op === 'navigation';
});

await waitForInitialPageload(page, { route: '/' });
Expand All @@ -205,7 +199,6 @@ test.describe('performance events', () => {

expect(pageloadTxnEvent).toMatchObject({
transaction: '/',
tags: { runtime: 'browser' },
transaction_info: { source: 'route' },
type: 'transaction',
contexts: {
Expand All @@ -218,7 +211,6 @@ test.describe('performance events', () => {

expect(navigationTxnEvent).toMatchObject({
transaction: '/users/[id]',
tags: { runtime: 'browser' },
transaction_info: { source: 'route' },
type: 'transaction',
contexts: {
Expand Down Expand Up @@ -253,27 +245,15 @@ test.describe('performance events', () => {

test('captures one navigation transaction per redirect', async ({ page }) => {
const clientNavigationRedirect1TxnPromise = waitForTransaction('sveltekit-2-svelte-5', txnEvent => {
return (
txnEvent?.contexts?.trace?.op === 'navigation' &&
txnEvent?.tags?.runtime === 'browser' &&
txnEvent?.transaction === '/redirect1'
);
return txnEvent?.contexts?.trace?.op === 'navigation' && txnEvent?.transaction === '/redirect1';
});

const clientNavigationRedirect2TxnPromise = waitForTransaction('sveltekit-2-svelte-5', txnEvent => {
return (
txnEvent?.contexts?.trace?.op === 'navigation' &&
txnEvent?.tags?.runtime === 'browser' &&
txnEvent?.transaction === '/redirect2'
);
return txnEvent?.contexts?.trace?.op === 'navigation' && txnEvent?.transaction === '/redirect2';
});

const clientNavigationRedirect3TxnPromise = waitForTransaction('sveltekit-2-svelte-5', txnEvent => {
return (
txnEvent?.contexts?.trace?.op === 'navigation' &&
txnEvent?.tags?.runtime === 'browser' &&
txnEvent?.transaction === '/users/[id]'
);
return txnEvent?.contexts?.trace?.op === 'navigation' && txnEvent?.transaction === '/users/[id]';
});

await waitForInitialPageload(page, { route: '/' });
Expand All @@ -289,7 +269,6 @@ test.describe('performance events', () => {

expect(redirect1TxnEvent).toMatchObject({
transaction: '/redirect1',
tags: { runtime: 'browser' },
transaction_info: { source: 'route' },
type: 'transaction',
contexts: {
Expand Down Expand Up @@ -327,7 +306,6 @@ test.describe('performance events', () => {

expect(redirect2TxnEvent).toMatchObject({
transaction: '/redirect2',
tags: { runtime: 'browser' },
transaction_info: { source: 'route' },
type: 'transaction',
contexts: {
Expand Down Expand Up @@ -365,7 +343,6 @@ test.describe('performance events', () => {

expect(redirect3TxnEvent).toMatchObject({
transaction: '/users/[id]',
tags: { runtime: 'browser' },
transaction_info: { source: 'route' },
type: 'transaction',
contexts: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ test.describe('client-side errors', () => {
}),
);

expect(errorEvent.tags).toMatchObject({ runtime: 'browser' });

expect(errorEvent.transaction).toEqual('/client-error');
});

Expand All @@ -53,7 +51,6 @@ test.describe('client-side errors', () => {
}),
);

expect(errorEvent.tags).toMatchObject({ runtime: 'browser' });
expect(errorEvent.transaction).toEqual('/universal-load-error');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ test.describe('server-side errors', () => {
in_app: true,
}),
);

expect(errorEvent.tags).toMatchObject({ runtime: 'node' });
});

test('captures server load error', async ({ page }) => {
Expand All @@ -38,8 +36,6 @@ test.describe('server-side errors', () => {
in_app: true,
}),
);

expect(errorEvent.tags).toMatchObject({ runtime: 'node' });
});

test('captures server route (GET) error', async ({ page }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ test('server pageload request span has nested request span for sub request', asy

expect(serverTxnEvent).toMatchObject({
transaction: 'GET /server-load-fetch',
tags: { runtime: 'node' },
transaction_info: { source: 'route' },
type: 'transaction',
contexts: {
Expand Down
Loading

0 comments on commit e15885a

Please sign in to comment.