google-cloud-error_reporting 0.35.1 → 0.42.1

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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +4 -2
  3. data/CHANGELOG.md +47 -0
  4. data/CONTRIBUTING.md +4 -7
  5. data/LOGGING.md +1 -1
  6. data/OVERVIEW.md +1 -2
  7. data/TROUBLESHOOTING.md +2 -8
  8. data/lib/google-cloud-error_reporting.rb +8 -14
  9. data/lib/google/cloud/error_reporting.rb +16 -13
  10. data/lib/google/cloud/error_reporting/async_error_reporter.rb +2 -2
  11. data/lib/google/cloud/error_reporting/credentials.rb +2 -2
  12. data/lib/google/cloud/error_reporting/error_event.rb +14 -18
  13. data/lib/google/cloud/error_reporting/middleware.rb +8 -13
  14. data/lib/google/cloud/error_reporting/rails.rb +2 -2
  15. data/lib/google/cloud/error_reporting/service.rb +15 -36
  16. data/lib/google/cloud/error_reporting/version.rb +1 -1
  17. metadata +11 -72
  18. data/lib/google/cloud/error_reporting/v1beta1.rb +0 -19
  19. data/lib/google/cloud/error_reporting/v1beta1/credentials.rb +0 -41
  20. data/lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/common.rb +0 -158
  21. data/lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/error_group_service.rb +0 -41
  22. data/lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/error_stats_service.rb +0 -314
  23. data/lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/report_errors_service.rb +0 -79
  24. data/lib/google/cloud/error_reporting/v1beta1/doc/google/protobuf/duration.rb +0 -91
  25. data/lib/google/cloud/error_reporting/v1beta1/doc/google/protobuf/timestamp.rb +0 -113
  26. data/lib/google/cloud/error_reporting/v1beta1/error_group_service_client.rb +0 -285
  27. data/lib/google/cloud/error_reporting/v1beta1/error_group_service_client_config.json +0 -36
  28. data/lib/google/cloud/error_reporting/v1beta1/error_stats_service_client.rb +0 -457
  29. data/lib/google/cloud/error_reporting/v1beta1/error_stats_service_client_config.json +0 -41
  30. data/lib/google/cloud/error_reporting/v1beta1/report_errors_service_client.rb +0 -254
  31. data/lib/google/cloud/error_reporting/v1beta1/report_errors_service_client_config.json +0 -31
  32. data/lib/google/devtools/clouderrorreporting/v1beta1/common_pb.rb +0 -64
  33. data/lib/google/devtools/clouderrorreporting/v1beta1/error_group_service_pb.rb +0 -30
  34. data/lib/google/devtools/clouderrorreporting/v1beta1/error_group_service_services_pb.rb +0 -50
  35. data/lib/google/devtools/clouderrorreporting/v1beta1/error_stats_service_pb.rb +0 -116
  36. data/lib/google/devtools/clouderrorreporting/v1beta1/error_stats_service_services_pb.rb +0 -52
  37. data/lib/google/devtools/clouderrorreporting/v1beta1/report_errors_service_pb.rb +0 -38
  38. data/lib/google/devtools/clouderrorreporting/v1beta1/report_errors_service_services_pb.rb +0 -55
@@ -151,13 +151,13 @@ module Google
151
151
  ErrorReporting::Credentials.new credentials
152
152
  end
153
153
  rescue StandardError => e
154
- STDOUT.puts "Note: Google::Cloud::ErrorReporting is disabled " \
154
+ $stdout.puts "Note: Google::Cloud::ErrorReporting is disabled " \
155
155
  "because it failed to authorize with the service. (#{e.message})"
156
156
  return false
157
157
  end
158
158
 
159
159
  if project_id.to_s.empty?
160
- STDOUT.puts "Note: Google::Cloud::ErrorReporting is disabled " \
160
+ $stdout.puts "Note: Google::Cloud::ErrorReporting is disabled " \
161
161
  "because the project ID could not be determined."
162
162
  return false
163
163
  end
@@ -16,7 +16,6 @@
16
16
  require "google/cloud/errors"
