Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Nov 22, 2023
1 parent f971b62 commit bcbf941
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
19 changes: 1 addition & 18 deletions packages/tracing-internal/src/browser/request.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable max-lines */
import { getCurrentHub, getDynamicSamplingContextFromClient, hasTracingEnabled } from '@sentry/core';
import type { SentryWrappedXMLHttpRequest, Span } from '@sentry/types';
import type { HandlerDataXhr, SentryWrappedXMLHttpRequest, Span } from '@sentry/types';
import {
addFetchInstrumentationHandler,
addXhrInstrumentationHandler,
Expand Down Expand Up @@ -67,23 +67,6 @@ export interface RequestInstrumentationOptions {
shouldCreateSpanForRequest?(this: void, url: string): boolean;
}

/** Data returned from XHR request */
export interface XHRData {
xhr?: {
[SENTRY_XHR_DATA_KEY]?: {
method: string;
url: string;
status_code: number;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
data: Record<string, any>;
};
__sentry_xhr_span_id__?: string;
setRequestHeader?: (key: string, val: string) => void;
getRequestHeader?: (key: string) => string;
__sentry_own_request__?: boolean;
};
}

export const defaultRequestInstrumentationOptions: RequestInstrumentationOptions = {
traceFetch: true,
traceXHR: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/tracing-internal/test/browser/request.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable deprecation/deprecation */
import * as sentryCore from '@sentry/core';
import type { HandlerDataFetch, SentryWrappedXMLHttpRequest } from '@sentry/types';
import type { HandlerDataFetch, HandlerDataXhr, SentryWrappedXMLHttpRequest } from '@sentry/types';
import * as utils from '@sentry/utils';
import { SENTRY_XHR_DATA_KEY } from '@sentry/utils';

Expand Down
2 changes: 1 addition & 1 deletion packages/types/src/instrument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export interface SentryWrappedXMLHttpRequest {
// span id for the xhr request
__sentry_xhr_span_id__?: string;
setRequestHeader?: (key: string, val: string) => void;
getRequestHeader?: (key: string) => string;
getResponseHeader?: (key: string) => string | null;
}

// WARNING: When the shape of this type is changed bump the version in `SentryWrappedXMLHttpRequest`
Expand Down

0 comments on commit bcbf941

Please sign in to comment.