bugstack 1.0.2 → 1.1.0
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/CHANGELOG.md +31 -20
- data/LICENSE +21 -21
- data/README.md +176 -174
- data/lib/bugstack/client.rb +123 -123
- data/lib/bugstack/configuration.rb +68 -68
- data/lib/bugstack/event.rb +90 -90
- data/lib/bugstack/fingerprint.rb +97 -97
- data/lib/bugstack/integrations/generic.rb +41 -41
- data/lib/bugstack/integrations/rails.rb +61 -61
- data/lib/bugstack/integrations/sinatra.rb +41 -41
- data/lib/bugstack/transport.rb +111 -95
- data/lib/bugstack/version.rb +5 -5
- data/lib/bugstack.rb +64 -63
- metadata +19 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5b70be0311455f78a16e89c5a96389371ce6a98848844a78c3c91ddc88dd5fca
|
|
4
|
+
data.tar.gz: 67c04ee34fba1e79ecd02d7beaebba098075a43cd18a85793ea8db967d96321c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d3b6391309d364bf46ed54a6fa16a181a45b257a1c7abd95495f89b399c3c2240623f1c1049555142700501dbab87eeaa458464f3b5fad299c231393045b279
|
|
7
|
+
data.tar.gz: 25e6671986a36019653b37f442c3ed4ed61dafa299a7174f81054b74d7986813f64496f57ef9803b7fe7cd6c81e3c2fe010735663d7f588fe435868f7a8d4faf
|
data/CHANGELOG.md
CHANGED
|
@@ -1,20 +1,31 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
## [1.
|
|
6
|
-
|
|
7
|
-
###
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [1.1.0] - 2026-10-28
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- The default endpoint is now `https://dashboard.bugstack.ai/api/ingest/sdk`.
|
|
10
|
+
It was `https://api.bugstack.dev/api/capture`, which is not Bugstack's
|
|
11
|
+
ingest address, so events sent with the default setting did not reach
|
|
12
|
+
Bugstack. Apps that set `config.endpoint` themselves are unaffected.
|
|
13
|
+
- The gem's homepage, documentation link, contact and security addresses
|
|
14
|
+
now point at bugstack.ai.
|
|
15
|
+
|
|
16
|
+
## [1.0.0] - 2026-02-13
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- Core SDK with `Bugstack.init` and `Bugstack.capture_exception`
|
|
21
|
+
- Background thread transport with retry and exponential backoff
|
|
22
|
+
- SHA-256 error fingerprinting and client-side deduplication
|
|
23
|
+
- `before_send` hook for event inspection/modification/filtering
|
|
24
|
+
- `ignored_errors` for skipping specific error types or messages
|
|
25
|
+
- `dry_run` mode for transparent debugging
|
|
26
|
+
- `enabled` kill switch
|
|
27
|
+
- Block-style configuration
|
|
28
|
+
- Rails integration via Railtie and Rack middleware
|
|
29
|
+
- Sinatra integration via `register`
|
|
30
|
+
- Generic integration via `at_exit` hook
|
|
31
|
+
- Zero runtime gem dependencies
|
data/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 BugStack
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 BugStack
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
|
@@ -1,174 +1,176 @@
|
|
|
1
|
-
# bugstack-ruby
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
config.
|
|
41
|
-
config.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
config.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
require "
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
config.
|
|
103
|
-
config.
|
|
104
|
-
config.
|
|
105
|
-
config.
|
|
106
|
-
config.
|
|
107
|
-
config.
|
|
108
|
-
config.
|
|
109
|
-
config.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
event
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
"
|
|
155
|
-
"
|
|
156
|
-
"
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
"
|
|
162
|
-
"
|
|
163
|
-
"
|
|
164
|
-
"
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
1
|
+
# bugstack-ruby
|
|
2
|
+
|
|
3
|
+
The [Bugstack](https://bugstack.ai) SDK for Ruby: Rails, Sinatra and any Rack app.
|
|
4
|
+
|
|
5
|
+
Bugstack is autonomous software maintenance. It watches your app and your repository, fixes what breaks, and sends every change as a pull request you control. This SDK is how your app tells Bugstack about an uncaught server error.
|
|
6
|
+
|
|
7
|
+
[](https://rubygems.org/gems/bugstack)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
gem "bugstack"
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Or install directly:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
gem install bugstack
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```ruby
|
|
25
|
+
require "bugstack"
|
|
26
|
+
|
|
27
|
+
Bugstack.init(api_key: "bs_live_...")
|
|
28
|
+
|
|
29
|
+
begin
|
|
30
|
+
risky_operation
|
|
31
|
+
rescue => e
|
|
32
|
+
Bugstack.capture_exception(e)
|
|
33
|
+
end
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Block Configuration
|
|
37
|
+
|
|
38
|
+
```ruby
|
|
39
|
+
Bugstack.init do |config|
|
|
40
|
+
config.api_key = "bs_live_..."
|
|
41
|
+
config.environment = "production"
|
|
42
|
+
config.auto_fix = true
|
|
43
|
+
config.debug = true
|
|
44
|
+
end
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Framework Integrations
|
|
48
|
+
|
|
49
|
+
### Rails
|
|
50
|
+
|
|
51
|
+
Add to your Gemfile:
|
|
52
|
+
|
|
53
|
+
```ruby
|
|
54
|
+
gem "bugstack"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Create an initializer:
|
|
58
|
+
|
|
59
|
+
```ruby
|
|
60
|
+
# config/initializers/bugstack.rb
|
|
61
|
+
Bugstack.init do |config|
|
|
62
|
+
config.api_key = Rails.application.credentials.bugstack_api_key
|
|
63
|
+
config.environment = Rails.env
|
|
64
|
+
config.auto_fix = true
|
|
65
|
+
end
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The Railtie automatically inserts Rack middleware for exception capture.
|
|
69
|
+
|
|
70
|
+
### Sinatra
|
|
71
|
+
|
|
72
|
+
```ruby
|
|
73
|
+
require "sinatra"
|
|
74
|
+
require "bugstack"
|
|
75
|
+
require "bugstack/integrations/sinatra"
|
|
76
|
+
|
|
77
|
+
Bugstack.init(api_key: "bs_live_...")
|
|
78
|
+
|
|
79
|
+
class MyApp < Sinatra::Base
|
|
80
|
+
register Bugstack::Integrations::Sinatra
|
|
81
|
+
|
|
82
|
+
get "/" do
|
|
83
|
+
"Hello!"
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Generic (at_exit hook)
|
|
89
|
+
|
|
90
|
+
```ruby
|
|
91
|
+
require "bugstack"
|
|
92
|
+
require "bugstack/integrations/generic"
|
|
93
|
+
|
|
94
|
+
Bugstack.init(api_key: "bs_live_...")
|
|
95
|
+
Bugstack::Integrations::Generic.install!
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Configuration
|
|
99
|
+
|
|
100
|
+
```ruby
|
|
101
|
+
Bugstack.init do |config|
|
|
102
|
+
config.api_key = "bs_live_..." # Required
|
|
103
|
+
config.environment = "production" # Default: "production"
|
|
104
|
+
config.auto_fix = true # Let Bugstack open a fix for errors this SDK reports
|
|
105
|
+
config.debug = false # Log SDK activity
|
|
106
|
+
config.dry_run = false # Log without sending
|
|
107
|
+
config.enabled = true # Kill switch
|
|
108
|
+
config.deduplication_window = 300 # Seconds (default: 5 min)
|
|
109
|
+
config.timeout = 5.0 # HTTP timeout in seconds
|
|
110
|
+
config.max_retries = 3 # Retry attempts
|
|
111
|
+
config.ignored_errors = [ # Errors to skip
|
|
112
|
+
SystemExit,
|
|
113
|
+
SignalException,
|
|
114
|
+
"expected error message",
|
|
115
|
+
]
|
|
116
|
+
config.before_send = ->(event) { # Inspect/modify/drop events
|
|
117
|
+
event # return nil to drop
|
|
118
|
+
}
|
|
119
|
+
end
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Data Transparency
|
|
123
|
+
|
|
124
|
+
### `before_send` Hook
|
|
125
|
+
|
|
126
|
+
```ruby
|
|
127
|
+
Bugstack.init do |config|
|
|
128
|
+
config.api_key = "bs_live_..."
|
|
129
|
+
config.before_send = ->(event) {
|
|
130
|
+
# Drop health check errors
|
|
131
|
+
return nil if event.request&.dig(:route)&.include?("/health")
|
|
132
|
+
|
|
133
|
+
# Redact sensitive data
|
|
134
|
+
event.metadata.delete("secret")
|
|
135
|
+
|
|
136
|
+
event
|
|
137
|
+
}
|
|
138
|
+
end
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### `dry_run` Mode
|
|
142
|
+
|
|
143
|
+
```ruby
|
|
144
|
+
Bugstack.init(api_key: "bs_live_...", dry_run: true)
|
|
145
|
+
# Prints: [BugStack DryRun] Would send: { ... }
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## What Gets Sent
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"apiKey": "bs_live_...",
|
|
153
|
+
"error": {
|
|
154
|
+
"message": "undefined method 'foo' for nil",
|
|
155
|
+
"stackTrace": "NoMethodError: undefined method...",
|
|
156
|
+
"file": "app/controllers/users_controller.rb",
|
|
157
|
+
"function": "show",
|
|
158
|
+
"fingerprint": "a1b2c3d4e5f6g7h8"
|
|
159
|
+
},
|
|
160
|
+
"environment": {
|
|
161
|
+
"language": "ruby",
|
|
162
|
+
"languageVersion": "3.2.0",
|
|
163
|
+
"framework": "rails",
|
|
164
|
+
"frameworkVersion": "7.1.0",
|
|
165
|
+
"os": "x86_64-linux",
|
|
166
|
+
"sdkVersion": "1.0.0"
|
|
167
|
+
},
|
|
168
|
+
"timestamp": "2026-01-15T08:30:00Z"
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Zero runtime gem dependencies. No cookies, IP addresses, or user data.
|
|
173
|
+
|
|
174
|
+
## License
|
|
175
|
+
|
|
176
|
+
MIT — see [LICENSE](LICENSE).
|