parent
2e86ca2141
commit
206fbb944c
|
@ -14,6 +14,10 @@ import net.bytebuddy.description.method.MethodDescription;
|
||||||
import net.bytebuddy.description.type.TypeDescription;
|
import net.bytebuddy.description.type.TypeDescription;
|
||||||
import net.bytebuddy.matcher.ElementMatcher;
|
import net.bytebuddy.matcher.ElementMatcher;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The InProcessTransport calls the client response in process, so we have to disable async
|
||||||
|
* propagation to allow spans to complete and be reported properly.
|
||||||
|
*/
|
||||||
@AutoService(Instrumenter.class)
|
@AutoService(Instrumenter.class)
|
||||||
public class InProcessServerStreamInstrumentation extends Instrumenter.Default {
|
public class InProcessServerStreamInstrumentation extends Instrumenter.Default {
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,6 @@ class GrpcStreamingTest extends AgentTestRunner {
|
||||||
|
|
||||||
(1..msgCount).each {
|
(1..msgCount).each {
|
||||||
if ((testTracer.scopeManager().active() as ContinuableScope).isAsyncPropagating()) {
|
if ((testTracer.scopeManager().active() as ContinuableScope).isAsyncPropagating()) {
|
||||||
// The InProcessTransport calls the client response in process, so we have to disable async propagation.
|
|
||||||
observer.onNext(value)
|
observer.onNext(value)
|
||||||
} else {
|
} else {
|
||||||
observer.onError(new IllegalStateException("not async propagating!"))
|
observer.onError(new IllegalStateException("not async propagating!"))
|
||||||
|
@ -46,7 +45,6 @@ class GrpcStreamingTest extends AgentTestRunner {
|
||||||
@Override
|
@Override
|
||||||
void onError(Throwable t) {
|
void onError(Throwable t) {
|
||||||
if ((testTracer.scopeManager().active() as ContinuableScope).isAsyncPropagating()) {
|
if ((testTracer.scopeManager().active() as ContinuableScope).isAsyncPropagating()) {
|
||||||
// The InProcessTransport calls the client response in process, so we have to disable async propagation.
|
|
||||||
error.set(t)
|
error.set(t)
|
||||||
observer.onError(t)
|
observer.onError(t)
|
||||||
} else {
|
} else {
|
||||||
|
@ -57,7 +55,6 @@ class GrpcStreamingTest extends AgentTestRunner {
|
||||||
@Override
|
@Override
|
||||||
void onCompleted() {
|
void onCompleted() {
|
||||||
if ((testTracer.scopeManager().active() as ContinuableScope).isAsyncPropagating()) {
|
if ((testTracer.scopeManager().active() as ContinuableScope).isAsyncPropagating()) {
|
||||||
// The InProcessTransport calls the client response in process, so we have to disable async propagation.
|
|
||||||
observer.onCompleted()
|
observer.onCompleted()
|
||||||
} else {
|
} else {
|
||||||
observer.onError(new IllegalStateException("not async propagating!"))
|
observer.onError(new IllegalStateException("not async propagating!"))
|
||||||
|
|
Loading…
Reference in New Issue