function _sw_request()

in src/plugins/HttpPlugin.ts [161:174]


      function _sw_request(this: any, req: IncomingMessage, res: ServerResponse, ...reqArgs: any[]) {
        const carrier = ContextCarrier.from((req as any).headers || {});
        const reqMethod = req.method ?? 'GET';
        const operation = reqMethod + ':' + (req.url || '/').replace(/\?.*/g, '');
        const span = ignoreHttpMethodCheck(reqMethod)
          ? DummySpan.create()
          : ContextManager.current.newEntrySpan(operation, carrier);

        span.component = Component.HTTP_SERVER;

        span.tag(Tag.httpURL(protocol + '://' + (req.headers.host || '') + req.url));

        return plugin.wrapHttpResponse(span, req, res, () => handler.call(this, req, res, ...reqArgs));
      }