GoogleCloudPlatform / java-docs-samples

Java and Kotlin Code samples used on cloud.google.com
https://cloud.google.com/java
Apache License 2.0
1.75k stars 2.82k forks source link

Need to fix dependency issues #7738

Closed suraj-pasuparthy closed 1 year ago

suraj-pasuparthy commented 1 year ago

In which file did you encounter the issue?

spanner/opencensus/src/main/java/com/example/spanner/opencensus/CaptureGrpcMetric.java

Did you change the file? If so, how?

No

Describe the issue

The GRPC metrics no longer show up with the latest version of spanner library. After testing, it was found that we need to change the dependencies for the metrics to work.

com.google.cloud google-cloud-spanner 6.37.0 io.opencensus opencensus-api 0.26.0
<dependency>
  <groupId>com.google.protobuf</groupId>
  <artifactId>protobuf-java</artifactId>
  <version>3.22.1</version>
</dependency>
<dependency>
  <groupId>io.opencensus</groupId>
  <artifactId>opencensus-impl</artifactId>
  <version>0.26.0</version>
  <scope>runtime</scope>
</dependency>
<dependency>
  <groupId>io.opencensus</groupId>
  <artifactId>opencensus-contrib-zpages</artifactId>
  <version>0.26.0</version>
</dependency>
<dependency>
  <groupId>io.opencensus</groupId>
  <artifactId>opencensus-exporter-trace-stackdriver</artifactId>
  <version>0.26.0</version>
</dependency>
<dependency>
  <groupId>io.opencensus</groupId>
  <artifactId>opencensus-exporter-stats-stackdriver</artifactId>
  <version>0.26.0</version>
</dependency>
<dependency>
  <groupId>io.grpc</groupId>
  <artifactId>grpc-census</artifactId>
  <version>1.53.0</version>
</dependency>
<dependency>
  <groupId>io.opencensus</groupId>
  <artifactId>opencensus-contrib-grpc-metrics</artifactId>
  <version>0.26.0</version>
</dependency>
kolea2 commented 1 year ago

Reassigning to @olavloite for triage.

olavloite commented 1 year ago

@rajatbhatta Would you mind taking a look at this?

rajatbhatta commented 1 year ago

As per internal documentation, most likely the cause of the issue is misconfiguration on the customer's end like not including critical dependency like grpc-census in their application. We don't have to modify any dependencies from the client libraries side. Thanks! Closing.