fix(firestore): cross-support opentelemetry-instrumentation-grpc 2.25.0+ - #13362
fix(firestore): cross-support opentelemetry-instrumentation-grpc 2.25.0+#13362exoego wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request introduces a reflection-based fallback mechanism in EnabledTraceUtil to support both older (< 2.25.0) and newer (>= 2.25.0) versions of opentelemetry-instrumentation-grpc-1.6 by dynamically resolving either createClientInterceptor or newClientInterceptor. It also adds matrix-test profiles in pom.xml to verify compatibility across these versions and includes a unit test to exercise the fallback logic. There are no review comments, so no additional feedback is provided.
|
@MarkDuckworth Hello. Can you take a look on this? |
|
@wu-hui @blakeli0 @jinseopkim0 Hello. Can I get a review on this? |
GrpcTelemetry renamed newClientInterceptor to createClientInterceptor in opentelemetry-instrumentation-grpc-1.6 2.25.0-alpha with no deprecated alias, so EnabledTraceUtil resolves the method reflectively. The build only sees the version google-cloud-shared-dependencies manages, so a new job runs the unit tests against one release on each side of the rename. It overrides the managed version with a maven property, the same way the nightly protobuf compatibility check passes -Dprotobuf.version.
a660cf6 to
e387780
Compare
Problem
GrpcTelemetry#newClientInterceptorwas removed in 2.25.0 and replaced withcreateClientInterceptor, causing NoSuchMethodError at runtime when users bring in opentelemetry-instrumentation-grpc 2.25.0 or later.Fix
Resolve the method via reflection at class init so the same artifact works across both API versions.