quarkiverse / quarkus-opentelemetry-exporter

Quarkus extensions related with additional OpenTelemetry exporters
Apache License 2.0
13 stars 8 forks source link

Error deploying Cloud Run with gcp exporter #83

Closed marcusricardoaguiar closed 9 months ago

marcusricardoaguiar commented 1 year ago

Hi,

I've been trying to deploy a cloud run instance with the gcp exporter but I'm getting the following issue: [io.ope.sdk.tra.exp.SimpleSpanProcessor] (vert.x-eventloop-thread-0) Exporter threw an Exception: com.google.api.gax.rpc.UnauthenticatedException: io.grpc.StatusRuntimeException: UNAUTHENTICATED: Failed computing credential metadata

These are the packages I've been using:

  <dependencies>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-resteasy-reactive</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-rest-client-reactive-jackson</artifactId>
    </dependency>
    <dependency>
      <groupId>io.quarkiverse.opentelemetry.exporter</groupId>
      <artifactId>quarkus-opentelemetry-exporter-gcp</artifactId>
      <version>2.0.0.Final</version>
    </dependency>
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-container-image-jib</artifactId>
    </dependency>
  </dependencies>

And I've defined the following parameters:

quarkus.opentelemetry.tracer.exporter.gcp.enabled = true
quarkus.opentelemetry.tracer.exporter.gcp.projectid = "test"
quarkus.opentelemetry.tracer.exporter.gcp.cloudrun = true
quarkus.opentelemetry.tracer.exporter.otlp.enabled = false

Is there any dependency package I have to add or any parameter that is missing.

t0xa commented 1 year ago

Hello,

I've noticed that the GCP's Project ID set to test. Do you really have such project?

If you are deploying your code directly to GCP, you can skip this property. It's only useful for local testing. The project name is set by CloudRun infra.

Hope this helps

marcusricardoaguiar commented 1 year ago

Hello,

I've noticed that the GCP's Project ID set to test. Do you really have such project?

If you are deploying your code directly to GCP, you can skip this property. It's only useful for local testing. The project name is set by CloudRun infra.

Hope this helps

Hi @t0xa , Yes. I've deployed it in GCP directly. I've also tried without this parameter and I'm also getting the same issue. Any idea what might be happening? Is there a specific quarkus version that I must use to make it work properly?

t0xa commented 1 year ago

Hi @marcusricardoaguiar

I've just tried to create sample project via the https://code.quarkus.io/ and deployed it to new project in GCP. It works as expected.

marcusricardoaguiar commented 1 year ago

Hi @marcusricardoaguiar

I've just tried to create sample project via the https://code.quarkus.io/ and deployed it to new project in GCP. It works as expected.

  • What are the quarkus versions you are using?
  • Are you using any other GCP libraries in the pom?
  • Does the Cloud Run service account in the IAM section have custom roles/permissions, or is it just an Editor.

Hi @t0xa , I've just tried using the sample project you've shared and it still shows the issue. Just to clarify, I was able to deploy the application, but when I try to hit /hello endpoint it shows the warning error when trying to export the traces: image

Don't you see any of these issues on your logs? Thanks!

t0xa commented 1 year ago

Hi,

Could you please check you IAM settings. What are the permissions for xxxxxx-compute@developer.gserviceaccount.com principal?

Do you have billing connected and enabled for your project?

How are you building the docker image? Quarkus maven plugin?

marcusricardoaguiar commented 1 year ago

Hi,

Could you please check you IAM settings. What are the permissions for xxxxxx-compute@developer.gserviceaccount.com principal?

Do you have billing connected and enabled for your project?

How are you building the docker image? Quarkus maven plugin?

Hi,

regarding the IAM setting, I'm using a specific service account for the cloud run and it has Owner permission. I'm using billed enabled for the project I'm using and regarding the docker image, I'm using this one:

    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-container-image-jib</artifactId>
    </dependency>

Are you using anything else to build the image? Regarding quakus maven plugin, I'm not using any different one. I've just downloaded the quarkus sample (V3), added this quakus lib to build the image and created the image using the following command:

 mvn package \
    -Pnative \
    -DskipTests \
    -Dquarkus.native.remote-container-build=true \
    -Dquarkus.container-image.build=true \
    -Dquarkus.container-image.registry="****" \
    -Dquarkus.container-image.group="*****" \
    -Dquarkus.container-image.tag=v1 \
    -Dquarkus.container-image.name=hello-world \
    -Dquarkus.container-image.push=true \
    -Dquarkus.container-image.builder=jib

Are you using a different approach?

t0xa commented 1 year ago

One of the differences I see, is that you are building native image. Could you please try to build standard image?

marcusricardoaguiar commented 1 year ago

One of the differences I see, is that you are building native image. Could you please try to build standard image?

Hi @t0xa, I was able to make it work just changing the mvn command to build/push the image:

 mvn package \
    -DskipTests \
    -Dquarkus.native.remote-container-build=true \
    -Dquarkus.container-image.build=true \
    -Dquarkus.container-image.registry="****" \
    -Dquarkus.container-image.group="*****" \
    -Dquarkus.container-image.tag=v1 \
    -Dquarkus.container-image.name=hello-world \
    -Dquarkus.container-image.push=true

Thank you so much!!!

t0xa commented 1 year ago

No problem, but it looks like the native image doesn't work :(

I will try to reproduce and fix this.

marcusricardoaguiar commented 1 year ago

No problem, but it looks like the native image doesn't work :(

I will try to reproduce and fix this.

Hi @t0xa , do you have news about this issue? Let me know if you need help testing this one. Thanks!

brunobat commented 1 year ago

We have a fix for the native image but we are stuck in a GraalVM bug now.