google-cloud-error_reporting 0.45.0 → 0.45.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.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +7 -3
- data/CHANGELOG.md +6 -0
- data/lib/google/cloud/error_reporting/project.rb +2 -2
- data/lib/google/cloud/error_reporting/service.rb +5 -1
- data/lib/google/cloud/error_reporting/version.rb +1 -1
- data/lib/google/cloud/error_reporting.rb +4 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2d6dd0fd476822b1c166855b84d18b62d7b467809fbe8cdb3a11bdafa74439de
|
|
4
|
+
data.tar.gz: 75221540b9c57b93f7a6237744e757c24607dc420cabefa266bf2a45901abf2b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a59c70911221fe288dcae5e2b210ee99b22dd3a1eaea532ef2669eb5f1ae55d0c604f6a1f51f85930c85dd05e3b0d186b9e2d793e25f0852a558d88c491fd006
|
|
7
|
+
data.tar.gz: bfc7008abcf752bb87290852e154a08fd1f6fc2665ad721ebd7a1759699c83a770ca00fb1e9908c69411acf6d90a7bd8411cfa4e5718e9942f88e51766f3f90b
|
data/AUTHENTICATION.md
CHANGED
|
@@ -96,20 +96,24 @@ client = Google::Cloud::ErrorReporting.new
|
|
|
96
96
|
|
|
97
97
|
### Configuration
|
|
98
98
|
|
|
99
|
-
The **Project ID** and the path to the **Credentials JSON** file can be configured
|
|
99
|
+
The **Project ID**, **Quota Project**, and the path to the **Credentials JSON** file can be configured
|
|
100
100
|
instead of placing them in environment variables or providing them as arguments.
|
|
101
101
|
|
|
102
102
|
```ruby
|
|
103
103
|
require "google/cloud/error_reporting"
|
|
104
104
|
|
|
105
105
|
Google::Cloud::ErrorReporting.configure do |config|
|
|
106
|
-
config.project_id
|
|
107
|
-
config.
|
|
106
|
+
config.project_id = "my-project-id" # The project where errors are reported
|
|
107
|
+
config.quota_project = "my-billing-project" # The project billed for quota/billing (optional)
|
|
108
|
+
config.credentials = "path/to/keyfile.json"
|
|
108
109
|
end
|
|
109
110
|
|
|
110
111
|
client = Google::Cloud::ErrorReporting.new
|
|
111
112
|
```
|
|
112
113
|
|
|
114
|
+
> [!NOTE]
|
|
115
|
+
> **Project ID** (where errors are sent) and **Quota Project** (which project is billed for the API call) are distinct. By default, the library bills the project associated with the credentials. Use `config.quota_project` if you need to bill a different project.
|
|
116
|
+
|
|
113
117
|
### Cloud SDK
|
|
114
118
|
|
|
115
119
|
This option allows for an easy way to authenticate during development. If
|
data/CHANGELOG.md
CHANGED
|
@@ -122,8 +122,8 @@ module Google
|
|
|
122
122
|
# error_event = error_reporting.error_event "Error with Backtrace"
|
|
123
123
|
# error_reporting.report error_event
|
|
124
124
|
#
|
|
125
|
-
def report
|
|
126
|
-
service.report(*args, &
|
|
125
|
+
def report(*args, &)
|
|
126
|
+
service.report(*args, &)
|
|
127
127
|
end
|
|
128
128
|
|
|
129
129
|
##
|
|
@@ -29,14 +29,17 @@ module Google
|
|
|
29
29
|
attr_accessor :credentials
|
|
30
30
|
attr_accessor :timeout
|
|
31
31
|
attr_accessor :host
|
|
32
|
+
attr_accessor :quota_project
|
|
32
33
|
|
|
33
34
|
##
|
|
34
35
|
# Creates a new Service instance.
|
|
35
|
-
def initialize project, credentials, timeout: nil, host: nil
|
|
36
|
+
def initialize project, credentials, timeout: nil, host: nil, quota_project: nil
|
|
36
37
|
@project = project
|
|
37
38
|
@credentials = credentials
|
|
38
39
|
@timeout = timeout
|
|
39
40
|
@host = host
|
|
41
|
+
@quota_project = quota_project
|
|
42
|
+
@quota_project ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
|
40
43
|
end
|
|
41
44
|
|
|
42
45
|
def error_reporting
|
|
@@ -46,6 +49,7 @@ module Google
|
|
|
46
49
|
config.credentials = credentials if credentials
|
|
47
50
|
config.timeout = timeout if timeout
|
|
48
51
|
config.endpoint = host if host
|
|
52
|
+
config.quota_project = quota_project if quota_project
|
|
49
53
|
config.lib_name = "gccl"
|
|
50
54
|
config.lib_version = Google::Cloud::ErrorReporting::VERSION
|
|
51
55
|
end
|
|
@@ -93,7 +93,10 @@ module Google
|
|
|
93
93
|
credentials = resolve_credentials credentials, scope
|
|
94
94
|
project_id = resolve_project_id project_id, credentials
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
quota_project = configure.quota_project
|
|
97
|
+
service = ErrorReporting::Service.new project_id, credentials,
|
|
98
|
+
host: endpoint, timeout: timeout,
|
|
99
|
+
quota_project: quota_project
|
|
97
100
|
ErrorReporting::Project.new service
|
|
98
101
|
end
|
|
99
102
|
|