Search code examples
ruby-on-railsrubystackdrivergoogle-kubernetes-engine

There are no data in Stackdriver Trace with rails and stackdriver gem


Developing rails application on GKE.

I installed stackdriver gem, however there are no logs in Stackdriver Trace....

In the application, I just added gem "stackdriver" to Gemfile and bundle install only.

When calling new, project_id and credntials are set here.

Also, in call, the send_trace method completed normally without any exceptions.

The application have been completed normally, but there is still no data at Stackdriver Trace.. Is there any probable cause? GKE settings?

trace.append and cloud-platform are included in oauthScopes of GKE's cluster. Stackdriver Logging API and Stackdriver Trace API is enabled.


Solution

  • I've had some troubles integrating Stackdriver to my rails app. Apparently the gem is using protobuf to send gRPC calls to Stackdriver's API. and there was a bug/issue in the gRPC client implementation that was preventing any API request to be sent if the integration is done as a Rails middleware.

    More details about this bug is found here:

    https://github.com/GoogleCloudPlatform/google-cloud-ruby/pull/2064

    I've fixed it and it's now released. You can use latest version and report if you still have issues/problems.