Reference documentation and code samples for the Error Reporting API class Google::Cloud::ErrorReporting::ErrorEvent.
ErrorEvent
An individual error event to report to Error Reporting service.
Google::Cloud::ErrorReporting::ErrorEvent is able to be transformed
into the Google::Cloud::ErrorReporting::V1beta1::ReportedErrorEvent
gRPC structure. Once an error event is reported, the GCP
Error Reporting service is able to parse the message and
backtrace, then group the error events by content.
Inherits
- Object
Example
require "google/cloud/error_reporting" error_reporting = Google::Cloud::ErrorReporting.new error_event = error_reporting.error_event "Error with Backtrace", event_time: Time.now, service_name: "my_app_name", service_version: "v8" error_reporting.report error_event
Methods
.from_exception
def self.from_exception(exception) -> ErrorEvent
Construct an ErrorEvent object based on a given exception.
- exception (Exception) — A Ruby exception.
- (ErrorEvent) — An ErrorEvent object containing information from the given exception.
.from_grpc
def self.from_grpc(grpc) -> ErrorEvent
Build a new ErrorEvent from a
Google::Cloud::ErrorReporting::V1beta1::ReportedErrorEvent
object.
-
grpc (Google::Cloud::ErrorReporting::V1beta1::ReportedErrorEvent) — A
Google::Cloud::ErrorReporting::V1beta1::ReportedErrorEvent
object
- (ErrorEvent) — A new ErrorEvent instance derived from given grpc object
#event_time
def event_time()
Time when the event occurred. If not provided, the time when the event was received by the Error Reporting system will be used.
#event_time=
def event_time=(value)
Time when the event occurred. If not provided, the time when the event was received by the Error Reporting system will be used.
#file_path
def file_path()
The source code filename, which can include a truncated relative path, or a full path from a production machine.
#file_path=
def file_path=(value)
The source code filename, which can include a truncated relative path, or a full path from a production machine.
#function_name
def function_name()
Human-readable name of a function or method. The value can include optional context like the class or package name. For example, my.package.MyClass.method in case of Java.
#function_name=
def function_name=(value)
Human-readable name of a function or method. The value can include optional context like the class or package name. For example, my.package.MyClass.method in case of Java.
#http_method
def http_method()
The type of HTTP request, such as GET, POST, etc.
#http_method=
def http_method=(value)
The type of HTTP request, such as GET, POST, etc.
#http_referrer
def http_referrer()
The referrer information that is provided with the request.
#http_referrer=
def http_referrer=(value)
The referrer information that is provided with the request.
#http_remote_ip
def http_remote_ip()
The IP address from which the request originated. This can be IPv4, IPv6, or a token which is derived from the IP address, depending on the data that has been provided in the error report.
#http_remote_ip=
def http_remote_ip=(value)
The IP address from which the request originated. This can be IPv4, IPv6, or a token which is derived from the IP address, depending on the data that has been provided in the error report.
#http_status
def http_status()
The HTTP response status code for the request.
#http_status=
def http_status=(value)
The HTTP response status code for the request.
#http_url
def http_url()
The URL of the request.
#http_url=
def http_url=(value)
The URL of the request.
#http_user_agent
def http_user_agent()
The user agent information that is provided with the request.
#http_user_agent=
def http_user_agent=(value)
The user agent information that is provided with the request.
#line_number
def line_number()
1-based. 0 indicates that the line number is unknown.
#line_number=
def line_number=(value)
1-based. 0 indicates that the line number is unknown.
#message
def message()
A message describing the error. The message can contain an exception stack in one of the supported programming languages and formats. In that case, the message is parsed and detailed exception information is returned when retrieving the error event again.
#message=
def message=(value)
A message describing the error. The message can contain an exception stack in one of the supported programming languages and formats. In that case, the message is parsed and detailed exception information is returned when retrieving the error event again.
#service_name
def service_name()
An identifier of the service, such as the name of the executable, job, or Google App Engine service name. This field is expected to have a low number of values that are relatively stable over time, as opposed to version, which can be changed whenever new code is deployed.
#service_name=
def service_name=(value)
An identifier of the service, such as the name of the executable, job, or Google App Engine service name. This field is expected to have a low number of values that are relatively stable over time, as opposed to version, which can be changed whenever new code is deployed.
#service_version
def service_version()
Represents the source code version that the developer provided, which could represent a version label or a Git SHA-1 hash, for example.
#service_version=
def service_version=(value)
Represents the source code version that the developer provided, which could represent a version label or a Git SHA-1 hash, for example.
#to_grpc
def to_grpc() -> Google::Cloud::ErrorReporting::V1beta1::ReportedErrorEvent
Convert ErrorEvent object to gRPC struct.
- (Google::Cloud::ErrorReporting::V1beta1::ReportedErrorEvent) — gRPC struct that represent an ErrorEvent.
#user
def user()
The user who caused or was affected by the crash. This can be a user ID, an email address, or an arbitrary token that uniquely identifies the user. When sending an error report, leave this field empty if the user was not logged in. In this case the Error Reporting system will use other data, such as remote IP address, to distinguish affected users. See affectedUsersCount in ErrorGroupStats.
#user=
def user=(value)
The user who caused or was affected by the crash. This can be a user ID, an email address, or an arbitrary token that uniquely identifies the user. When sending an error report, leave this field empty if the user was not logged in. In this case the Error Reporting system will use other data, such as remote IP address, to distinguish affected users. See affectedUsersCount in ErrorGroupStats.