@Test public void testDeactivated() throws Exception { doReturn(false).when(corePlugin).isStagemonitorActive(); final SpanContextInformation spanContext = requestMonitor.monitor(createMonitoredRequest()); assertNull(spanContext); }
public SpanContextInformation monitor(MonitoredRequest monitoredRequest) throws Exception { if (corePlugin.isStagemonitorActive()) { final long start = System.nanoTime(); final Span span = monitoredRequest.createSpan(); final Scope scope = tracingPlugin.getTracer().scopeManager().activate(span); try { final SpanContextInformation info = getSpanContextInformation(start, span); monitoredRequest.execute(); return info; } catch (Exception e) { recordException(e); throw e; } finally { monitorStop(scope, span); } } return null; }
RequestMonitor { public SpanContextInformation monitor(MonitoredRequest monitoredRequest) throws Exception { if (corePlugin.isStagemonitorActive()) { final long start = System.nanoTime(); final Span span = monitoredRequest.createSpan(); final Scope scope = tracingPlugin.getTracer().scopeManager().activate(span); try { final SpanContextInformation info = getSpanContextInformation(start, span); monitoredRequest.execute(); return info; } catch (Exception e) { recordException(e); throw e; } finally { monitorStop(scope, span); } } return null; } }
RequestMonitor { public SpanContextInformation monitor(MonitoredRequest monitoredRequest) throws Exception { if (corePlugin.isStagemonitorActive()) { final long start = System.nanoTime(); final Span span = monitoredRequest.createSpan(); final Scope scope = tracingPlugin.getTracer().scopeManager().activate(span); try { final SpanContextInformation info = getSpanContextInformation(start, span); monitoredRequest.execute(); return info; } catch (Exception e) { recordException(e); throw e; } finally { monitorStop(scope, span); } } return null; } RequestMonitor(ConfigurationRegistry configuration, Metric2Registry registry); private  RequestMonitor(ConfigurationRegistry configuration, Metric2Registry registry, TracingPlugin tracingPlugin); }
RequestMonitor { public SpanContextInformation monitor(MonitoredRequest monitoredRequest) throws Exception { if (corePlugin.isStagemonitorActive()) { final long start = System.nanoTime(); final Span span = monitoredRequest.createSpan(); final Scope scope = tracingPlugin.getTracer().scopeManager().activate(span); try { final SpanContextInformation info = getSpanContextInformation(start, span); monitoredRequest.execute(); return info; } catch (Exception e) { recordException(e); throw e; } finally { monitorStop(scope, span); } } return null; } RequestMonitor(ConfigurationRegistry configuration, Metric2Registry registry); private  RequestMonitor(ConfigurationRegistry configuration, Metric2Registry registry, TracingPlugin tracingPlugin); SpanContextInformation monitorStart(MonitoredRequest monitoredRequest); void monitorStop(); SpanContextInformation monitor(MonitoredRequest monitoredRequest); void recordException(Exception e); }
RequestMonitor { public SpanContextInformation monitor(MonitoredRequest monitoredRequest) throws Exception { if (corePlugin.isStagemonitorActive()) { final long start = System.nanoTime(); final Span span = monitoredRequest.createSpan(); final Scope scope = tracingPlugin.getTracer().scopeManager().activate(span); try { final SpanContextInformation info = getSpanContextInformation(start, span); monitoredRequest.execute(); return info; } catch (Exception e) { recordException(e); throw e; } finally { monitorStop(scope, span); } } return null; } RequestMonitor(ConfigurationRegistry configuration, Metric2Registry registry); private  RequestMonitor(ConfigurationRegistry configuration, Metric2Registry registry, TracingPlugin tracingPlugin); SpanContextInformation monitorStart(MonitoredRequest monitoredRequest); void monitorStop(); SpanContextInformation monitor(MonitoredRequest monitoredRequest); void recordException(Exception e);  }