File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
packages/node-experimental/src/integrations Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,11 @@ export class Http implements Integration {
93
93
this . _unload = registerInstrumentations ( {
94
94
instrumentations : [
95
95
new HttpInstrumentation ( {
96
+ ignoreOutgoingRequestHook : request => {
97
+ const host = request . host || request . hostname ;
98
+ return isSentryHost ( host ) ;
99
+ } ,
100
+
96
101
requireParentforOutgoingSpans : true ,
97
102
requireParentforIncomingSpans : false ,
98
103
requestHook : ( span , req ) => {
@@ -210,3 +215,11 @@ function getHttpUrl(attributes: Attributes): string | undefined {
210
215
const url = attributes [ SemanticAttributes . HTTP_URL ] ;
211
216
return typeof url === 'string' ? url : undefined ;
212
217
}
218
+
219
+ /**
220
+ * Checks whether given host points to Sentry server
221
+ */
222
+ function isSentryHost ( host : string | undefined ) : boolean {
223
+ const dsn = getCurrentHub ( ) . getClient ( ) ?. getDsn ( ) ;
224
+ return dsn && host ? host . includes ( dsn . host ) : false ;
225
+ }
You can’t perform that action at this time.
0 commit comments