Create a new object for connecting to the Error Reporting
service. Each call creates a new connection.
For more information on connecting to Google Cloud see the
Authentication Guide.
Parameters
project_id (String) — Google Cloud Platform project identifier for
the Error Reporting service you are connecting to. If not
present, the default project for the credentials is used.
credentials (String, Hash, Google::Auth::Credentials) — The path to
the keyfile as a String, the contents of the keyfile as a Hash, or a
Google::Auth::Credentials object. (See ErrorReporting::Credentials)
scope (String, Array<String>) (defaults to: nil) —
require"google/cloud/error_reporting"error_reporting=Google::Cloud.error_reporting"GCP_Project_ID","/path/to/gcp/secretkey.json"error_event=error_reporting.error_event"Error with Backtrace",event_time:Time.now,service_name:"my_app_name",service_version:"v8"error_reporting.reporterror_event
require"google/cloud/error_reporting"gcloud=Google::Cloud.new"GCP_Project_ID","/path/to/gcp/secretkey.json"error_reporting=gcloud.error_reportingerror_event=error_reporting.error_event"Error with Backtrace",event_time:Time.now,service_name:"my_app_name",service_version:"v8"error_reporting.reporterror_event
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Error Reporting API - Module Google::Cloud (v0.44.0)\n\nVersion latestkeyboard_arrow_down\n\n- [0.44.0 (latest)](/ruby/docs/reference/google-cloud-error_reporting/latest/Google-Cloud)\n- [0.43.0](/ruby/docs/reference/google-cloud-error_reporting/0.43.0/Google-Cloud)\n- [0.42.3](/ruby/docs/reference/google-cloud-error_reporting/0.42.3/Google-Cloud) \nReference documentation and code samples for the Error Reporting API module Google::Cloud.\n\nMethods\n-------\n\n### .error_reporting\n\n def self.error_reporting(project_id = nil, credentials = nil, scope: nil, timeout: nil) -\u003e Google::Cloud::ErrorReporting::Project\n\nCreate a new object for connecting to the Error Reporting\nservice. Each call creates a new connection.\n\n\n\u003cbr /\u003e\n\nFor more information on connecting to Google Cloud see the\n[Authentication Guide](./AUTHENTICATION \"Authentication Guide\"). \n**Parameters**\n\n- **project_id** (String) --- Google Cloud Platform project identifier for the Error Reporting service you are connecting to. If not present, the default project for the credentials is used.\n- **credentials** (String, Hash, Google::Auth::Credentials) --- The path to the keyfile as a String, the contents of the keyfile as a Hash, or a Google::Auth::Credentials object. (See [ErrorReporting::Credentials](/ruby/docs/reference/google-cloud-error_reporting/latest/Google-Cloud-ErrorReporting-Credentials \"Google::Cloud::ErrorReporting::Credentials (class)\"))\n- **scope** (String, Array\\\u003cString\\\u003e) *(defaults to: nil)* ---\n\n The OAuth 2.0 scopes controlling the\n set of resources and operations that the connection can access. See\n [Using OAuth 2.0 to Access Google\n APIs](https://developers.google.com/identity/protocols/OAuth2).\n\n The default scope is:\n - `https://www.googleapis.com/auth/cloud-platform`\n- **timeout** (Integer) *(defaults to: nil)* --- Default timeout to use in requests. Optional. \n**Returns**\n\n- ([Google::Cloud::ErrorReporting::Project](./Google-Cloud-ErrorReporting-Project))\n**Example** \n\n```ruby\nrequire \"google/cloud/error_reporting\"\n\nerror_reporting =\n Google::Cloud.error_reporting \"GCP_Project_ID\",\n \"/path/to/gcp/secretkey.json\"\n\nerror_event = error_reporting.error_event \"Error with Backtrace\",\n event_time: Time.now,\n service_name: \"my_app_name\",\n service_version: \"v8\"\nerror_reporting.report error_event\n```\n\n### #error_reporting\n\n def error_reporting(scope: nil, timeout: nil) -\u003e Google::Cloud::ErrorReporting::Project\n\nCreate a new object for connecting to the Error Reporting\nservice. Each call creates a new connection.\n\n\n\u003cbr /\u003e\n\nFor more information on connecting to Google Cloud see the\n[Authentication Guide](./AUTHENTICATION \"Authentication Guide\"). \n**Parameters**\n\n- **scope** (String, Array\\\u003cString\\\u003e) *(defaults to: nil)* ---\n\n The OAuth 2.0 scopes controlling the\n set of resources and operations that the connection can access. See\n [Using OAuth 2.0 to Access Google\n APIs](https://developers.google.com/identity/protocols/OAuth2).\n\n The default scope is:\n - `https://www.googleapis.com/auth/cloud-platform`\n- **timeout** (Integer) *(defaults to: nil)* --- Default timeout to use in requests. Optional. \n**Returns**\n\n- ([Google::Cloud::ErrorReporting::Project](./Google-Cloud-ErrorReporting-Project))\n**Example** \n\n```ruby\nrequire \"google/cloud/error_reporting\"\n\ngcloud = Google::Cloud.new \"GCP_Project_ID\",\n \"/path/to/gcp/secretkey.json\"\nerror_reporting = gcloud.error_reporting\n\nerror_event = error_reporting.error_event \"Error with Backtrace\",\n event_time: Time.now,\n service_name: \"my_app_name\",\n service_version: \"v8\"\nerror_reporting.report error_event\n```"]]