/** * Start a span with the currently configured sampling frequency. Creates a new 'current' span * on this thread - the previous 'current' span will be replaced with this newly created span. * <p> * Hands back the direct span as you shouldn't be detaching the span - use {@link TraceRunnable} * instead to detach a span from this operation. * @param connection from which to read parameters * @param string description of the span to start * @return the underlying span. */ public static TraceScope startNewSpan(PhoenixConnection connection, String string) { Sampler<?> sampler = connection.getSampler(); TraceScope scope = Trace.startSpan(string, sampler); addCustomAnnotationsToSpan(scope.getSpan(), connection); return scope; }
assertEquals(traceId, rs.getLong("trace_id")); assertFalse(rs.next()); assertEquals(Sampler.ALWAYS, pconn.getSampler()); assertEquals(traceId, rs.getLong("trace_id")); assertFalse(rs.next()); assertEquals(Sampler.NEVER, pconn.getSampler()); assertTrue(((PhoenixConnection) conn1).getSampler() instanceof ProbabilitySampler); assertEquals(traceId, rs.getLong("trace_id")); assertFalse(rs.next()); assertEquals(Sampler.ALWAYS, pconn.getSampler()); assertTrue(((PhoenixConnection) conn1).getSampler() instanceof ProbabilitySampler); assertEquals(Sampler.NEVER, pconn.getSampler());
if (traceStatement.isTraceOn()) { conn.setSampler(Tracing.getConfiguredSampler(traceStatement)); if (conn.getSampler() == Sampler.NEVER) { closeTraceScope(conn); if (traceScope == null && !conn.getSampler().equals(Sampler.NEVER)) { traceScope = Tracing.startNewSpan(conn, "Enabling trace"); if (traceScope.getSpan() != null) {
/** * Start a span with the currently configured sampling frequency. Creates a new 'current' span * on this thread - the previous 'current' span will be replaced with this newly created span. * <p> * Hands back the direct span as you shouldn't be detaching the span - use {@link TraceRunnable} * instead to detach a span from this operation. * @param connection from which to read parameters * @param string description of the span to start * @return the underlying span. */ public static TraceScope startNewSpan(PhoenixConnection connection, String string) { Sampler<?> sampler = connection.getSampler(); TraceScope scope = Trace.startSpan(string, sampler); addCustomAnnotationsToSpan(scope.getSpan(), connection); return scope; }
/** * Start a span with the currently configured sampling frequency. Creates a new 'current' span * on this thread - the previous 'current' span will be replaced with this newly created span. * <p> * Hands back the direct span as you shouldn't be detaching the span - use {@link TraceRunnable} * instead to detach a span from this operation. * @param connection from which to read parameters * @param string description of the span to start * @return the underlying span. */ public static TraceScope startNewSpan(PhoenixConnection connection, String string) { Sampler<?> sampler = connection.getSampler(); TraceScope scope = Trace.startSpan(string, sampler); addCustomAnnotationsToSpan(scope.getSpan(), connection); return scope; }
if (traceStatement.isTraceOn()) { conn.setSampler(Tracing.getConfiguredSampler(traceStatement)); if (conn.getSampler() == Sampler.NEVER) { closeTraceScope(conn); if (traceScope == null && !conn.getSampler().equals(Sampler.NEVER)) { traceScope = Tracing.startNewSpan(conn, "Enabling trace"); if (traceScope.getSpan() != null) {
if (traceStatement.isTraceOn()) { conn.setSampler(Tracing.getConfiguredSampler(traceStatement)); if (conn.getSampler() == Sampler.NEVER) { closeTraceScope(conn); if (traceScope == null && !conn.getSampler().equals(Sampler.NEVER)) { traceScope = Tracing.startNewSpan(conn, "Enabling trace"); if (traceScope.getSpan() != null) {