Reputation: 1399
I try to implement google error reporting using stackdriver on GCE (ref : https://cloud.google.com/error-reporting/docs/setup/ruby#compute-engine).
And created a service account with generate a key and also already have setting IAM for Error Reporting write to it.
Try to provide the parameters to the staging environment config
config.google_cloud.use_error_reporting = true
config.google_cloud.error_reporting.project_id = ENV['STACKDRIVER_PROJECT_ID']
config.google_cloud.error_reporting.keyfile = "#{Dir.home}#{ENV['STACKDRIVER_KEY_FILE']}"
config.google_cloud.error_reporting.service_name = "service-name"
Make an error code on the controller looks like :
[88d1aac5-7d9f-4052-864f-9f5e51241e62] NameError (undefined local variable or method `test_error_reporting_stackdriver'
and also try on rails console :
2.6.5 :027 > promise = Google::Cloud::ErrorReporting.report Exception.new "Oh no!"
=> #<Concurrent::Promises::Future:0x00000000094cd728 pending>
2.6.5 :028 > promise.state
=> :fulfilled
but error not being reporting on my console.
Is there anything missing from my configuration?
note :
I've successfully implement google logging using the same service account, using :
config.google_cloud.use_logging = true
config.google_cloud.logging.project_id = ENV['STACKDRIVER_PROJECT_ID']
config.google_cloud.logging.keyfile = "#{Dir.home}#{ENV['STACKDRIVER_KEY_FILE']}"
Upvotes: 0
Views: 248
Reputation: 1399
Solved.
The config on application side is fine, I totally forgot for enable Google Error Reporting API https://console.cloud.google.com/apis/api/clouderrorreporting.googleapis.com/overview
that is the first thing and I'm missing it.
Upvotes: 1