17
17
  require "google/cloud/error_reporting/version"
18
18
  require "google/cloud/error_reporting/v1beta1"
19
- require "google/gax/errors"
20
19
  require "uri"
21
20
 
22
21
  module Google
@@ -26,31 +25,30 @@ module Google
26
25
  # @private Represents the gRPC Error Reporting service, including all the
27
26
  # API methods.
28
27
  class Service
29
- attr_accessor :project, :credentials, :timeout, :client_config, :host
28
+ attr_accessor :project
29
+ attr_accessor :credentials
30
+ attr_accessor :timeout
31
+ attr_accessor :host
30
32
 
31
33
  ##
32
34
  # Creates a new Service instance.
33
- def initialize project, credentials, timeout: nil, client_config: nil,
34
- host: nil
35
+ def initialize project, credentials, timeout: nil, host: nil
35
36
  @project = project
36
37
  @credentials = credentials
37
38
  @timeout = timeout
38
- @client_config = client_config || {}
39
- @host = host || V1beta1::ReportErrorsServiceClient::SERVICE_ADDRESS
39
+ @host = host
40
40
  end
41
41
 
42
42
  def error_reporting
43
43
  return mocked_error_reporting if mocked_error_reporting
44
44
  @error_reporting ||= \
45
- V1beta1::ReportErrorsServiceClient.new(
46
- credentials: credentials,
47
- timeout: timeout,
48
- client_config: client_config,
49
- service_address: service_address,
50
- service_port: service_port,
51
- lib_name: "gccl",
52
- lib_version: Google::Cloud::ErrorReporting::VERSION
53
- )
45
+ V1beta1::ReportErrorsService::Client.new do |config|
46
+ config.credentials = credentials if credentials
47
+ config.timeout = timeout if timeout
48
+ config.endpoint = host if host
49
+ config.lib_name = "gccl"
50
+ config.lib_version = Google::Cloud::ErrorReporting::VERSION
51
+ end
54
52
  end
55
53
  attr_accessor :mocked_error_reporting
56
54
 
@@ -81,32 +79,13 @@ module Google
81
79
 
82
80
  error_event_grpc = error_event.to_grpc
83
81
 
84
- execute do
85
- error_reporting.report_error_event project_path, error_event_grpc
86
- end
82
+ error_reporting.report_error_event project_name: project_path, event: error_event_grpc
87
83
  end
88
84
 
89
85
  protected
90
86
 
91
- def service_address
92
- return nil if host.nil?
93
- URI.parse("//#{host}").host
94
- end
95
-
96
- def service_port
97
- return nil if host.nil?
98
- URI.parse("//#{host}").port
99
- end
100
-
101
87
  def project_path
102
- V1beta1::ReportErrorsServiceClient.project_path project
103
- end
104
-
105
- def execute
106
- yield
107
- rescue Google::Gax::GaxError => e
108
- # GaxError wraps BadStatus, but exposes it as #cause
109
- raise Google::Cloud::Error.from_error(e.cause)
88
+ V1beta1::ReportErrorsService::Paths.project_path project: project
110
89
  end
111
90
  end
112
91
  end
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module ErrorReporting
19
- VERSION = "0.35.1".freeze
19
+ VERSION = "0.42.1".freeze
20
20
  end
21
21
  end
22
22
  end
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.35.1
4
+ version: 0.42.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-19 00:00:00.000000000 Z
11
+ date: 2021-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.2'
19
+ version: '1.5'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.2'
26
+ version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: stackdriver-core
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,59 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
- name: google-gax
42
+ name: google-cloud-error_reporting-v1beta1
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.8'
47
+ version: '0.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.8'
55
- - !ruby/object:Gem::Dependency
56
- name: googleapis-common-protos
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: 1.3.9
62
- - - "<"
63
- - !ruby/object:Gem::Version
64
- version: '2.0'
65
- type: :runtime
66
- prerelease: false
67
- version_requirements: !ruby/object:Gem::Requirement
68
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
71
- version: 1.3.9
72
- - - "<"
73
- - !ruby/object:Gem::Version
74
- version: '2.0'
75
- - !ruby/object:Gem::Dependency
76
- name: googleapis-common-protos-types
77
- requirement: !ruby/object:Gem::Requirement
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- version: 1.0.4
82
- - - "<"
83
- - !ruby/object:Gem::Version
84
- version: '2.0'
85
- type: :runtime
86
- prerelease: false
87
- version_requirements: !ruby/object:Gem::Requirement
88
- requirements:
89
- - - ">="
90
- - !ruby/object:Gem::Version
91
- version: 1.0.4
92
- - - "<"
93
- - !ruby/object:Gem::Version
94
- version: '2.0'
54
+ version: '0.0'
95
55
  - !ruby/object:Gem::Dependency
