Java Code Examples for io.opentracing.Span#setTag()

The following examples show how to use io.opentracing.Span#setTag() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TracingJedisWrapper.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Override
public ScanResult<Tuple> zscan(String key, String cursor, ScanParams params) {
  Span span = helper.buildSpan("zscan", key);
  span.setTag("cursor", cursor);
  span.setTag("params", TracingHelper.toString(params.getParams()));
  return helper.decorate(span, () -> wrapped.zscan(key, cursor, params));
}
 
Example 2
Source File: TracingRedisAdvancedClusterCommands.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Override
@Deprecated
public Long zcount(K key, String min, String max) {
  Span span = helper.buildSpan("zcount", key);
  span.setTag("min", min);
  span.setTag("max", max);
  try {
    return commands.zcount(key, min, max);
  } catch (Exception e) {
    onError(e, span);
    throw e;
  } finally {
    span.finish();
  }
}
 
Example 3
Source File: TracingRedisCommands.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Override
public V lindex(K key, long index) {
  Span span = helper.buildSpan("lindex", key);
  span.setTag("index", index);
  try {
    return commands.lindex(key, index);
  } catch (Exception e) {
    onError(e, span);
    throw e;
  } finally {
    span.finish();
  }
}
 
Example 4
Source File: TracingJedisWrapper.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Override
public List<GeoRadiusResponse> georadiusReadonly(String key, double longitude, double latitude,
    double radius, GeoUnit unit) {
  Span span = helper.buildSpan("georadiusReadonly", key);
  span.setTag("longitude", longitude);
  span.setTag("latitude", latitude);
  span.setTag("radius", radius);
  span.setTag("unit", unit.name());
  return helper
      .decorate(span, () -> wrapped.georadiusReadonly(key, longitude, latitude, radius, unit));
}
 
Example 5
Source File: TracingJedisWrapper.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Override
public Long hsetnx(byte[] key, byte[] field, byte[] value) {
  Span span = helper.buildSpan("hsetnx", key);
  span.setTag("field", Arrays.toString(field));
  span.setTag("value", Arrays.toString(value));
  return helper.decorate(span, () -> wrapped.hsetnx(key, field, value));
}
 
Example 6
Source File: CacheBasedDeviceConnectionClient.java    From hono with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public Future<Boolean> removeCommandHandlingAdapterInstance(final String deviceId, final String adapterInstanceId,
        final SpanContext context) {
    final Span span = newSpan(context, SPAN_NAME_REMOVE_CMD_HANDLING_ADAPTER_INSTANCE);
    TracingHelper.setDeviceTags(span, tenantId, deviceId);
    span.setTag(MessageHelper.APP_PROPERTY_ADAPTER_INSTANCE_ID, adapterInstanceId);
    return finishSpan(cache.removeCommandHandlingAdapterInstance(tenantId, deviceId, adapterInstanceId, span), span);
}
 
Example 7
Source File: TracingRBitSet.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Override
public void clear(long fromIndex, long toIndex) {
  Span span = tracingRedissonHelper.buildSpan("clear", bitSet);
  span.setTag("fromIndex", fromIndex);
  span.setTag("toIndex", toIndex);
  tracingRedissonHelper.decorate(span, () -> bitSet.clear(fromIndex, toIndex));
}
 
Example 8
Source File: TracingRedisAsyncCommands.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Override
public String select(int db) {
  Span span = helper.buildSpan("select");
  span.setTag("db", db);
  try {
    return commands.select(db);
  } catch (Exception e) {
    onError(e, span);
    throw e;
  } finally {
    span.finish();
  }
}
 
Example 9
Source File: TracingJedisCluster.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Override
public Double geodist(String key, String member1, String member2) {
  Span span = helper.buildSpan("geodist", key);
  span.setTag("member1", member1);
  span.setTag("member2", member2);
  try {
    return super.geodist(key, member1, member2);
  } catch (Exception e) {
    onError(e, span);
    throw e;
  } finally {
    span.finish();
  }
}
 
Example 10
Source File: TracingJedisCluster.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Override
public List<String> blpop(String arg) {
  Span span = helper.buildSpan("blpop");
  span.setTag("arg", arg);
  try {
    return super.blpop(arg);
  } catch (Exception e) {
    onError(e, span);
    throw e;
  } finally {
    span.finish();
  }
}
 
