@@ -34,14 +34,20 @@ interface HttpOptions {
34
34
/**
35
35
* Do not capture spans or breadcrumbs for outgoing HTTP requests to URLs where the given callback returns `true`.
36
36
* This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.
37
+ *
38
+ * The `url` param contains the entire URL, including query string (if any), protocol, host, etc. of the outgoing request.
39
+ * For example: `'https://someService.com/users/details?id=123'`
37
40
*/
38
41
ignoreOutgoingRequests ?: ( url : string ) => boolean ;
39
42
40
43
/**
41
44
* Do not capture spans or breadcrumbs for incoming HTTP requests to URLs where the given callback returns `true`.
42
45
* This controls both span & breadcrumb creation - spans will be non recording if tracing is disabled.
46
+ *
47
+ * The `url` param consists of the URL path and query string (if any) of the incoming request.
48
+ * For example: `'/users/details?id=123'`
43
49
*/
44
- ignoreIncomingRequests ?: ( url : string ) => boolean ;
50
+ ignoreIncomingRequests ?: ( urlPath : string ) => boolean ;
45
51
46
52
/**
47
53
* Additional instrumentation options that are passed to the underlying HttpInstrumentation.
@@ -103,7 +109,9 @@ export const instrumentHttp = Object.assign(
103
109
} ,
104
110
105
111
ignoreIncomingRequestHook : request => {
106
- const url = request . url ;
112
+ // request.url is the only property that holds any information about the url
113
+ // it only consists of the URL path and query string (if any)
114
+ const urlPath = request . url ;
107
115
108
116
const method = request . method ?. toUpperCase ( ) ;
109
117
// We do not capture OPTIONS/HEAD requests as transactions
@@ -112,7 +120,7 @@ export const instrumentHttp = Object.assign(
112
120
}
113
121
114
122
const _ignoreIncomingRequests = _httpOptions . ignoreIncomingRequests ;
115
- if ( url && _ignoreIncomingRequests && _ignoreIncomingRequests ( url ) ) {
123
+ if ( urlPath && _ignoreIncomingRequests && _ignoreIncomingRequests ( urlPath ) ) {
116
124
return true ;
117
125
}
118
126
0 commit comments