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 {
9393 this . _unload = registerInstrumentations ( {
9494 instrumentations : [
9595 new HttpInstrumentation ( {
96+ ignoreOutgoingRequestHook : request => {
97+ const host = request . host || request . hostname ;
98+ return isSentryHost ( host ) ;
99+ } ,
100+
96101 requireParentforOutgoingSpans : true ,
97102 requireParentforIncomingSpans : false ,
98103 requestHook : ( span , req ) => {
@@ -210,3 +215,11 @@ function getHttpUrl(attributes: Attributes): string | undefined {
210215 const url = attributes [ SemanticAttributes . HTTP_URL ] ;
211216 return typeof url === 'string' ? url : undefined ;
212217}
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