We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60644bf commit d0cfcd3Copy full SHA for d0cfcd3
packages/otel/src/instrumentations/http.ts
@@ -147,7 +147,14 @@ export class HttpInstrumentation implements Instrumentation {
147
148
private onRequest({ request }: { request: ClientRequest }): void {
149
const tracer = this.getTracer()
150
- if (!tracer) return
+ const url = new URL(request.path, `${request.protocol}//${request.host}`)
151
+
152
+ if (
153
+ !tracer ||
154
+ this.config.skipURLs?.some((skip) => (typeof skip == 'string' ? url.href.startsWith(skip) : skip.test(url.href)))
155
+ ) {
156
+ return
157
+ }
158
159
const span = tracer.startSpan(
160
this.getRequestMethod(request.method),
0 commit comments