96
56
  name: concurrent-ruby
97
57
  requirement: !ruby/object:Gem::Requirement
@@ -112,14 +72,14 @@ dependencies:
112
72
  requirements:
113
73
  - - "~>"
114
74
  - !ruby/object:Gem::Version
115
- version: 1.24.0
75
+ version: 1.25.1
116
76
  type: :development
117
77
  prerelease: false
118
78
  version_requirements: !ruby/object:Gem::Requirement
119
79
  requirements:
120
80
  - - "~>"
121
81
  - !ruby/object:Gem::Version
122
- version: 1.24.0
82
+ version: 1.25.1
123
83
  - !ruby/object:Gem::Dependency
124
84
  name: minitest
125
85
  requirement: !ruby/object:Gem::Requirement
@@ -287,28 +247,7 @@ files:
287
247
  - lib/google/cloud/error_reporting/project.rb
288
248
  - lib/google/cloud/error_reporting/rails.rb
289
249
  - lib/google/cloud/error_reporting/service.rb
290
- - lib/google/cloud/error_reporting/v1beta1.rb
291
- - lib/google/cloud/error_reporting/v1beta1/credentials.rb
292
- - lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/common.rb
293
- - lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/error_group_service.rb
294
- - lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/error_stats_service.rb
295
- - lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/report_errors_service.rb
296
- - lib/google/cloud/error_reporting/v1beta1/doc/google/protobuf/duration.rb
297
- - lib/google/cloud/error_reporting/v1beta1/doc/google/protobuf/timestamp.rb
298
- - lib/google/cloud/error_reporting/v1beta1/error_group_service_client.rb
299
- - lib/google/cloud/error_reporting/v1beta1/error_group_service_client_config.json
300
- - lib/google/cloud/error_reporting/v1beta1/error_stats_service_client.rb
301
- - lib/google/cloud/error_reporting/v1beta1/error_stats_service_client_config.json
302
- - lib/google/cloud/error_reporting/v1beta1/report_errors_service_client.rb
303
- - lib/google/cloud/error_reporting/v1beta1/report_errors_service_client_config.json
304
250
  - lib/google/cloud/error_reporting/version.rb
305
- - lib/google/devtools/clouderrorreporting/v1beta1/common_pb.rb
306
- - lib/google/devtools/clouderrorreporting/v1beta1/error_group_service_pb.rb
307
- - lib/google/devtools/clouderrorreporting/v1beta1/error_group_service_services_pb.rb
308
- - lib/google/devtools/clouderrorreporting/v1beta1/error_stats_service_pb.rb
309
- - lib/google/devtools/clouderrorreporting/v1beta1/error_stats_service_services_pb.rb
310
- - lib/google/devtools/clouderrorreporting/v1beta1/report_errors_service_pb.rb
311
- - lib/google/devtools/clouderrorreporting/v1beta1/report_errors_service_services_pb.rb
312
251
  homepage: https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-error_reporting
313
252
  licenses:
314
253
  - Apache-2.0
@@ -321,14 +260,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
321
260
  requirements:
322
261
  - - ">="
323
262
  - !ruby/object:Gem::Version
324
- version: '2.4'
263
+ version: '2.5'
325
264
  required_rubygems_version: !ruby/object:Gem::Requirement
326
265
  requirements:
327
266
  - - ">="
328
267
  - !ruby/object:Gem::Version
329
268
  version: '0'
