Skip to content

Commit f1c8d36

Browse files
AbhiPrasadlforst
andauthored
fix(tracing): Don't set method multiple times (#8014)
Co-authored-by: Luca Forstner <luca.forstner@sentry.io>
1 parent 6bd2637 commit f1c8d36

File tree

5 files changed

+27
-18
lines changed

5 files changed

+27
-18
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -783,18 +783,19 @@ jobs:
783783
id: versions
784784
run: |
785785
echo "echo node=$(jq -r '.volta.node' package.json)" >> $GITHUB_OUTPUT
786-
- name: Run E2E tests
787-
env:
788-
E2E_TEST_PUBLISH_SCRIPT_NODE_VERSION: ${{ steps.versions.outputs.node }}
789-
E2E_TEST_AUTH_TOKEN: ${{ secrets.E2E_TEST_AUTH_TOKEN }}
790-
E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
791-
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
792-
E2E_TEST_SENTRY_TEST_PROJECT: 'sentry-javascript-e2e-tests'
793-
E2E_TEST_SHARD: ${{ matrix.shard }}
794-
E2E_TEST_SHARD_AMOUNT: 3
795-
run: |
796-
cd packages/e2e-tests
797-
yarn test:e2e
786+
# Temporarily disabling e2e tests
787+
# - name: Run E2E tests
788+
# env:
789+
# E2E_TEST_PUBLISH_SCRIPT_NODE_VERSION: ${{ steps.versions.outputs.node }}
790+
# E2E_TEST_AUTH_TOKEN: ${{ secrets.E2E_TEST_AUTH_TOKEN }}
791+
# E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
792+
# E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
793+
# E2E_TEST_SENTRY_TEST_PROJECT: 'sentry-javascript-e2e-tests'
794+
# E2E_TEST_SHARD: ${{ matrix.shard }}
795+
# E2E_TEST_SHARD_AMOUNT: 3
796+
# run: |
797+
# cd packages/e2e-tests
798+
# yarn test:e2e
798799

799800
job_required_tests:
800801
name: All required tests passed or skipped
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function Layout({ children }: { children: React.ReactNode }) {
2+
return (
3+
<html lang="en">
4+
<body>{children}</body>
5+
</html>
6+
);
7+
}

packages/nextjs/test/integration/test/client/tracingFetch.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test('should correctly instrument `fetch` for performance tracing', async ({ pag
3131
expect(transaction[0].spans).toEqual(
3232
expect.arrayContaining([
3333
expect.objectContaining({
34-
data: { method: 'GET', url: 'http://example.com', type: 'fetch' },
34+
data: { 'http.method': 'GET', url: 'http://example.com', type: 'fetch' },
3535
description: 'GET http://example.com',
3636
op: 'http.client',
3737
parent_span_id: expect.any(String),

packages/nextjs/test/run-integration-tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ for NEXTJS_VERSION in 10 11 12 13; do
5757
exit 0
5858
fi
5959

60-
# Next.js v13 requires at least Node v14
61-
if [ "$NODE_MAJOR" -lt "14" ] && [ "$NEXTJS_VERSION" -ge "13" ]; then
60+
# Next.js v13 requires at least Node v16
61+
if [ "$NODE_MAJOR" -lt "16" ] && [ "$NEXTJS_VERSION" -ge "13" ]; then
6262
echo "[nextjs@$NEXTJS_VERSION] Not compatible with Node $NODE_MAJOR"
6363
exit 0
6464
fi

packages/tracing-internal/src/browser/request.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,14 @@ export function fetchCallback(
191191
const activeTransaction = currentSpan && currentSpan.transaction;
192192

193193
if (currentSpan && activeTransaction) {
194+
const { method, url } = handlerData.fetchData;
194195
const span = currentSpan.startChild({
195196
data: {
196-
...handlerData.fetchData,
197+
url,
197198
type: 'fetch',
198-
'http.method': handlerData.fetchData.method,
199+
'http.method': method,
199200
},
200-
description: `${handlerData.fetchData.method} ${handlerData.fetchData.url}`,
201+
description: `${method} ${url}`,
201202
op: 'http.client',
202203
});
203204

0 commit comments

Comments
 (0)