google-cloud-error_reporting 0.42.2 → 0.42.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/AUTHENTICATION.md +8 -26
- data/CHANGELOG.md +6 -0
- data/INSTRUMENTATION.md +7 -5
- data/LOGGING.md +2 -2
- data/OVERVIEW.md +6 -7
- data/lib/google/cloud/error_reporting/async_error_reporter.rb +3 -3
- data/lib/google/cloud/error_reporting/credentials.rb +1 -1
- data/lib/google/cloud/error_reporting/error_event.rb +2 -2
- data/lib/google/cloud/error_reporting/middleware.rb +3 -3
- data/lib/google/cloud/error_reporting/project.rb +3 -3
- data/lib/google/cloud/error_reporting/rails.rb +1 -1
- data/lib/google/cloud/error_reporting/service.rb +1 -1
- data/lib/google/cloud/error_reporting/version.rb +1 -1
- data/lib/google/cloud/error_reporting.rb +8 -8
- data/lib/google-cloud-error_reporting.rb +3 -3
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cce56a0b8b3e7314de07f18809d3ba2498967f24071e97bde49dcc57d45405c1
|
4
|
+
data.tar.gz: c1b1bc0dd026405773fd917f409ec156d15b21b86ec755220915288548d6b429
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 331d72f45ee8b835fa3951c57c883536fa2358166313059db2a8d942be055d7bf5f3d13af67d19e8a403c40467ea0d11a68f340a4eb0eca9186b666d54609e0f
|
7
|
+
data.tar.gz: 53316038cef223ad9d4b475501d7f76c974a610e8d967dc419d3947b52508c75af191f00f5ef13f168f3d53765b2d5d0a7ba240f9ea446d38f5521222b779270
|
data/.yardopts
CHANGED
data/AUTHENTICATION.md
CHANGED
@@ -125,15 +125,6 @@ To configure your system for this, simply:
|
|
125
125
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
126
126
|
*should* only be used during development.
|
127
127
|
|
128
|
-
[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
|
129
|
-
[dev-console]: https://console.cloud.google.com/project
|
130
|
-
|
131
|
-
[enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
|
132
|
-
|
133
|
-
[create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
|
134
|
-
[create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
|
135
|
-
[reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
|
136
|
-
|
137
128
|
## Creating a Service Account
|
138
129
|
|
139
130
|
Google Cloud requires a **Project ID** and **Service Account Credentials** to
|
@@ -144,31 +135,22 @@ If you are not running this client within [Google Cloud Platform
|
|
144
135
|
environments](#google-cloud-platform-environments), you need a Google
|
145
136
|
Developers service account.
|
146
137
|
|
147
|
-
1. Visit the [Google
|
138
|
+
1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
|
148
139
|
1. Create a new project or click on an existing project.
|
149
|
-
1. Activate the
|
140
|
+
1. Activate the menu in the upper left and select **APIs & Services**. From
|
150
141
|
here, you will enable the APIs that your application requires.
|
151
142
|
|
152
|
-
![Enable the APIs that your application requires][enable-apis]
|
153
|
-
|
154
143
|
*Note: You may need to enable billing in order to use these services.*
|
155
144
|
|
156
145
|
1. Select **Credentials** from the side navigation.
|
157
146
|
|
158
|
-
|
159
|
-
|
160
|
-
![Create a new service account][create-new-service-account]
|
161
|
-
|
162
|
-
![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
|
163
|
-
|
164
|
-
Find the "Add credentials" drop down and select "Service account" to be
|
165
|
-
guided through downloading a new JSON key file.
|
166
|
-
|
167
|
-
If you want to re-use an existing service account, you can easily generate a
|
168
|
-
new key file. Just select the account you wish to re-use, and click "Generate
|
169
|
-
new JSON key":
|
147
|
+
Find the "Create credentials" drop down near the top of the page, and select
|
148
|
+
"Service account" to be guided through downloading a new JSON key file.
|
170
149
|
|
171
|
-
|
150
|
+
If you want to re-use an existing service account, you can easily generate
|
151
|
+
a new key file. Just select the account you wish to re-use click the pencil
|
152
|
+
tool on the right side to edit the service account, select the **Keys** tab,
|
153
|
+
and then select **Add Key**.
|
172
154
|
|
173
155
|
The key file you download will be used by this library to authenticate API
|
174
156
|
requests and should be stored in a secure location.
|
data/CHANGELOG.md
CHANGED
data/INSTRUMENTATION.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# Error Reporting Instrumentation
|
2
2
|
|
3
3
|
The google-cloud-error_reporting gem provides framework instrumentation features
|
4
4
|
to make it easy to report exceptions from your application.
|
@@ -20,7 +20,8 @@ end
|
|
20
20
|
```
|
21
21
|
|
22
22
|
## Configuration
|
23
|
-
|
23
|
+
|
24
|
+
The default configuration enables Google Cloud Error Reporting instrumentation features to run on
|
24
25
|
Google Cloud Platform. You can easily configure the instrumentation library if
|
25
26
|
you want to run on a non Google Cloud environment or you want to customize the
|
26
27
|
default behavior.
|
@@ -34,13 +35,13 @@ for full configuration parameters.
|
|
34
35
|
The google-cloud-error_reporting gem provides a Rack Middleware class that can
|
35
36
|
easily integrate with Rack based application frameworks, such as Rails and
|
36
37
|
Sinatra. When enabled, it automatically gathers application exceptions from
|
37
|
-
requests and submits the information to the
|
38
|
+
requests and submits the information to the Error Reporting service.
|
38
39
|
On top of that, the google-cloud-error_reporting also implements a Railtie class
|
39
40
|
that automatically enables the Rack Middleware in Rails applications when used.
|
40
41
|
|
41
42
|
### Rails Integration
|
42
43
|
|
43
|
-
To use the
|
44
|
+
To use the Error Reporting Railtie for Ruby on Rails applications,
|
44
45
|
simply add this line to `config/application.rb`:
|
45
46
|
|
46
47
|
```ruby
|
@@ -62,7 +63,8 @@ use Google::Cloud::ErrorReporting::Middleware
|
|
62
63
|
```
|
63
64
|
|
64
65
|
## Report Captured Exceptions
|
65
|
-
|
66
|
+
|
67
|
+
Captured Ruby exceptions can be reported directly to Error Reporting
|
66
68
|
by using {Google::Cloud::ErrorReporting.report}:
|
67
69
|
|
68
70
|
```ruby
|
data/LOGGING.md
CHANGED
@@ -3,10 +3,10 @@
|
|
3
3
|
To enable logging for this library, set the logger for the underlying
|
4
4
|
[gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The logger
|
5
5
|
that you set may be a Ruby stdlib
|
6
|
-
[`Logger`](https://ruby-doc.org/
|
6
|
+
[`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as
|
7
7
|
shown below, or a
|
8
8
|
[`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
9
|
-
that will write logs to [
|
9
|
+
that will write logs to [Cloud
|
10
10
|
Logging](https://cloud.google.com/logging/). See
|
11
11
|
[grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
12
12
|
and the gRPC
|
data/OVERVIEW.md
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
# Error Reporting
|
2
2
|
|
3
|
-
|
4
|
-
running cloud services. The
|
3
|
+
Error Reporting counts, analyzes and aggregates the crashes in your
|
4
|
+
running cloud services. The Error Reporting Instrumentation client
|
5
5
|
provides a simple way to report errors from your application.
|
6
6
|
|
7
|
-
For general information about
|
8
|
-
Error Reporting Documentation](https://cloud.google.com/error-reporting/docs/).
|
7
|
+
For general information about Error Reporting, read [Error Reporting Documentation](https://cloud.google.com/error-reporting/docs/).
|
9
8
|
|
10
9
|
The goal of google-cloud is to provide an API that is comfortable to Rubyists.
|
11
10
|
Your authentication credentials are detected automatically in Google Cloud
|
@@ -17,13 +16,13 @@ connecting in the {file:AUTHENTICATION.md Authentication Guide}.
|
|
17
16
|
|
18
17
|
## How to report errors
|
19
18
|
|
20
|
-
You can easily report exceptions from your applications to
|
19
|
+
You can easily report exceptions from your applications to Error
|
21
20
|
Reporting service:
|
22
21
|
|
23
22
|
```ruby
|
24
23
|
require "google/cloud/error_reporting"
|
25
24
|
|
26
|
-
# Configure
|
25
|
+
# Configure Error Reporting instrumentation
|
27
26
|
Google::Cloud::ErrorReporting.configure do |config|
|
28
27
|
config.project_id = "my-project"
|
29
28
|
config.keyfile = "/path/to/keyfile.json"
|
@@ -44,4 +43,4 @@ See the {file:INSTRUMENTATION.md Instrumentation Guide} for more examples.
|
|
44
43
|
|
45
44
|
## Additional information
|
46
45
|
|
47
|
-
|
46
|
+
Error Reporting can be configured to use gRPC's logging. To learn more, see the{file:LOGGING.md Logging guide}.
|
@@ -29,7 +29,7 @@ module Google
|
|
29
29
|
class AsyncErrorReporterError < Google::Cloud::Error
|
30
30
|
# @!attribute [r] error_event
|
31
31
|
# @return [Array<Google::Cloud::ErrorReporting::ErrorEvent>] The
|
32
|
-
# individual error event that was not reported to
|
32
|
+
# individual error event that was not reported to Error
|
33
33
|
# Reporting service.
|
34
34
|
attr_reader :error_event
|
35
35
|
|
@@ -48,7 +48,7 @@ module Google
|
|
48
48
|
class ErrorReporterError < Google::Cloud::Error
|
49
49
|
# @!attribute [r] error_event
|
50
50
|
# @return [Array<Google::Cloud::ErrorReporting::ErrorEvent>] The
|
51
|
-
# individual error event that was not reported to
|
51
|
+
# individual error event that was not reported to Error
|
52
52
|
# Reporting service.
|
53
53
|
attr_reader :error_event
|
54
54
|
|
@@ -63,7 +63,7 @@ module Google
|
|
63
63
|
#
|
64
64
|
# @private Used by {Google::Cloud::ErrorReporting} and
|
65
65
|
# {Google::Cloud::ErrorReporting::Middleware} to asynchronously submit
|
66
|
-
# error events to
|
66
|
+
# error events to Error Reporting service when used in
|
67
67
|
# Ruby applications.
|
68
68
|
class AsyncErrorReporter
|
69
69
|
##
|
@@ -19,13 +19,13 @@ module Google
|
|
19
19
|
##
|
20
20
|
# # ErrorEvent
|
21
21
|
#
|
22
|
-
# An individual error event to report to
|
22
|
+
# An individual error event to report to Error Reporting
|
23
23
|
# service.
|
24
24
|
#
|
25
25
|
# Google::Cloud::ErrorReporting::ErrorEvent is able to be transformed
|
26
26
|
# into the `Google::Cloud::ErrorReporting::V1beta1::ReportedErrorEvent`
|
27
27
|
# gRPC structure. Once an error event is reported, the GCP
|
28
|
-
#
|
28
|
+
# Error Reporting service is able to parse the message and
|
29
29
|
# backtrace, then group the error events by content.
|
30
30
|
#
|
31
31
|
# @see https://cloud.google.com/error-reporting/reference/rest/v1beta1/projects.events
|
@@ -21,7 +21,7 @@ module Google
|
|
21
21
|
#
|
22
22
|
# Google::Cloud::ErrorReporting::Middleware defines a Rack Middleware
|
23
23
|
# that can automatically catch upstream exceptions and report them
|
24
|
-
# to
|
24
|
+
# to Error Reporting.
|
25
25
|
#
|
26
26
|
class Middleware
|
27
27
|
EXCEPTION_KEYS = ["sinatra.error", "rack.exception"].freeze
|
@@ -65,7 +65,7 @@ module Google
|
|
65
65
|
##
|
66
66
|
# Implements the mandatory Rack Middleware call method.
|
67
67
|
#
|
68
|
-
# Catch all Exceptions from upstream and report them to
|
68
|
+
# Catch all Exceptions from upstream and report them to
|
69
69
|
# Error Reporting. Unless the exception's class is defined to be ignored
|
70
70
|
# by this Middleware.
|
71
71
|
#
|
@@ -94,7 +94,7 @@ module Google
|
|
94
94
|
end
|
95
95
|
|
96
96
|
##
|
97
|
-
# Report an given exception to
|
97
|
+
# Report an given exception to Error Reporting.
|
98
98
|
#
|
99
99
|
# While it reports most of the exceptions. Certain Rails exceptions that
|
100
100
|
# maps to a HTTP status code less than 500 will be treated as not the
|
@@ -26,7 +26,7 @@ module Google
|
|
26
26
|
#
|
27
27
|
# Projects are top-level containers in Google Cloud Platform. They store
|
28
28
|
# information about billing and authorized users, and they control access
|
29
|
-
# to
|
29
|
+
# to Error Reporting. Each project has a friendly name and a
|
30
30
|
# unique ID. Projects can be created only in the [Google Developers
|
31
31
|
# Console](https://console.developers.google.com).
|
32
32
|
#
|
@@ -111,7 +111,7 @@ module Google
|
|
111
111
|
alias project project_id
|
112
112
|
|
113
113
|
##
|
114
|
-
# Report a {Google::Cloud::ErrorReporting::ErrorEvent} to
|
114
|
+
# Report a {Google::Cloud::ErrorReporting::ErrorEvent} to
|
115
115
|
# Error Reporting service.
|
116
116
|
#
|
117
117
|
# @example
|
@@ -128,7 +128,7 @@ module Google
|
|
128
128
|
|
129
129
|
##
|
130
130
|
# Create a {Google::Cloud::ErrorReporting::ErrorEvent} from the
|
131
|
-
# given exception, and report this ErrorEvent to
|
131
|
+
# given exception, and report this ErrorEvent to Error
|
132
132
|
# Reporting service.
|
133
133
|
#
|
134
134
|
# @param [Exception] exception A Ruby exception
|
@@ -24,7 +24,7 @@ module Google
|
|
24
24
|
# Google::Cloud::ErrorReporting::Railtie automatically add the
|
25
25
|
# {Google::Cloud::ErrorReporting::Middleware} to Rack in a Rails
|
26
26
|
# environment. It will automatically capture Exceptions from the Rails app
|
27
|
-
# and report them to the
|
27
|
+
# and report them to the Error Reporting service.
|
28
28
|
#
|
29
29
|
# The Middleware is only added when certain conditions are met. See
|
30
30
|
# `Google::Cloud.configure.use_error_reporting` for detail.
|
@@ -27,7 +27,7 @@ module Google
|
|
27
27
|
##
|
28
28
|
# # Error Reporting
|
29
29
|
#
|
30
|
-
#
|
30
|
+
# Error Reporting counts, analyzes and aggregates the crashes in
|
31
31
|
# your running cloud services.
|
32
32
|
#
|
33
33
|
# See {file:OVERVIEW.md Error Reporting Overview}.
|
@@ -40,14 +40,14 @@ module Google
|
|
40
40
|
@default_reporter_mutex = Monitor.new
|
41
41
|
|
42
42
|
##
|
43
|
-
# Creates a new object for connecting to the
|
43
|
+
# Creates a new object for connecting to the Error Reporting
|
44
44
|
# service. Each call creates a new connection.
|
45
45
|
#
|
46
46
|
# For more information on connecting to Google Cloud see the
|
47
47
|
# {file:AUTHENTICATION.md Authentication Guide}.
|
48
48
|
#
|
49
49
|
# @param [String] project_id Google Cloud Platform project identifier for
|
50
|
-
# the
|
50
|
+
# the Error Reporting service you are connecting to. If not
|
51
51
|
# present, the default project for the credentials is used.
|
52
52
|
# @param [String, Hash, Google::Auth::Credentials] credentials The path to
|
53
53
|
# the keyfile as a String, the contents of the keyfile as a Hash, or a
|
@@ -102,11 +102,11 @@ module Google
|
|
102
102
|
# client, allows the {.report} public method to reuse these
|
103
103
|
# configured parameters.
|
104
104
|
#
|
105
|
-
# The following
|
105
|
+
# The following ErrorReporting configuration parameters are
|
106
106
|
# supported:
|
107
107
|
#
|
108
108
|
# * `project_id` - (String) Google Cloud Platform project identifier for
|
109
|
-
# the
|
109
|
+
# the Error Reporting service you are connecting to. (The
|
110
110
|
# parameter `project` is considered deprecated, but may also be used.)
|
111
111
|
# * `credentials` - (String, Hash, Google::Auth::Credentials) The path to
|
112
112
|
# the keyfile as a String, the contents of the keyfile as a Hash, or a
|
@@ -165,13 +165,13 @@ module Google
|
|
165
165
|
|
166
166
|
##
|
167
167
|
# Provides an easy-to-use interface to Report a Ruby exception object to
|
168
|
-
#
|
169
|
-
# transform the Ruby exception into an
|
168
|
+
# Error Reporting service. This method helps users to
|
169
|
+
# transform the Ruby exception into an Error Reporting
|
170
170
|
# ErrorEvent gRPC structure, so users don't need to. This should be the
|
171
171
|
# prefered method to use when users wish to report captured exception in
|
172
172
|
# applications.
|
173
173
|
#
|
174
|
-
# This public method creates a default
|
174
|
+
# This public method creates a default Error Reporting client
|
175
175
|
# and reuse that between calls. The default client is initialized with
|
176
176
|
# parameters defined in {.configure}.
|
177
177
|
#
|
@@ -25,7 +25,7 @@ require "googleauth"
|
|
25
25
|
module Google
|
26
26
|
module Cloud
|
27
27
|
##
|
28
|
-
# Create a new object for connecting to the
|
28
|
+
# Create a new object for connecting to the Error Reporting
|
29
29
|
# service. Each call creates a new connection.
|
30
30
|
#
|
31
31
|
# For more information on connecting to Google Cloud see the
|
@@ -64,14 +64,14 @@ module Google
|
|
64
64
|
end
|
65
65
|
|
66
66
|
##
|
67
|
-
# Create a new object for connecting to the
|
67
|
+
# Create a new object for connecting to the Error Reporting
|
68
68
|
# service. Each call creates a new connection.
|
69
69
|
#
|
70
70
|
# For more information on connecting to Google Cloud see the
|
71
71
|
# {file:AUTHENTICATION.md Authentication Guide}.
|
72
72
|
#
|
73
73
|
# @param [String] project_id Google Cloud Platform project identifier for
|
74
|
-
# the
|
74
|
+
# the Error Reporting service you are connecting to. If not
|
75
75
|
# present, the default project for the credentials is used.
|
76
76
|
# @param [String, Hash, Google::Auth::Credentials] credentials The path to
|
77
77
|
# the keyfile as a String, the contents of the keyfile as a Hash, or a
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-error_reporting
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.42.
|
4
|
+
version: 0.42.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-core
|
@@ -220,8 +220,7 @@ dependencies:
|
|
220
220
|
- - "~>"
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: 0.1.13
|
223
|
-
description: google-cloud-error_reporting is the official library for
|
224
|
-
Error Reporting.
|
223
|
+
description: google-cloud-error_reporting is the official library for Error Reporting.
|
225
224
|
email:
|
226
225
|
- googleapis-packages@google.com
|
227
226
|
executables: []
|
@@ -267,8 +266,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
267
266
|
- !ruby/object:Gem::Version
|
268
267
|
version: '0'
|
269
268
|
requirements: []
|
270
|
-
rubygems_version: 3.2
|
269
|
+
rubygems_version: 3.4.2
|
271
270
|
signing_key:
|
272
271
|
specification_version: 4
|
273
|
-
summary: API Client library for
|
272
|
+
summary: API Client library for Error Reporting
|
274
273
|
test_files: []
|