Skip to content

Commit

Permalink
Update grpc and jagger. (census-instrumentation#1222)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Drutu authored May 31, 2018
1 parent b8b5688 commit 1c416c0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
9 changes: 5 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ subprojects {
autoValueVersion = '1.4'
findBugsVersion = '3.0.1'
errorProneVersion = '2.2.0'
grpcVersion = '1.10.0'
grpcVersion = '1.12.0'
guavaVersion = '20.0'
googleAuthVersion = '0.9.1'
googleCloudVersion = '0.47.0-beta'
googleCloudVersion = '0.49.0-beta'
signalfxVersion = '0.0.39'
prometheusVersion = '0.4.0'
protobufVersion = '3.5.1'
zipkinReporterVersion = '2.3.2'
jaegerReporterVersion = '0.24.0'
jaegerReporterVersion = '0.27.0'

libraries = [
appengine_api: "com.google.appengine:appengine-api-1.0-sdk:${appengineVersion}",
Expand Down Expand Up @@ -207,7 +207,8 @@ subprojects {
// care for artifacts used as libraries by others.
if (!(project.name in ['benchmarks', 'opencensus-all',
'opencensus-exporter-stats-stackdriver',
'opencensus-exporter-trace-stackdriver'])) {
'opencensus-exporter-trace-stackdriver',
'opencensus-exporter-trace-jaeger'])) {
resolutionStrategy.failOnVersionConflict()
}
}
Expand Down
8 changes: 6 additions & 2 deletions exporters/trace/jaeger/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ sourceSets {
}

dependencies {
compile project(':opencensus-api'),
libraries.jaeger_reporter
compile project(':opencensus-api')

compile (libraries.jaeger_reporter) {
// Prefer library version.
exclude group: 'com.google.guava', module: 'guava'
}

testCompile project(':opencensus-api'),
'org.testcontainers:testcontainers:1.7.0',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.google.common.primitives.Ints;
import com.google.common.primitives.Longs;
import com.google.errorprone.annotations.MustBeClosed;
import com.uber.jaeger.exceptions.SenderException;
import com.uber.jaeger.senders.HttpSender;
import com.uber.jaeger.thriftjava.Log;
import com.uber.jaeger.thriftjava.Process;
Expand Down Expand Up @@ -57,7 +58,6 @@
import java.util.logging.Logger;
import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
import org.apache.thrift.TException;

@NotThreadSafe
final class JaegerExporterHandler extends SpanExporter.Handler {
Expand Down Expand Up @@ -139,7 +139,7 @@ public void export(final Collection<SpanData> spanDataList) {
final Scope exportScope = newExportScope();
try {
doExport(spanDataList);
} catch (TException e) {
} catch (SenderException e) {
tracer
.getCurrentSpan() // exportScope above.
.setStatus(Status.UNKNOWN.withDescription(getMessageOrDefault(e)));
Expand All @@ -157,12 +157,12 @@ private static Scope newExportScope() {
return tracer.spanBuilder(EXPORT_SPAN_NAME).setSampler(lowProbabilitySampler).startScopedSpan();
}

private void doExport(final Collection<SpanData> spanDataList) throws TException {
private void doExport(final Collection<SpanData> spanDataList) throws SenderException {
final List<Span> spans = spanDataToJaegerThriftSpans(spanDataList);
sender.send(process, spans);
}

private static String getMessageOrDefault(final TException e) {
private static String getMessageOrDefault(final SenderException e) {
return e.getMessage() == null ? e.getClass().getSimpleName() : e.getMessage();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.uber.jaeger.exceptions.SenderException;
import com.uber.jaeger.senders.HttpSender;
import com.uber.jaeger.thriftjava.Log;
import com.uber.jaeger.thriftjava.Process;
Expand All @@ -45,7 +46,6 @@
import io.opencensus.trace.TraceOptions;
import io.opencensus.trace.export.SpanData;
import java.util.List;
import org.apache.thrift.TException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentCaptor;
Expand All @@ -63,7 +63,7 @@ public class JaegerExporterHandlerTest {
@Captor private ArgumentCaptor<List<Span>> captor;

@Test
public void exportShouldConvertFromSpanDataToJaegerThriftSpan() throws TException {
public void exportShouldConvertFromSpanDataToJaegerThriftSpan() throws SenderException {
final long startTime = 1519629870001L;
final long endTime = 1519630148002L;
final SpanData spanData =
Expand Down

0 comments on commit 1c416c0

Please sign in to comment.