330
269
  requirements: []
331
- rubygems_version: 3.0.6
270
+ rubygems_version: 3.2.17
332
271
  signing_key:
333
272
  specification_version: 4
334
273
  summary: API Client library for Stackdriver Error Reporting
@@ -1,19 +0,0 @@
1
-
2
- # Copyright 2016 Google LLC
3
- #
4
- # Licensed under the Apache License, Version 2.0 (the "License");
5
- # you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # https://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS,
12
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
-
17
- require "google/cloud/error_reporting/v1beta1/error_group_service_client"
18
- require "google/cloud/error_reporting/v1beta1/error_stats_service_client"
19
- require "google/cloud/error_reporting/v1beta1/report_errors_service_client"
@@ -1,41 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- require "googleauth"
17
-
18
- module Google
19
- module Cloud
20
- module ErrorReporting
21
- module V1beta1
22
- class Credentials < Google::Auth::Credentials
23
- SCOPE = [
24
- "https://www.googleapis.com/auth/cloud-platform"
25
- ].freeze
26
- PATH_ENV_VARS = %w(ERROR_REPORTING_CREDENTIALS
27
- ERROR_REPORTING_KEYFILE
28
- GOOGLE_CLOUD_CREDENTIALS
29
- GOOGLE_CLOUD_KEYFILE
30
- GCLOUD_KEYFILE)
31
- JSON_ENV_VARS = %w(ERROR_REPORTING_CREDENTIALS_JSON
32
- ERROR_REPORTING_KEYFILE_JSON
33
- GOOGLE_CLOUD_CREDENTIALS_JSON
34
- GOOGLE_CLOUD_KEYFILE_JSON
35
- GCLOUD_KEYFILE_JSON)
36
- DEFAULT_PATHS = ["~/.config/gcloud/application_default_credentials.json"]
37
- end
38
- end
39
- end
40
- end
41
- end
@@ -1,158 +0,0 @@
1
- # Copyright 2020 Google LLC
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # https://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
-
16
- module Google
17
- module Devtools
18
- module Clouderrorreporting
19
- module V1beta1
20
- # Description of a group of similar error events.
21
- # @!attribute [rw] name
22
- # @return [String]
23
- # The group resource name.
24
- # Example: <code>projects/my-project-123/groups/my-groupid</code>
25
- # @!attribute [rw] group_id
26
- # @return [String]
27
- # Group IDs are unique for a given project. If the same kind of error
28
- # occurs in different service contexts, it will receive the same group ID.
29
- # @!attribute [rw] tracking_issues
30
- # @return [Array<Google::Devtools::Clouderrorreporting::V1beta1::TrackingIssue>]
31
- # Associated tracking issues.
32
- class ErrorGroup; end
33
-
34
- # Information related to tracking the progress on resolving the error.
35
- # @!attribute [rw] url
36
- # @return [String]
37
- # A URL pointing to a related entry in an issue tracking system.
38
- # Example: https://github.com/user/project/issues/4
39
- class TrackingIssue; end
40
-
41
- # An error event which is returned by the Error Reporting system.
42
- # @!attribute [rw] event_time
43
- # @return [Google::Protobuf::Timestamp]
44
- # Time when the event occurred as provided in the error report.
45
- # If the report did not contain a timestamp, the time the error was received
46
- # by the Error Reporting system is used.
47
- # @!attribute [rw] service_context
48
- # @return [Google::Devtools::Clouderrorreporting::V1beta1::ServiceContext]
49
- # The `ServiceContext` for which this error was reported.
50
- # @!attribute [rw] message
51
- # @return [String]
52
- # The stack trace that was reported or logged by the service.
53
- # @!attribute [rw] context
54
- # @return [Google::Devtools::Clouderrorreporting::V1beta1::ErrorContext]
55
- # Data about the context in which the error occurred.
56
- class ErrorEvent; end
57
-
58
- # Describes a running service that sends errors.
59
- # Its version changes over time and multiple versions can run in parallel.
60
- # @!attribute [rw] service
61
- # @return [String]
62
- # An identifier of the service, such as the name of the
63
- # executable, job, or Google App Engine service name. This field is expected
64
- # to have a low number of values that are relatively stable over time, as
65
- # opposed to `version`, which can be changed whenever new code is deployed.
66
- #
67
- # Contains the service name for error reports extracted from Google
68
- # App Engine logs or `default` if the App Engine default service is used.
69
- # @!attribute [rw] version
70
- # @return [String]
71
- # Represents the source code version that the developer provided,
72
- # which could represent a version label or a Git SHA-1 hash, for example.
73
- # For App Engine standard environment, the version is set to the version of
74
- # the app.
75
- # @!attribute [rw] resource_type
76
- # @return [String]
77
- # Type of the MonitoredResource. List of possible values:
78
- # https://cloud.google.com/monitoring/api/resources
79
- #
80
- # Value is set automatically for incoming errors and must not be set when
81
- # reporting errors.
82
- class ServiceContext; end
83
-
84
- # A description of the context in which an error occurred.
85
- # This data should be provided by the application when reporting an error,
86
- # unless the
87
- # error report has been generated automatically from Google App Engine logs.
88
- # @!attribute [rw] http_request
89
- # @return [Google::Devtools::Clouderrorreporting::V1beta1::HttpRequestContext]
90
- # The HTTP request which was processed when the error was
91
- # triggered.
92
- # @!attribute [rw] user
93
- # @return [String]
94
- # The user who caused or was affected by the crash.
95
- # This can be a user ID, an email address, or an arbitrary token that
96
- # uniquely identifies the user.
97
- # When sending an error report, leave this field empty if the user was not
98
- # logged in. In this case the
99
- # Error Reporting system will use other data, such as remote IP address, to
100
- # distinguish affected users. See `affected_users_count` in
101
- # `ErrorGroupStats`.
102
- # @!attribute [rw] report_location
103
- # @return [Google::Devtools::Clouderrorreporting::V1beta1::SourceLocation]
104
- # The location in the source code where the decision was made to
105
- # report the error, usually the place where it was logged.
106
- # For a logged exception this would be the source line where the
107
- # exception is logged, usually close to the place where it was
108
- # caught.
109
- class ErrorContext; end
110
-
111
- # HTTP request data that is related to a reported error.
112
- # This data should be provided by the application when reporting an error,
113
- # unless the
114
- # error report has been generated automatically from Google App Engine logs.
115
- # @!attribute [rw] method
116
- # @return [String]
117
- # The type of HTTP request, such as `GET`, `POST`, etc.
118
- # @!attribute [rw] url
119
- # @return [String]
120
- # The URL of the request.
121
- # @!attribute [rw] user_agent
122
- # @return [String]
123
- # The user agent information that is provided with the request.
124
- # @!attribute [rw] referrer
125
- # @return [String]
126
- # The referrer information that is provided with the request.
127
- # @!attribute [rw] response_status_code
128
- # @return [Integer]
129
- # The HTTP response status code for the request.
130
- # @!attribute [rw] remote_ip
131
- # @return [String]
132
- # The IP address from which the request originated.
133
- # This can be IPv4, IPv6, or a token which is derived from the
134
- # IP address, depending on the data that has been provided
135
- # in the error report.
136
- class HttpRequestContext; end
137
-
138
- # Indicates a location in the source code of the service for which errors are
139
- # reported. `functionName` must be provided by the application when reporting
140
- # an error, unless the error report contains a `message` with a supported
141
- # exception stack trace. All fields are optional for the later case.
142
- # @!attribute [rw] file_path
143
- # @return [String]
144
- # The source code filename, which can include a truncated relative
145
- # path, or a full path from a production machine.
146
- # @!attribute [rw] line_number
147
- # @return [Integer]
148
- # 1-based. 0 indicates that the line number is unknown.
149
- # @!attribute [rw] function_name
150
- # @return [String]
151
- # Human-readable name of a function or method.
152
- # The value can include optional context like the class or package name.
153
- # For example, `my.package.MyClass.method` in case of Java.
154
- class SourceLocation; end
155
- end
156
- end
157
- end
158
- end