opentelemetry-java-instrumentation: gRPC trace missing

Spin off from https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/1550. gRPC client interceptor missing trace. Quoting @anuraaga’s comment:

have a feeling this is because of the switch off of using grpc context directly for OTel. So it’s time to implement a proper context bridge it’ll take some time.

Attached app can be used to reproduce the issue. Extract and run ./gradlew test from the root directory.

otel-grpc-tracing.zip

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 23 (11 by maintainers)

Most upvoted comments

Hi @ankitgaur-cer @asarkar - sorry for not getting to this until now. Actually 1.1.0 includes the context bridge, and I can run the repro and the test passes! @asarkar please confirm that the issue has been solved.

@iNikem Sorry, the detail QA verification is supposed to happen next week. I understand our scheduling is not your problem, so if you must, go ahead and close it, and if something horrible comes up, I’ll reopen it. However, it’d be nice if you could wait one more week. Up to you.

Hi @asarkar - looks like it was a bug in kotlin coroutines up to 1.4.2. I updated your code to 1.4.3 and the error goes away.

https://github.com/Kotlin/kotlinx.coroutines/releases/tag/1.4.3

ThreadContextElements are now restored in the opposite order from update (https://github.com/Kotlin/kotlinx.coroutines/issues/2195)