Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
YifeiZhuang committed Sep 10, 2024
1 parent 5a8cc17 commit 5509b8f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
6 changes: 1 addition & 5 deletions opentelemetry/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ plugins {

description = 'gRPC: OpenTelemetry'

test.testLogging.showStandardStreams(true)

dependencies {
api project(':grpc-api')
implementation libraries.guava,
Expand All @@ -21,9 +19,7 @@ dependencies {
testFixtures(project(':grpc-core')),
testFixtures(project(':grpc-api')),
libraries.opentelemetry.sdk.testing,
libraries.assertj.core
testImplementation project(path: ':grpc-api')
// opentelemetry.sdk.testing uses compileOnly for assertj
libraries.assertj.core // opentelemetry.sdk.testing uses compileOnly for assertj

annotationProcessor libraries.auto.value

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ private GrpcOpenTelemetry(Builder builder) {
this.optionalLabels = ImmutableList.copyOf(builder.optionalLabels);
this.openTelemetryMetricsModule = new OpenTelemetryMetricsModule(
STOPWATCH_SUPPLIER, resource, optionalLabels, builder.plugins);
this.sink = new OpenTelemetryMetricSink(meter, enableMetrics, disableDefault, optionalLabels);
this.openTelemetryTracingModule = new OpenTelemetryTracingModule(openTelemetrySdk);
this.sink = new OpenTelemetryMetricSink(meter, enableMetrics, disableDefault, optionalLabels);
}

@VisibleForTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -703,8 +703,7 @@ public void onComplete() {
when(handler.startCall(any(), any())).thenReturn(getContextListener);
ServerCall<Integer, Integer> call = new NoopServerCall<>();
Metadata metadata = new Metadata();
ServerCall.Listener<Integer> listener =
interceptor.interceptCall(call, metadata, handler);
ServerCall.Listener<Integer> listener = interceptor.interceptCall(call, metadata, handler);
verify(handler).startCall(same(call), same(metadata));
listener.onMessage(1);
assertEquals(callbackSpan.get(), Span.getInvalid());
Expand All @@ -718,7 +717,8 @@ public void onComplete() {
assertEquals(callbackSpan.get(), Span.getInvalid());

Span parentSpan = tracerRule.spanBuilder("parent-span").startSpan();
io.grpc.Context context = io.grpc.Context.current().withValue(tracingModule.otelSpan, parentSpan);
io.grpc.Context context = io.grpc.Context.current().withValue(
tracingModule.otelSpan, parentSpan);
io.grpc.Context previous = context.attach();
try {
listener = interceptor.interceptCall(call, metadata, handler);
Expand Down

0 comments on commit 5509b8f

Please sign in to comment.