test_class.declarator: configuration
test_class.modifier: private
test_class.original_string: private ConfigurationRegistry configuration;
test_class.type: ConfigurationRegistry
test_class.var_name: configuration
test_class.declarator: tracer
test_class.modifier: private
test_class.original_string: private io.opentracing.mock.MockTracer tracer;
test_class.type: io.opentracing.mock.MockTracer
test_class.var_name: tracer
test_class.declarator: servletPlugin
test_class.modifier: private
test_class.original_string: private ServletPlugin servletPlugin;
test_class.type: ServletPlugin
test_class.var_name: servletPlugin
test_class.file: stagemonitor-web-servlet/src/test/java/org/stagemonitor/web/servlet/MonitoredHttpRequestTest.java
test_class.identifier: MonitoredHttpRequestTest
test_case.body: @Test
  	public void testReferringSameHostSite() throws Exception {
  		final MockHttpServletRequest request = new MockHttpServletRequest("GET", "/test.js");
  		request.addHeader("Referer", "https://www.myapp.com:8080/categories");
  		request.setServerName("www.myapp.com");
  
  		final MonitoredHttpRequest monitoredHttpRequest = createMonitoredHttpRequest(request);
  
  		Span span = monitoredHttpRequest.createSpan();
  		Scope scope = tracer.scopeManager().activate(span);
  		span.finish();
  		scope.close();
  
  		assertEquals(1, tracer.finishedSpans().size());
  		final MockSpan mockSpan = tracer.finishedSpans().get(0);
  		assertNull(mockSpan.tags().get("http.referring_site"));
  	}
