Skip to content

Commit d487bde

Browse files
committed
fix code refs
1 parent 2aefe20 commit d487bde

3 files changed

Lines changed: 18 additions & 16 deletions

File tree

packages/core/src/types/request.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { HTTP_METHOD, URL_FRAGMENT, URL_QUERY } from '@sentry/conventions/attributes';
12
import type { WebFetchHeaders } from './webfetchapi';
23

34
/**
@@ -27,9 +28,10 @@ export type SanitizedRequestData = {
2728
* {@link FetchBreadcrumbData}). Span attributes use `url.full` instead.
2829
*/
2930
url: string;
30-
'http.method': string;
31-
'url.fragment'?: string;
32-
'url.query'?: string;
31+
// oxlint-disable-next-line typescript/no-deprecated
32+
[HTTP_METHOD]: string;
33+
[URL_FRAGMENT]?: string;
34+
[URL_QUERY]?: string;
3335
};
3436

3537
export interface RequestHookInfo {

packages/react-router/src/client/createClientInstrumentation.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import {
2424
finalizeNavigationSpanFromHydratedRouter,
2525
updateNavigationSpanUrlFromLocation,
2626
} from './utils';
27-
import { URL_TEMPLATE } from '@sentry/conventions/attributes';
27+
import { URL_FULL, URL_TEMPLATE } from '@sentry/conventions/attributes';
2828

2929
const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window;
3030

@@ -127,7 +127,7 @@ export function createSentryClientInstrumentation(
127127
const result = await callNavigate();
128128
if (result.status === 'error' && result.error instanceof Error) {
129129
captureInstrumentationError(result, captureErrors, 'react_router.navigate', {
130-
'url.full': info.currentUrl,
130+
[URL_FULL]: info.currentUrl,
131131
});
132132
}
133133
return;
@@ -174,7 +174,7 @@ export function createSentryClientInstrumentation(
174174
navigationSpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
175175
}
176176
captureInstrumentationError(result, captureErrors, 'react_router.navigate', {
177-
'url.full': WINDOW.location?.pathname || info.currentUrl,
177+
[URL_FULL]: WINDOW.location?.pathname || info.currentUrl,
178178
});
179179
}
180180
} finally {
@@ -210,7 +210,7 @@ export function createSentryClientInstrumentation(
210210
navigationSpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
211211
}
212212
captureInstrumentationError(result, captureErrors, 'react_router.navigate', {
213-
'url.full': toPath,
213+
[URL_FULL]: toPath,
214214
});
215215
}
216216
return;
@@ -230,7 +230,7 @@ export function createSentryClientInstrumentation(
230230
if (result.status === 'error' && result.error instanceof Error) {
231231
span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
232232
captureInstrumentationError(result, captureErrors, 'react_router.fetcher', {
233-
'url.full': info.href,
233+
[URL_FULL]: info.href,
234234
});
235235
}
236236
},
@@ -264,7 +264,7 @@ export function createSentryClientInstrumentation(
264264
if (result.status === 'error' && result.error instanceof Error) {
265265
span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
266266
captureInstrumentationError(result, captureErrors, 'react_router.client_loader', {
267-
'url.full': urlPath,
267+
[URL_FULL]: urlPath,
268268
});
269269
}
270270
},
@@ -290,7 +290,7 @@ export function createSentryClientInstrumentation(
290290
if (result.status === 'error' && result.error instanceof Error) {
291291
span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
292292
captureInstrumentationError(result, captureErrors, 'react_router.client_action', {
293-
'url.full': urlPath,
293+
[URL_FULL]: urlPath,
294294
});
295295
}
296296
},
@@ -326,7 +326,7 @@ export function createSentryClientInstrumentation(
326326
if (result.status === 'error' && result.error instanceof Error) {
327327
span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
328328
captureInstrumentationError(result, captureErrors, 'react_router.client_middleware', {
329-
'url.full': urlPath,
329+
[URL_FULL]: urlPath,
330330
});
331331
}
332332
},

packages/react-router/src/server/createServerInstrumentation.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function createSentryServerInstrumentation(
7575
existingRootSpan.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
7676
captureInstrumentationError(result, captureErrors, 'react_router.request_handler', {
7777
'http.method': info.request.method,
78-
'url.full': pathname,
78+
[URL_FULL]: pathname,
7979
});
8080
}
8181
} finally {
@@ -102,7 +102,7 @@ export function createSentryServerInstrumentation(
102102
span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
103103
captureInstrumentationError(result, captureErrors, 'react_router.request_handler', {
104104
'http.method': info.request.method,
105-
'url.full': pathname,
105+
[URL_FULL]: pathname,
106106
});
107107
}
108108
} finally {
@@ -142,7 +142,7 @@ export function createSentryServerInstrumentation(
142142
span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
143143
captureInstrumentationError(result, captureErrors, 'react_router.loader', {
144144
'http.method': info.request.method,
145-
'url.full': urlPath,
145+
[URL_FULL]: urlPath,
146146
});
147147
}
148148
},
@@ -169,7 +169,7 @@ export function createSentryServerInstrumentation(
169169
span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
170170
captureInstrumentationError(result, captureErrors, 'react_router.action', {
171171
'http.method': info.request.method,
172-
'url.full': urlPath,
172+
[URL_FULL]: urlPath,
173173
});
174174
}
175175
},
@@ -212,7 +212,7 @@ export function createSentryServerInstrumentation(
212212
span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
213213
captureInstrumentationError(result, captureErrors, 'react_router.middleware', {
214214
'http.method': info.request.method,
215-
'url.full': urlPath,
215+
[URL_FULL]: urlPath,
216216
});
217217
}
218218
},

0 commit comments

Comments
 (0)