class MonitoredHttpRequest extends MonitoredRequest {

	@Override
	public Span createSpan() {
		boolean sample = true;
		if (servletPlugin.isHonorDoNotTrackHeader() && "1".equals(httpServletRequest.getHeader("dnt"))) {
			sample = false;
		}

		final Tracer tracer = tracingPlugin.getTracer();
		io.opentracing.SpanContext spanCtx = tracer.extract(Format.Builtin.HTTP_HEADERS, new HttpServletRequestTextMapExtractAdapter(httpServletRequest));
		Tracer.SpanBuilder spanBuilder = tracer.buildSpan(getRequestName())
				.asChildOf(spanCtx)
				.withTag(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_SERVER);
		if (widgetAndStagemonitorEndpointsAllowed) {
			// use null as value so that the tag is not really set
			spanBuilder = spanBuilder.withTag(WIDGET_ALLOWED_ATTRIBUTE, (String) null);
		}
		if (!sample) {
			spanBuilder = spanBuilder.withTag(Tags.SAMPLING_PRIORITY.getKey(), 0);
		}
		spanBuilder.withTag(SpanUtils.OPERATION_TYPE, "http");
		final Span span = spanBuilder.start();
		Tags.HTTP_URL.set(span, httpServletRequest.getRequestURI());
		Tags.PEER_PORT.set(span, httpServletRequest.getRemotePort());
		span.setTag("method", httpServletRequest.getMethod());
		span.setTag("http.referring_site", getReferringSite());
		if (servletPlugin.isCollectHttpHeaders()) {
			SpanUtils.setHttpHeaders(span, getHeaders(httpServletRequest));
		}

		SpanContextInformation info = SpanContextInformation.forSpan(span);
		info.addRequestAttribute(CONNECTION_ID_ATTRIBUTE, connectionId);
		info.addRequestAttribute(MONITORED_HTTP_REQUEST_ATTRIBUTE, this);
		if (tracingPlugin.isSampled(span) && servletPlugin.isParseUserAgent() && StringUtils.isNotEmpty(userAgentHeader)) {
			parseUserAgentAsync(span, info);
		}
		return span;
	}

	public  MonitoredHttpRequest(HttpServletRequest httpServletRequest,
								StatusExposingByteCountingServletResponse responseWrapper,
								FilterChain filterChain, ConfigurationRegistry configuration, ExecutorService userAgentParsingExecutor);

}