test_case.class_method_signature: MonitoredHttpRequestTest.testReferringSameHostSite()
test_case.full_signature: @Test public void testReferringSameHostSite()
test_case.identifier: testReferringSameHostSite
test_case.invocations: addHeader setServerName createMonitoredHttpRequest createSpan activate scopeManager finish close assertEquals size finishedSpans get finishedSpans assertNull get tags
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testReferringSameHostSite()
focal_class.declarator: logger = LoggerFactory.getLogger(MonitoredHttpRequest.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(MonitoredHttpRequest.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: CONNECTION_ID_ATTRIBUTE = "connectionId"
focal_class.modifier: public static final
focal_class.original_string: public static final String CONNECTION_ID_ATTRIBUTE = "connectionId";
focal_class.type: String
focal_class.var_name: CONNECTION_ID_ATTRIBUTE
focal_class.declarator: WIDGET_ALLOWED_ATTRIBUTE = "showWidgetAllowed"
focal_class.modifier: public static final
focal_class.original_string: public static final String WIDGET_ALLOWED_ATTRIBUTE = "showWidgetAllowed";
focal_class.type: String
focal_class.var_name: WIDGET_ALLOWED_ATTRIBUTE
focal_class.declarator: MONITORED_HTTP_REQUEST_ATTRIBUTE = "MonitoredHttpRequest"
focal_class.modifier: public static final
focal_class.original_string: public static final String MONITORED_HTTP_REQUEST_ATTRIBUTE = "MonitoredHttpRequest";
focal_class.type: String
focal_class.var_name: MONITORED_HTTP_REQUEST_ATTRIBUTE
focal_class.declarator: USER_AGENT_PARSED_FUTURE_ATTRIBUTE = MonitoredHttpRequest.class.getName() + ".userAgentParsedFuture"
focal_class.modifier: public static final
focal_class.original_string: public static final String USER_AGENT_PARSED_FUTURE_ATTRIBUTE = MonitoredHttpRequest.class.getName() + ".userAgentParsedFuture";
focal_class.type: String
focal_class.var_name: USER_AGENT_PARSED_FUTURE_ATTRIBUTE
focal_class.declarator: userAgentParser
focal_class.modifier: private static
focal_class.original_string: private static UserAgentParser userAgentParser;
focal_class.type: UserAgentParser
focal_class.var_name: userAgentParser
focal_class.declarator: httpServletRequest
focal_class.modifier: protected final
focal_class.original_string: protected final HttpServletRequest httpServletRequest;
focal_class.type: HttpServletRequest
focal_class.var_name: httpServletRequest
focal_class.declarator: filterChain
focal_class.modifier: protected final
focal_class.original_string: protected final FilterChain filterChain;
focal_class.type: FilterChain
focal_class.var_name: filterChain
focal_class.declarator: responseWrapper
focal_class.modifier: protected final
focal_class.original_string: protected final StatusExposingByteCountingServletResponse responseWrapper;
focal_class.type: StatusExposingByteCountingServletResponse
focal_class.var_name: responseWrapper
focal_class.declarator: servletPlugin
focal_class.modifier: protected final
focal_class.original_string: protected final ServletPlugin servletPlugin;
focal_class.type: ServletPlugin
focal_class.var_name: servletPlugin
focal_class.declarator: tracingPlugin
focal_class.modifier: private final
focal_class.original_string: private final TracingPlugin tracingPlugin;
focal_class.type: TracingPlugin
focal_class.var_name: tracingPlugin
focal_class.declarator: userAgentHeader
focal_class.modifier: private final
focal_class.original_string: private final String userAgentHeader;
focal_class.type: String
focal_class.var_name: userAgentHeader
focal_class.declarator: connectionId
focal_class.modifier: private final
focal_class.original_string: private final String connectionId;
focal_class.type: String
focal_class.var_name: connectionId
focal_class.declarator: widgetAndStagemonitorEndpointsAllowed
focal_class.modifier: private final
focal_class.original_string: private final boolean widgetAndStagemonitorEndpointsAllowed;
focal_class.type: boolean
focal_class.var_name: widgetAndStagemonitorEndpointsAllowed
focal_class.declarator: clientIp
focal_class.modifier: private final
focal_class.original_string: private final String clientIp;
focal_class.type: String
focal_class.var_name: clientIp
focal_class.declarator: userAgentParsingExecutor
focal_class.modifier: private final
focal_class.original_string: private final ExecutorService userAgentParsingExecutor;
focal_class.type: ExecutorService
focal_class.var_name: userAgentParsingExecutor
focal_class.file: stagemonitor-web-servlet/src/main/java/org/stagemonitor/web/servlet/MonitoredHttpRequest.java
focal_class.identifier: MonitoredHttpRequest
focal_class.class_method_signature: MonitoredHttpRequest.MonitoredHttpRequest(HttpServletRequest httpServletRequest,
  								StatusExposingByteCountingServletResponse responseWrapper,
  								FilterChain filterChain, ConfigurationRegistry configuration, ExecutorService userAgentParsingExecutor)
focal_class.full_signature: public  MonitoredHttpRequest(HttpServletRequest httpServletRequest,
  								StatusExposingByteCountingServletResponse responseWrapper,
  								FilterChain filterChain, ConfigurationRegistry configuration, ExecutorService userAgentParsingExecutor)
focal_class.identifier: MonitoredHttpRequest
focal_class.modifiers: public
focal_class.parameters: (HttpServletRequest httpServletRequest,
  								StatusExposingByteCountingServletResponse responseWrapper,
  								FilterChain filterChain, ConfigurationRegistry configuration, ExecutorService userAgentParsingExecutor)
focal_class.signature:  MonitoredHttpRequest(HttpServletRequest httpServletRequest,
  								StatusExposingByteCountingServletResponse responseWrapper,
  								FilterChain filterChain, ConfigurationRegistry configuration, ExecutorService userAgentParsingExecutor)
focal_class.class_method_signature: MonitoredHttpRequest.createSpan()
focal_class.full_signature: @Override public Span createSpan()
focal_class.identifier: createSpan
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Span
focal_class.signature: Span createSpan()
focal_class.class_method_signature: MonitoredHttpRequest.parseUserAgentAsync(final Span span, SpanContextInformation info)
focal_class.full_signature: private void parseUserAgentAsync(final Span span, SpanContextInformation info)
focal_class.identifier: parseUserAgentAsync
focal_class.modifiers: private
focal_class.parameters: (final Span span, SpanContextInformation info)
focal_class.return: void
focal_class.signature: void parseUserAgentAsync(final Span span, SpanContextInformation info)
focal_class.class_method_signature: MonitoredHttpRequest.getReferringSite()
focal_class.full_signature: private String getReferringSite()
focal_class.identifier: getReferringSite
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getReferringSite()
focal_class.class_method_signature: MonitoredHttpRequest.getClientIp(HttpServletRequest request)
focal_class.full_signature: public static String getClientIp(HttpServletRequest request)
focal_class.identifier: getClientIp
focal_class.modifiers: public static
focal_class.parameters: (HttpServletRequest request)
focal_class.return: String
focal_class.signature: String getClientIp(HttpServletRequest request)
focal_class.class_method_signature: MonitoredHttpRequest.getFirstIp(String ip)
focal_class.full_signature: private static String getFirstIp(String ip)
focal_class.identifier: getFirstIp
focal_class.modifiers: private static
focal_class.parameters: (String ip)
focal_class.return: String
focal_class.signature: String getFirstIp(String ip)
focal_class.class_method_signature: MonitoredHttpRequest.getIpFromHeaderIfNotAlreadySet(String header, HttpServletRequest request, String ip)
focal_class.full_signature: private static String getIpFromHeaderIfNotAlreadySet(String header, HttpServletRequest request, String ip)
focal_class.identifier: getIpFromHeaderIfNotAlreadySet
focal_class.modifiers: private static
focal_class.parameters: (String header, HttpServletRequest request, String ip)
focal_class.return: String
focal_class.signature: String getIpFromHeaderIfNotAlreadySet(String header, HttpServletRequest request, String ip)
focal_class.class_method_signature: MonitoredHttpRequest.getRequestName()
focal_class.full_signature: public String getRequestName()
focal_class.identifier: getRequestName
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getRequestName()
focal_class.class_method_signature: MonitoredHttpRequest.getRequestNameByRequest(HttpServletRequest request, ServletPlugin servletPlugin)
focal_class.full_signature: public static String getRequestNameByRequest(HttpServletRequest request, ServletPlugin servletPlugin)
focal_class.identifier: getRequestNameByRequest
focal_class.modifiers: public static
focal_class.parameters: (HttpServletRequest request, ServletPlugin servletPlugin)
focal_class.return: String
focal_class.signature: String getRequestNameByRequest(HttpServletRequest request, ServletPlugin servletPlugin)
focal_class.class_method_signature: MonitoredHttpRequest.removeSemicolonContent(String requestUri)
focal_class.full_signature: public static String removeSemicolonContent(String requestUri)
focal_class.identifier: removeSemicolonContent
focal_class.modifiers: public static
focal_class.parameters: (String requestUri)
focal_class.return: String
focal_class.signature: String removeSemicolonContent(String requestUri)
focal_class.class_method_signature: MonitoredHttpRequest.getHeaders(HttpServletRequest request)
focal_class.full_signature: private Map<String, String> getHeaders(HttpServletRequest request)
focal_class.identifier: getHeaders
focal_class.modifiers: private
focal_class.parameters: (HttpServletRequest request)
focal_class.return: Map<String, String>
focal_class.signature: Map<String, String> getHeaders(HttpServletRequest request)
focal_class.class_method_signature: MonitoredHttpRequest.execute()
focal_class.full_signature: @Override public void execute()
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void execute()
focal_class.class_method_signature: MonitoredHttpRequest.setUserAgentInformation(Span span, String userAgenHeader)
focal_class.full_signature: private void setUserAgentInformation(Span span, String userAgenHeader)
focal_class.identifier: setUserAgentInformation
focal_class.modifiers: private
focal_class.parameters: (Span span, String userAgenHeader)
focal_class.return: void
focal_class.signature: void setUserAgentInformation(Span span, String userAgenHeader)
focal_class.superclass: extends MonitoredRequest
focal_method.body: @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;
  	}
focal_method.class_method_signature: MonitoredHttpRequest.createSpan()
focal_method.full_signature: @Override public Span createSpan()
focal_method.identifier: createSpan
focal_method.invocations: isHonorDoNotTrackHeader equals getHeader getTracer extract withTag asChildOf buildSpan getRequestName getKey withTag withTag getKey withTag start set getRequestURI set getRemotePort setTag getMethod setTag getReferringSite isCollectHttpHeaders setHttpHeaders getHeaders forSpan addRequestAttribute addRequestAttribute isSampled isParseUserAgent isNotEmpty parseUserAgentAsync
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: Span
focal_method.signature: Span createSpan()