Skip to content

Commit d8b613e

Browse files
fix: logging adjustments
1 parent 8f3baa2 commit d8b613e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

app.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,21 @@ provider.register();
1313

1414
let expressInstrumentation = new ExpressInstrumentation();
1515
expressInstrumentation.setTracerProvider(provider);
16+
1617
registerInstrumentations({
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
});

0 commit comments

Comments
 (0)