Example 11
Source File: TracingJedisCluster.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Override
public ScanResult<Entry<String, String>> hscan(String key, String cursor, ScanParams params) {
  Span span = helper.buildSpan("hscan", key);
  span.setTag("cursor", cursor);
  span.setTag("params", TracingHelper.toString(params.getParams()));
  try {
    return super.hscan(key, cursor, params);
  } catch (Exception e) {
    onError(e, span);
    throw e;
  } finally {
    span.finish();
  }
}
 
Example 12
Source File: Hello.java    From opentracing-tutorial with Apache License 2.0 5 votes vote down vote up
private void sayHello(String helloTo) {
    Span span = tracer.buildSpan("say-hello").start();
    try (Scope scope = tracer.scopeManager().activate(span)) {
        span.setTag("hello-to", helloTo);

        String helloStr = formatString(helloTo);
        printHello(helloStr);
    } finally {
        span.finish();
    }
}
 
Example 13
Source File: TracingJedisCluster.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Override
public Long lrem(byte[] key, long count, byte[] value) {
  Span span = helper.buildSpan("lrem", key);
  span.setTag("count", count);
  span.setTag("value", Arrays.toString(value));
  try {
    return super.lrem(key, count, value);
  } catch (Exception e) {
    onError(e, span);
    throw e;
  } finally {
    span.finish();
  }
}
 
Example 14
Source File: TracingRedisAdvancedClusterCommands.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Override
public String clusterFailover(boolean force) {
  Span span = helper.buildSpan("clusterFailover");
  span.setTag("force", force);
  try {
    return commands.clusterFailover(force);
  } catch (Exception e) {
    onError(e, span);
    throw e;
  } finally {
    span.finish();
  }
}
 
Example 15
Source File: TracingRedisAsyncCommands.java    From java-redis-client with Apache License 2.0 5 votes vote down vote up
@Override
@Deprecated
public RedisFuture<List<ScoredValue<V>>> zrevrangebyscoreWithScores(
    K key, double max, double min) {
  Span span = helper.buildSpan("zrevrangebyscoreWithScores", key);
  span.setTag("max", max);
  span.setTag("min", min);
  return prepareRedisFuture(commands.zrevrangebyscoreWithScores(key, max, min), span);
}
 
Example 16
Source File: TracingJedisWrapper.java    From java-redis-client with Apache License 2.0 4 votes vote down vote up
@Override
public List<byte[]> blpop(byte[] arg) {
  Span span = helper.buildSpan("blpop");
  span.setTag("arg", Arrays.toString(arg));
  return helper.decorate(span, () -> wrapped.blpop(arg));
}
 
Example 17
Source File: TracingJedisWrapper.java    From java-redis-client with Apache License 2.0 4 votes vote down vote up
@Override
public String mset(byte[]... keysvalues) {
  Span span = helper.buildSpan("mset");
  span.setTag("keysvalues", TracingHelper.toString(keysvalues));
  return helper.decorate(span, () -> wrapped.mset(keysvalues));
}
 
Example 18
Source File: TracingRList.java    From java-redis-client with Apache License 2.0 4 votes vote down vote up
@Override
public RFuture<Boolean> containsAsync(Object o) {
  Span span = tracingRedissonHelper.buildSpan("containsAsync", list);
  span.setTag("object", nullable(o));
  return tracingRedissonHelper.prepareRFuture(span, () -> list.containsAsync(o));
}
 
Example 19
Source File: TracingRQueue.java    From java-redis-client with Apache License 2.0 4 votes vote down vote up
@Override
public boolean contains(Object o) {
  Span span = tracingRedissonHelper.buildSpan("contains", queue);
  span.setTag("object", nullable(o));
  return tracingRedissonHelper.decorate(span, () -> queue.contains(o));
}
 
Example 20
Source File: TracingRLexSortedSet.java    From java-redis-client with Apache License 2.0 4 votes vote down vote up
@Override
public RFuture<Boolean> removeAsync(Object o) {
  Span span = tracingRedissonHelper.buildSpan("removeAsync", set);
  span.setTag("object", nullable(o));
  return tracingRedissonHelper.prepareRFuture(span, () -> set.removeAsync(o));
}