@Test public void testConvertWeaselBeaconToSpan_withXHRBeacon() throws ServletException, IOException { MockHttpServletRequest mockHttpServletRequest = new MockHttpServletRequest(); mockHttpServletRequest.setParameter("r", "1496994284184"); mockHttpServletRequest.setParameter("k", "null"); mockHttpServletRequest.setParameter("ts", "21793"); mockHttpServletRequest.setParameter("d", "2084"); mockHttpServletRequest.setParameter("ty", "xhr"); mockHttpServletRequest.setParameter("pl", "d58cddae830273d1"); mockHttpServletRequest.setParameter("l", "http: mockHttpServletRequest.setParameter("m", "GET"); mockHttpServletRequest.setParameter("u", "http: mockHttpServletRequest.setParameter("a", "1"); mockHttpServletRequest.setParameter("st", "200"); mockHttpServletRequest.setParameter("e", "undefined"); mockHttpServletRequest.setParameter("m_user", "tom.mason@example.com"); mockHttpServletRequest.setParameter("t", "2d371455215c504"); mockHttpServletRequest.setParameter("s", "2d371455215c504"); servlet.doGet(mockHttpServletRequest, new MockHttpServletResponse()); assertSoftly(softly -> { final List<MockSpan> finishedSpans = mockTracer.finishedSpans(); softly.assertThat(finishedSpans).hasSize(1); MockSpan span = finishedSpans.get(0); softly.assertThat(span.operationName()).isEqualTo("/petclinic/owners.html"); softly.assertThat(span.finishMicros() - span.startMicros()).isEqualTo(TimeUnit.MILLISECONDS.toMicros(2084L)); softly.assertThat(span.tags()) .doesNotContainEntry(Tags.SAMPLING_PRIORITY.getKey(), 0) .containsEntry("type", "ajax") .containsEntry("http.status_code", 200L) .containsEntry("method", "GET") .containsEntry("xhr.requested_url", "http: .containsEntry("xhr.requested_from", "http: .containsEntry("xhr.async", true) .containsEntry("duration_ms", 2084L) .containsEntry("id", "2d371455215c504") .containsEntry("trace_id", "2d371455215c504"); }); }
@Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { handleRequest(req, resp); }
ClientSpanServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { handleRequest(req, resp); } }
ClientSpanServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { handleRequest(req, resp); } ClientSpanServlet();   ClientSpanServlet(TracingPlugin tracingPlugin, ServletPlugin servletPlugin); }
ClientSpanServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { handleRequest(req, resp); } ClientSpanServlet();   ClientSpanServlet(TracingPlugin tracingPlugin, ServletPlugin servletPlugin);  }
ClientSpanServlet extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { handleRequest(req, resp); } ClientSpanServlet();   ClientSpanServlet(TracingPlugin tracingPlugin, ServletPlugin servletPlugin);   }