Changed Zipkin API a bit, now requires a TraceContext rather than a Span before sync/async calls.
This commit is contained in:
parent
cbc246f1c0
commit
2ebae2aaef
3 changed files with 9 additions and 9 deletions
|
@ -53,7 +53,7 @@ public abstract class AbstractOptionalOperation<E, O extends AbstractOptionalOpe
|
|||
|
||||
public Optional<E> sync() {
|
||||
Tracer tracer = this.sessionOps.getZipkinTracer();
|
||||
final Span cassandraSpan = (tracer != null && span != null) ? tracer.newChild(span.context()) : null;
|
||||
final Span cassandraSpan = (tracer != null && traceContext != null) ? tracer.newChild(traceContext) : null;
|
||||
if (cassandraSpan != null) {
|
||||
cassandraSpan.name("cassandra");
|
||||
cassandraSpan.start();
|
||||
|
@ -71,7 +71,7 @@ public abstract class AbstractOptionalOperation<E, O extends AbstractOptionalOpe
|
|||
|
||||
public ListenableFuture<Optional<E>> async() {
|
||||
final Tracer tracer = this.sessionOps.getZipkinTracer();
|
||||
final Span cassandraSpan = (tracer != null && span != null) ? tracer.newChild(span.context()) : null;
|
||||
final Span cassandraSpan = (tracer != null && traceContext != null) ? tracer.newChild(traceContext) : null;
|
||||
if (cassandraSpan != null) {
|
||||
cassandraSpan.name("cassandra");
|
||||
cassandraSpan.start();
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
*/
|
||||
package net.helenus.core.operation;
|
||||
|
||||
import brave.Span;
|
||||
import brave.Tracer;
|
||||
import brave.propagation.TraceContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -44,7 +44,7 @@ public abstract class AbstractStatementOperation<E, O extends AbstractStatementO
|
|||
public abstract Statement buildStatement();
|
||||
|
||||
protected boolean showValues = true;
|
||||
protected Span span;
|
||||
protected TraceContext traceContext;
|
||||
private ConsistencyLevel consistencyLevel;
|
||||
private ConsistencyLevel serialConsistencyLevel;
|
||||
private RetryPolicy retryPolicy;
|
||||
|
@ -215,11 +215,11 @@ public abstract class AbstractStatementOperation<E, O extends AbstractStatementO
|
|||
return statement;
|
||||
}
|
||||
|
||||
public O withinSpan(Span span) {
|
||||
if (span != null) {
|
||||
public O zipkinContext(TraceContext traceContext) {
|
||||
if (traceContext != null) {
|
||||
Tracer tracer = this.sessionOps.getZipkinTracer();
|
||||
if (tracer != null) {
|
||||
this.span = span;
|
||||
this.traceContext = traceContext;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public abstract class AbstractStreamOperation<E, O extends AbstractStreamOperati
|
|||
|
||||
public Stream<E> sync() {
|
||||
Tracer tracer = this.sessionOps.getZipkinTracer();
|
||||
final Span cassandraSpan = (tracer != null && span != null) ? tracer.newChild(span.context()) : null;
|
||||
final Span cassandraSpan = (tracer != null && traceContext != null) ? tracer.newChild(traceContext) : null;
|
||||
if (cassandraSpan != null) {
|
||||
cassandraSpan.name("cassandra");
|
||||
cassandraSpan.start();
|
||||
|
@ -72,7 +72,7 @@ public abstract class AbstractStreamOperation<E, O extends AbstractStreamOperati
|
|||
|
||||
public ListenableFuture<Stream<E>> async() {
|
||||
Tracer tracer = this.sessionOps.getZipkinTracer();
|
||||
final Span cassandraSpan = (tracer != null && span != null) ? tracer.newChild(span.context()) : null;
|
||||
final Span cassandraSpan = (tracer != null && traceContext != null) ? tracer.newChild(traceContext) : null;
|
||||
if (cassandraSpan != null) {
|
||||
cassandraSpan.name("cassandra");
|
||||
cassandraSpan.start();
|
||||
|
|
Loading…
Reference in a new issue