File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,21 @@ provider.register();
1313
1414let expressInstrumentation = new ExpressInstrumentation ( ) ;
1515expressInstrumentation . setTracerProvider ( provider ) ;
16+
1617registerInstrumentations ( {
1718 instrumentations : [
1819 // Express instrumentation expects HTTP layer to be instrumented
19- new HttpInstrumentation ( ) ,
20+ new HttpInstrumentation ( {
21+ ignoreIncomingRequestHook : ( req ) => {
22+ return req . connection . localPort === 6060 ; // ignore incoming requests to prometheus
23+ } ,
24+ ignoreOutgoingRequestHook : ( req ) => {
25+ return ! [ // we care about performance of outgoing requests to those hosts only
26+ 'www.webpagetest.org' ,
27+ 'api.cloudinary.com'
28+ ] . includes ( req . hostname ) ;
29+ } ,
30+ } ) ,
2031 expressInstrumentation ,
2132 ] ,
2233} ) ;
You can’t perform that action at this time.
0 commit comments