TracingHelper { public Span buildSpan(String operationName, byte[][] keys) { if (traceWithActiveSpanOnly && tracer.activeSpan() == null) { return NoopSpan.INSTANCE; } else { return builder(operationName) .withTag("keys", toString(keys)) .start(); } } TracingHelper(TracingConfiguration tracingConfiguration); Span buildSpan(String operationName, byte[][] keys); Span buildSpan(String operationName); Span buildSpan(String operationName, Object key); Span buildSpan(String operationName, byte[] key); Span buildSpan(String operationName, Object[] keys); static void onError(Throwable throwable, Span span); static String nullable(Object object); static String toString(Map<String, V> map); static String toString(byte[][] array); static String collectionToString(Collection<?> collection); static String toString(Collection<byte[]> collection); static String toString(List<String> list); static String toStringMap(Map<byte[], byte[]> map); static String toStringMap2(Map<byte[], V> map); static String mapToString(Map<K, V> map); T decorate(Span span, Supplier<T> supplier); void decorate(Span span, Action action); void decorateThrowing(Span span, ThrowingAction<T> action); V decorateThrowing(Span span, ThrowingSupplier<T, V> supplier); T doInScope(String command, byte[] key, Supplier<T> supplier); T doInScope(String command, Supplier<T> supplier); void doInScope(String command, byte[] key, Runnable runnable); void doInScope(String command, Runnable runnable); T doInScope(String command, byte[][] keys, Supplier<T> supplier); static final String COMPONENT_NAME; static final String DB_TYPE; }
@Test public void testPrefix() { span = (MockSpan) (helperWithProvider.buildSpan("get")); assertEquals("redis.get", span.operationName()); }
@Test public void testDefault() { span = (MockSpan) (helperWithoutProvider.buildSpan("get")); assertEquals("get", span.operationName()); }