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

5/11/2018

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.

-- haru
google-kubernetes-engine
ruby
ruby-on-rails
stackdriver

2 Answers

8/29/2018

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.

-- Tarek N. Elsamni
Source: StackOverflow

5/11/2018

According to the documentation, you also need to do the following:

# In application.rb
require "stackdriver"
-- R.F. Nelson
Source: StackOverflow