chronos-ruby 1.2.1 → 1.2.2
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 +18 -0
- data/README.md +158 -106
- data/docs/adr/legacy-deploy-cli.md +21 -0
- data/docs/adr/transitional-deploy-cli.md +11 -0
- data/docs/compatibility.md +31 -18
- data/docs/deploy-cli.md +35 -0
- data/docs/legacy-test-environment.md +59 -0
- data/docs/modules/rails-legacy.md +2 -2
- data/docs/modules/sidekiq-legacy.md +7 -10
- data/docs/release-1.1.4-readiness.md +44 -0
- data/docs/release-1.2.2-readiness.md +27 -0
- data/exe/chronos +3 -0
- data/lib/chronos/agent.rb +16 -5
- data/lib/chronos/cli.rb +117 -0
- data/lib/chronos/core/bounded_copy.rb +69 -0
- data/lib/chronos/core/notice.rb +4 -28
- data/lib/chronos/core/sanitizer.rb +1 -1
- data/lib/chronos/core/sql_lexer.rb +73 -0
- data/lib/chronos/core/sql_normalizer.rb +7 -7
- data/lib/chronos/core/telemetry_event.rb +5 -18
- data/lib/chronos/deploy/configuration.rb +96 -0
- data/lib/chronos/deploy/error.rb +14 -0
- data/lib/chronos/deploy/installer.rb +65 -0
- data/lib/chronos/deploy/providers.rb +50 -0
- data/lib/chronos/deploy/runner.rb +44 -0
- data/lib/chronos/deploy/secure_directory.rb +125 -0
- data/lib/chronos/rails/active_record_query_inspector.rb +2 -4
- data/lib/chronos/rails/installer.rb +1 -1
- data/lib/chronos/rails/railtie.rb +1 -1
- data/lib/chronos/rails.rb +3 -3
- data/lib/chronos/rake_tasks.rb +13 -1
- data/lib/chronos/version.rb +1 -1
- data/lib/generators/chronos/deploy/install/install_generator.rb +26 -0
- metadata +41 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 87b640aa42cc30a22ed1a78e5b581e3e91ad06da354f88d4c64f15c6b93e6c81
|
|
4
|
+
data.tar.gz: b7e918cf87fb4bed7c0e412bd330a060d94c00133be11f35b3ca40155e681d82
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 547197df76b0353e60da6888b3acbdf256dcca6af2983cc5b0318f5445b80f505c223ddc37ed549a4563b632856e125f11dcf026a9a27e0247a7be29d0d6fd89
|
|
7
|
+
data.tar.gz: 003c1dc2cba82ec998dafadb3e788eb716a9c2fa692ac04a6ab343879cf12b70105882ae507497ff01697d9bfd50e7c5c667cebffb83dddbb0820da824b1e260
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,24 @@ All notable changes are documented here. The project follows Semantic Versioning
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [1.2.2] - 2026-10-31
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Packaged deploy CLI and safe provider installers ported from legacy 1.1.4, with equivalent explicit configuration, receipt verification, offline diagnostics and exit codes.
|
|
12
|
+
- Transitional core/package gates on Ruby 2.7–3.4, real Rails 7.0/7.1/7.2 fixtures, Sidekiq 7 middleware-chain smokes and an isolated Docker helper.
|
|
13
|
+
|
|
14
|
+
### Security
|
|
15
|
+
|
|
16
|
+
- Port SQL literal masking and full original-query inspection guards, sensitive symbol filtering, bounded diagnostic copies/context merging, and descriptor-anchored POSIX installation with regression coverage.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Preserve the existing Ruby >= 2.7 and < 3.5 requirement, protocol v1 and main-line integrations, including fiber-aware context and Rails Error Reporter.
|
|
21
|
+
- Correct legacy references introduced by conflict resolution; prepare 1.2.2 release metadata, English documentation and dedicated readiness evidence.
|
|
22
|
+
- Wire standalone deploy and installed-package tests into PR and release gates. Framework smokes remain focused evidence and do not automatically promote Best effort combinations.
|
|
23
|
+
|
|
24
|
+
|
|
7
25
|
## [1.2.1] - 2026-08-13
|
|
8
26
|
|
|
9
27
|
### Changed
|
data/README.md
CHANGED
|
@@ -1,74 +1,77 @@
|
|
|
1
1
|
# Chronos Ruby
|
|
2
2
|
|
|
3
|
-
Chronos Ruby 1.2.
|
|
3
|
+
Chronos Ruby 1.2.2 sends exceptions, metrics, and bounded telemetry from Ruby and Rails applications to Chronos. This is the transitional line for Ruby >= 2.7 and < 3.5, using protocol v1. Release preparation does not imply publication or promotion of unverified framework combinations.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## What the gem collects
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The transitional line can collect:
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
- timestamp,
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
- SQL
|
|
16
|
-
-
|
|
17
|
-
- breadcrumbs
|
|
9
|
+
- exception class, message, structured backtrace, and chained causes;
|
|
10
|
+
- timestamp, severity, tags, and an optional fingerprint;
|
|
11
|
+
- context, parameters, session, and user information supplied by the application;
|
|
12
|
+
- Ruby version, engine, platform, PID, opaque thread identifier, and hostname;
|
|
13
|
+
- environment, service, application version, release, revision, deploy ID, region, and instance;
|
|
14
|
+
- Rack/Rails request method, normalized route, status, duration, and timing breakdown;
|
|
15
|
+
- normalized SQL without literals or bind values, plus heuristic performance signals;
|
|
16
|
+
- Sidekiq/Active Job activity, cache operations, explicitly instrumented outbound HTTP, and loaded dependencies;
|
|
17
|
+
- bounded breadcrumbs supplied by the application or integrations.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
See the full inventory in [Collected data](docs/data-collected.md).
|
|
20
20
|
|
|
21
|
-
##
|
|
21
|
+
## What is not collected by default
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
The agent does not scan environment variables, the filesystem, or lockfiles. It does not collect HTTP bodies, cookies, authorization headers, email contents, raw SQL, bind values, cache values, or source code. Query plan inspection is disabled by default; when enabled, it uses the original SQL only on the local connection for `EXPLAIN` without `ANALYZE`, then discards it. Dependency inventory includes only names and versions of loaded dependencies, once per agent. The application remains responsible for data minimization and the legal basis for sending data.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
The explicit deploy CLI described below reads its documented environment variables and optional configuration file. It does not change how the Ruby configuration API works.
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
## Supported Ruby and framework versions
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
The core matrix covers MRI 2.7, 3.0, 3.1, 3.2, 3.3 and 3.4. Rails 7.0/7.1 and Sidekiq 7 require Ruby 2.7 or newer; Rails 7.2 requires Ruby 3.1 or newer. The exact application smoke pairs and their evidence are documented in [Compatibility](docs/compatibility.md). They remain Best effort until all mandatory promotion gates pass. Rails 8 and Ruby 4 belong to the separate 2.x plan.
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
The transitional integrations include fiber-aware context, Rails Error Reporter, Action Cable, Faraday, optional W3C Trace Context, automatic Rails/Sidekiq installation, and coexistence with an application-managed OpenTelemetry SDK. These integrations are preserved by this deploy CLI port.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Legacy Ruby 2.2–2.6 and Rails 4/5 consumers must use an appropriate 1.1 release. Technical compatibility does not provide security maintenance for end-of-life runtimes or frameworks.
|
|
34
|
+
|
|
35
|
+
## Installing in plain Ruby
|
|
36
|
+
|
|
37
|
+
Add the stable version to your `Gemfile`:
|
|
34
38
|
|
|
35
39
|
```ruby
|
|
36
|
-
gem "chronos-ruby", "~> 1.2.
|
|
40
|
+
gem "chronos-ruby", "~> 1.2.2"
|
|
37
41
|
```
|
|
38
42
|
|
|
39
|
-
Use Bundler 2
|
|
43
|
+
Use Bundler 2 on a compatible runtime (CI pins 2.4.22):
|
|
40
44
|
|
|
41
45
|
```bash
|
|
42
|
-
gem install bundler -v
|
|
46
|
+
gem install bundler -v 2.4.22
|
|
43
47
|
bundle install
|
|
44
48
|
```
|
|
45
49
|
|
|
46
|
-
|
|
50
|
+
Without Bundler:
|
|
47
51
|
|
|
48
52
|
```bash
|
|
49
|
-
gem install chronos-ruby -v 1.2.
|
|
53
|
+
gem install chronos-ruby -v 1.2.2
|
|
50
54
|
```
|
|
51
55
|
|
|
52
|
-
##
|
|
56
|
+
## Installing in Rails
|
|
53
57
|
|
|
54
|
-
|
|
58
|
+
Load the Rails integration explicitly to keep Rails/ActiveSupport out of plain Ruby applications:
|
|
55
59
|
|
|
56
60
|
```ruby
|
|
57
|
-
gem "chronos-ruby", "~> 1.2.
|
|
61
|
+
gem "chronos-ruby", "~> 1.2.2", :require => "chronos/rails"
|
|
58
62
|
```
|
|
59
63
|
|
|
60
|
-
|
|
64
|
+
Generate the initializer:
|
|
61
65
|
|
|
62
66
|
```bash
|
|
63
67
|
rails generate chronos:install
|
|
64
68
|
```
|
|
65
69
|
|
|
66
|
-
|
|
70
|
+
Version 0.5 introduced the Railtie, middleware, and idempotent subscribers through public APIs and feature detection. Automatic collection is disabled in tests and the console by default. See [Legacy Rails](docs/modules/rails-legacy.md).
|
|
67
71
|
|
|
68
|
-
##
|
|
72
|
+
## Minimal configuration
|
|
69
73
|
|
|
70
|
-
|
|
71
|
-
`https://chronosmonitor.com.br` por padrão. Recomendado: definir ambiente e serviço explicitamente.
|
|
74
|
+
An enabled agent requires `project_id` and `project_key`. The default `host` is `https://chronosmonitor.com.br`. Set the environment and service explicitly whenever possible.
|
|
72
75
|
|
|
73
76
|
```ruby
|
|
74
77
|
require "chronos"
|
|
@@ -83,28 +86,28 @@ Chronos.configure do |config|
|
|
|
83
86
|
end
|
|
84
87
|
```
|
|
85
88
|
|
|
86
|
-
TLS
|
|
89
|
+
TLS verification is enabled by default. The Ruby API requires an explicit `ssl_verify = false` to use HTTP, which should be restricted to local test endpoints. After configuration, verify credentials and ingestion:
|
|
87
90
|
|
|
88
91
|
```bash
|
|
89
92
|
bundle exec rake chronos:verify_integration
|
|
90
93
|
```
|
|
91
94
|
|
|
92
|
-
|
|
95
|
+
The task sends an identified synthetic exception and returns exit code `0` only after a correlated v1 response. In plain Ruby, register the task with `require "chronos/rake_tasks"` and `Chronos::RakeTasks.install`; from Ruby code, use `Chronos.verify_integration`. See [Integration verification](docs/modules/integration-verification.md).
|
|
93
96
|
|
|
94
|
-
##
|
|
97
|
+
## Automatic capture
|
|
95
98
|
|
|
96
|
-
|
|
99
|
+
For Rack applications, optionally install the middleware. It reports unhandled exceptions, preserves the original exception for the application, and does not consume request bodies.
|
|
97
100
|
|
|
98
101
|
```ruby
|
|
99
102
|
use Chronos::Integrations::Rack::Middleware,
|
|
100
103
|
:include_user_agent => false
|
|
101
104
|
```
|
|
102
105
|
|
|
103
|
-
|
|
106
|
+
In Rails, the Railtie installs middleware and subscribers once. See [Request monitoring](docs/modules/request-monitoring.md).
|
|
104
107
|
|
|
105
|
-
##
|
|
108
|
+
## Manual capture
|
|
106
109
|
|
|
107
|
-
|
|
110
|
+
Use asynchronous capture in application flows:
|
|
108
111
|
|
|
109
112
|
```ruby
|
|
110
113
|
begin
|
|
@@ -115,27 +118,27 @@ rescue StandardError => error
|
|
|
115
118
|
end
|
|
116
119
|
```
|
|
117
120
|
|
|
118
|
-
|
|
121
|
+
Synchronous capture is available for scripts and controlled shutdown:
|
|
119
122
|
|
|
120
123
|
```ruby
|
|
121
124
|
delivered = Chronos.notify_sync(RuntimeError.new("import failed"))
|
|
122
125
|
```
|
|
123
126
|
|
|
124
|
-
|
|
127
|
+
Internal capture failures return `false` without escaping into the application's main flow.
|
|
125
128
|
|
|
126
|
-
##
|
|
129
|
+
## User context
|
|
127
130
|
|
|
128
|
-
|
|
131
|
+
User context is opt-in. Send only necessary, authorized fields:
|
|
129
132
|
|
|
130
133
|
```ruby
|
|
131
134
|
Chronos.notify(error, :user => {"id" => "customer-42", "role" => "operator"})
|
|
132
135
|
```
|
|
133
136
|
|
|
134
|
-
|
|
137
|
+
Values are bounded and sanitized, but data minimization remains the application's responsibility. See [Execution context](docs/modules/context.md).
|
|
135
138
|
|
|
136
139
|
## Breadcrumbs
|
|
137
140
|
|
|
138
|
-
Breadcrumbs
|
|
141
|
+
Breadcrumbs use a bounded ring buffer in the current scope:
|
|
139
142
|
|
|
140
143
|
```ruby
|
|
141
144
|
Chronos.add_breadcrumb(
|
|
@@ -145,11 +148,11 @@ Chronos.add_breadcrumb(
|
|
|
145
148
|
)
|
|
146
149
|
```
|
|
147
150
|
|
|
148
|
-
|
|
151
|
+
The gem does not turn logs, SQL, or bodies into raw breadcrumbs. See [Breadcrumbs](docs/modules/breadcrumbs.md).
|
|
149
152
|
|
|
150
|
-
##
|
|
153
|
+
## Filters and LGPD
|
|
151
154
|
|
|
152
|
-
|
|
155
|
+
The gem blocks sensitive keys and detects Bearer tokens, JWTs, email addresses, Brazilian CPF/CNPJ identifiers, and valid payment card candidates. IPv4 addresses are anonymized by default. You can extend the blocklist, apply irreversible hashing, or add custom filters:
|
|
153
156
|
|
|
154
157
|
```ruby
|
|
155
158
|
Chronos.configure do |config|
|
|
@@ -159,11 +162,11 @@ Chronos.configure do |config|
|
|
|
159
162
|
end
|
|
160
163
|
```
|
|
161
164
|
|
|
162
|
-
|
|
165
|
+
Diagnostic trees are copied with cycle, depth, collection, node, and string limits before immutable event construction. Caller-owned telemetry data is not frozen. Sensitive symbol values are filtered before conversion to JSON text. Sanitization happens before queueing, retries, and backlog storage. See [Privacy and LGPD](docs/privacy-lgpd.md).
|
|
163
166
|
|
|
164
167
|
## Ignore rules
|
|
165
168
|
|
|
166
|
-
|
|
169
|
+
Configuration can exclude entire environments. Version `0.9.0.pre.2` introduced bounded local rules, preserved in the stable API:
|
|
167
170
|
|
|
168
171
|
```ruby
|
|
169
172
|
Chronos.ignore_if do |notice|
|
|
@@ -171,11 +174,11 @@ Chronos.ignore_if do |notice|
|
|
|
171
174
|
end
|
|
172
175
|
```
|
|
173
176
|
|
|
174
|
-
|
|
177
|
+
Rules receive a normalized, immutable notice. Only `true` discards it, and callback failures are contained. See [Ignore rules](docs/modules/ignore-rules.md).
|
|
175
178
|
|
|
176
|
-
##
|
|
179
|
+
## Performance monitoring
|
|
177
180
|
|
|
178
|
-
|
|
181
|
+
Version 0.7 introduced local request, query, and job aggregation into `metric_batch`; Version 0.8 added outbound HTTP. Groups contain bounded counts, errors, durations, histograms, approximate percentiles, severities, diagnostics, statuses, and timing breakdowns.
|
|
179
182
|
|
|
180
183
|
```ruby
|
|
181
184
|
Chronos.configure do |config|
|
|
@@ -190,7 +193,7 @@ Chronos.configure do |config|
|
|
|
190
193
|
config.apm_query_analysis_enabled = true
|
|
191
194
|
config.apm_query_analysis_max_queries = 100
|
|
192
195
|
|
|
193
|
-
# Opt-in:
|
|
196
|
+
# Opt-in: each eligible fingerprint may inspect catalogs, statistics, or plans.
|
|
194
197
|
config.apm_query_inspection_enabled = false
|
|
195
198
|
config.apm_query_statistics_enabled = false
|
|
196
199
|
config.apm_query_plan_enabled = false
|
|
@@ -201,27 +204,22 @@ Chronos.configure do |config|
|
|
|
201
204
|
end
|
|
202
205
|
```
|
|
203
206
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
## Sidekiq e Active Job
|
|
207
|
+
By default, the analysis pipeline does not read raw SQL or bind values. Opt-in inspection uses the original SQL only locally to request `EXPLAIN` without `ANALYZE`; it never includes that SQL in the event. Oversized, incomplete, or lexically ambiguous SQL is omitted instead of emitting partial literals. Plan inspection validates the entire original query and rejects multiple statements independently of normalized metadata. Static analysis produces candidates rather than instructions to create indexes. Errors use `error` severity; slowness and risks use `warning`; observed patterns use `info`; proposed fixes use `suggestion`. See [APM](docs/modules/apm-aggregation.md), [Requests](docs/modules/request-monitoring.md), and [SQL](docs/modules/sql-monitoring.md).
|
|
207
208
|
|
|
208
|
-
|
|
209
|
-
explícito continua disponível para aplicações sem Rails e suporta a API pública de middleware do Sidekiq 7:
|
|
209
|
+
## Sidekiq and Active Job
|
|
210
210
|
|
|
211
|
-
|
|
211
|
+
The Rails integration detects Sidekiq and installs its client/server middleware automatically. Explicit loading remains available in plain Ruby applications. Historical middleware support began with `0.6.0.pre.1`; Sidekiq 4/5 users must remain on a matching legacy release.
|
|
212
212
|
|
|
213
213
|
```ruby
|
|
214
|
-
gem "sidekiq", "~>
|
|
215
|
-
gem "chronos-ruby", "~> 1.
|
|
214
|
+
gem "sidekiq", "~> 7.3"
|
|
215
|
+
gem "chronos-ruby", "~> 1.2.2", :require => "chronos/rails"
|
|
216
216
|
```
|
|
217
217
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
O envelope de contexto não altera argumentos públicos e contém somente IDs limitados de trace/span/request e flags. Active Job usa um campo serializado com namespace (`chronos_context`) e hooks públicos. Erros aninhados são deduplicados e reerguidos. Veja [Sidekiq legado](docs/modules/sidekiq-legacy.md), [Active Job](docs/modules/active-job.md) e [Jobs](docs/modules/job-monitoring.md).
|
|
218
|
+
Without Rails, load `chronos/sidekiq` after Sidekiq. The context envelope preserves public arguments and contains only bounded trace/span/request IDs and flags. Active Job uses its namespaced `chronos_context` field and public serialization hooks. Nested errors are deduplicated and re-raised. See [Sidekiq](docs/modules/sidekiq-legacy.md), [Active Job](docs/modules/active-job.md), and [Jobs](docs/modules/job-monitoring.md).
|
|
221
219
|
|
|
222
220
|
## Deploy tracking
|
|
223
221
|
|
|
224
|
-
|
|
222
|
+
Version 0.9 introduced synchronous deploy reporting and fixed correlation across events:
|
|
225
223
|
|
|
226
224
|
```ruby
|
|
227
225
|
Chronos.notify_deploy(
|
|
@@ -233,35 +231,45 @@ Chronos.notify_deploy(
|
|
|
233
231
|
)
|
|
234
232
|
```
|
|
235
233
|
|
|
236
|
-
Configure release/revision/deploy
|
|
234
|
+
Configure release/revision/deploy metadata when each new process starts. The Ruby API does not read Git or environment variables automatically. Capistrano is optional; Kamal and GitHub Actions recipes are available in `examples/deploy/`. See [Deploys](docs/modules/deploys.md).
|
|
235
|
+
|
|
236
|
+
Version 1.2.2 ports a packaged deploy command without a copied Ruby notification script:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
bundle exec chronos deploy notify
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
Supply `CHRONOS_PROJECT_ID`, `CHRONOS_PROJECT_KEY`, `CHRONOS_ENVIRONMENT`, a stable `CHRONOS_DEPLOY_ID`, and `CHRONOS_DEPLOY_REVISION` or `CHRONOS_DEPLOY_VERSION` for the artifact actually published. The CLI reads explicit ENV and optional public YAML without booting Rails. It requires HTTPS and never accepts the project key as a process argument. Optional integration installers cover Kamal, Capistrano, GitHub Actions, GitLab CI, Jenkins, and Azure DevOps. Integration file installation requires POSIX filesystem support (Linux/macOS) and anchors operations to opened directories to prevent symlink redirection.
|
|
237
243
|
|
|
238
|
-
|
|
244
|
+
This branch prepares 1.2.2; publication remains subject to the [release gates](docs/release-1.2.2-readiness.md). See the [CLI guide](docs/deploy-cli.md) for configuration, receipt verification, exit codes, and integration fragments.
|
|
239
245
|
|
|
240
|
-
|
|
246
|
+
## Asynchronous queue
|
|
247
|
+
|
|
248
|
+
The queue has a fixed capacity, drops the newest event when full, and starts workers only after the first accepted capture.
|
|
241
249
|
|
|
242
250
|
```mermaid
|
|
243
251
|
flowchart LR
|
|
244
|
-
E[
|
|
245
|
-
N --> P[
|
|
246
|
-
P --> S[
|
|
247
|
-
S --> D[
|
|
248
|
-
D --> Q[
|
|
249
|
-
Q --> W[
|
|
252
|
+
E[Exception or telemetry] --> N[Normalization]
|
|
253
|
+
N --> P[Sanitization]
|
|
254
|
+
P --> S[Bounded serialization]
|
|
255
|
+
S --> D[Delivery pipeline]
|
|
256
|
+
D --> Q[Bounded queue]
|
|
257
|
+
Q --> W[Fixed workers]
|
|
250
258
|
W --> H[Net::HTTP]
|
|
251
|
-
W --> B[
|
|
259
|
+
W --> B[In-memory backlog]
|
|
252
260
|
```
|
|
253
261
|
|
|
254
|
-
Use `Chronos.flush(timeout)`
|
|
262
|
+
Use `Chronos.flush(timeout)` before termination and `Chronos.close(timeout)` during shutdown. Workers are recreated after a fork. See [Asynchronous queue](docs/modules/async-queue.md).
|
|
255
263
|
|
|
256
|
-
## Retry
|
|
264
|
+
## Retry and backlog
|
|
257
265
|
|
|
258
|
-
|
|
266
|
+
Retries cover network errors and HTTP `408`, `429`, and `5xx`, with exponential backoff, jitter, and bounded attempts. Other `4xx` responses are permanent failures. A circuit breaker reduces retry storms.
|
|
259
267
|
|
|
260
|
-
|
|
268
|
+
The backlog stores only sanitized, serialized events. It has a fixed capacity, lives in memory, and is lost on shutdown. Remote configuration accepts only sampling, enabled event types, a smaller payload limit, exact fingerprints, send interval, and a kill switch; it never changes the host, credentials, or TLS settings, or executes code. See [Retry and backlog](docs/modules/retry-backlog.md), [Sampling](docs/modules/sampling.md), and [Remote configuration](docs/modules/remote-configuration.md).
|
|
261
269
|
|
|
262
|
-
##
|
|
270
|
+
## Environment-based configuration
|
|
263
271
|
|
|
264
|
-
|
|
272
|
+
The Ruby API does not scan the environment. Read only variables chosen by your application:
|
|
265
273
|
|
|
266
274
|
```ruby
|
|
267
275
|
Chronos.configure do |config|
|
|
@@ -285,55 +293,99 @@ Chronos.configure do |config|
|
|
|
285
293
|
end
|
|
286
294
|
```
|
|
287
295
|
|
|
288
|
-
|
|
296
|
+
See [Configuration](docs/configuration.md) for all options, defaults, and limits.
|
|
289
297
|
|
|
290
298
|
## Troubleshooting
|
|
291
299
|
|
|
292
|
-
|
|
300
|
+
Configuration errors are raised during `Chronos.configure`; capture and delivery failures are contained and may be reported to the safe logger. Check TLS, credentials, timeouts, and the return value of `flush`. See [Troubleshooting](docs/troubleshooting.md).
|
|
301
|
+
|
|
302
|
+
## Benchmarks
|
|
303
|
+
|
|
304
|
+
The stable release gate runs a repeatable Rack comparison and load against a fake endpoint:
|
|
293
305
|
|
|
294
|
-
|
|
306
|
+
```bash
|
|
307
|
+
ITERATIONS=50000 WARMUP=5000 SAMPLES=7 bundle _2.4.22_ exec ruby benchmarks/comparative.rb
|
|
308
|
+
ITERATIONS=500 bundle _2.4.22_ exec ruby benchmarks/fake_endpoint_load.rb
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
Results depend on the runtime and hardware. There is no general claim of superiority: record CPU, OS, Ruby, commit, warmup, samples, median, and dispersion. Additional benchmarks are in `benchmarks/` and documented in [Performance](docs/performance.md).
|
|
312
|
+
|
|
313
|
+
## Migrating from Airbrake
|
|
314
|
+
|
|
315
|
+
Migrate in stages. Run both agents together only during validation to avoid prolonged duplicate reporting. Callbacks and notices are not API-compatible and must be translated and tested explicitly. See the [Airbrake migration guide](docs/migration-from-airbrake.md).
|
|
316
|
+
|
|
317
|
+
## Local development
|
|
295
318
|
|
|
296
|
-
|
|
319
|
+
On a compatible Ruby, install Bundler 2.4.22 and run `bundle _2.4.22_ install`. Use `bin/console` for inspection. See [Architecture](docs/architecture.md).
|
|
320
|
+
|
|
321
|
+
## Tests
|
|
322
|
+
|
|
323
|
+
The transitional CI entry point runs RSpec/security regressions, RuboCop 1.57, standalone CLI/adapters, documentation and built-gem smoke tests:
|
|
297
324
|
|
|
298
325
|
```bash
|
|
299
|
-
|
|
300
|
-
ITERATIONS=500 bundle _1.17.3_ exec ruby benchmarks/fake_endpoint_load.rb
|
|
326
|
+
sh script/ci_transitional
|
|
301
327
|
```
|
|
302
328
|
|
|
303
|
-
|
|
329
|
+
For a focused suite/lint check with dependencies installed, use `bundle _2.4.22_ exec rake`. The additional tests and installed-package gates are required before release as well.
|
|
330
|
+
|
|
331
|
+
### Prepare Docker
|
|
304
332
|
|
|
305
|
-
|
|
333
|
+
Start Docker Desktop on macOS and verify both client and server:
|
|
306
334
|
|
|
307
|
-
|
|
335
|
+
```bash
|
|
336
|
+
open -a Docker
|
|
337
|
+
docker version
|
|
338
|
+
docker info
|
|
339
|
+
```
|
|
308
340
|
|
|
309
|
-
|
|
341
|
+
The helper uses Linux/amd64 (emulated on Apple Silicon), mounts the repository read-only, and runs a temporary copy without local Bundler configuration, credentials directories, `.env` files or lockfiles. Host gems and lockfiles are unchanged. Images and dependencies require registry access; no SaaS credentials are needed.
|
|
310
342
|
|
|
311
|
-
|
|
343
|
+
### Run individual core or framework checks
|
|
312
344
|
|
|
313
345
|
```bash
|
|
314
|
-
|
|
346
|
+
sh script/test_transitional_docker 2.7
|
|
347
|
+
sh script/test_transitional_docker 3.4
|
|
348
|
+
sh script/test_transitional_docker 2.7 examples/rails-7.0
|
|
349
|
+
sh script/test_transitional_docker 3.2 examples/rails-7.1
|
|
350
|
+
sh script/test_transitional_docker 3.4 examples/rails-7.2
|
|
351
|
+
sh script/test_transitional_docker 3.4 examples/sidekiq-7
|
|
315
352
|
```
|
|
316
353
|
|
|
317
|
-
|
|
354
|
+
Core checks accept Ruby 2.7, 3.0, 3.1, 3.2, 3.3 and 3.4. Rails fixtures pin 7.0.10, 7.1.6 and 7.2.4; Sidekiq pins 7.3.10. The Rails application checks controller/SQL telemetry, Active Job, Error Reporter deduplication, initialization and deploy generation. Sidekiq checks its real middleware chains without starting Redis or a worker process.
|
|
318
355
|
|
|
319
|
-
|
|
356
|
+
### Run the complete configured matrix
|
|
320
357
|
|
|
321
|
-
|
|
358
|
+
This block stops at the first failure and returns a nonzero status:
|
|
322
359
|
|
|
323
360
|
```bash
|
|
324
|
-
|
|
361
|
+
(
|
|
362
|
+
set -e
|
|
363
|
+
for version in 2.7 3.0 3.1 3.2 3.3 3.4; do
|
|
364
|
+
sh script/test_transitional_docker "$version"
|
|
365
|
+
sh script/test_transitional_docker "$version" examples/sidekiq-7
|
|
366
|
+
done
|
|
367
|
+
for version in 2.7 3.0; do
|
|
368
|
+
sh script/test_transitional_docker "$version" examples/rails-7.0
|
|
369
|
+
done
|
|
370
|
+
for version in 2.7 3.1 3.2; do
|
|
371
|
+
sh script/test_transitional_docker "$version" examples/rails-7.1
|
|
372
|
+
done
|
|
373
|
+
for version in 3.1 3.3 3.4; do
|
|
374
|
+
sh script/test_transitional_docker "$version" examples/rails-7.2
|
|
375
|
+
done
|
|
376
|
+
)
|
|
325
377
|
```
|
|
326
378
|
|
|
327
|
-
A
|
|
379
|
+
Keep per-runtime logs and resolved versions. A stopped matrix does not approve unexecuted combinations. These checks do not replace dependency audit, benchmarks/load, Redis-backed worker lifecycle, authorized provider execution or SaaS receipt/ledger/projection gates. See [1.2.2 readiness](docs/release-1.2.2-readiness.md). Legacy Docker helpers remain historical tools and do not validate this gem's Ruby requirement.
|
|
328
380
|
|
|
329
|
-
##
|
|
381
|
+
## Contributing
|
|
330
382
|
|
|
331
|
-
|
|
383
|
+
Open an issue before adding a public API or dependency. Public classes require YARD documentation, tests, module documentation, and compatibility evidence. See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
332
384
|
|
|
333
|
-
##
|
|
385
|
+
## Security
|
|
334
386
|
|
|
335
|
-
|
|
387
|
+
Never include credentials in context. Releases use Trusted Publishing, SHA-256 checksums, and an SBOM; dependencies are audited. Report vulnerabilities through the private channel in [SECURITY.md](SECURITY.md).
|
|
336
388
|
|
|
337
|
-
##
|
|
389
|
+
## License
|
|
338
390
|
|
|
339
|
-
Chronos Ruby
|
|
391
|
+
Chronos Ruby is distributed under the MIT license. See [LICENSE.txt](LICENSE.txt).
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# CLI de deploy legada — implementação para revisão
|
|
2
|
+
|
|
3
|
+
Em 31/10/2026, a branch de trabalho é `legacy/1`, baseline `a8ab679`, versão 1.1.3, Ruby >= 2.2.10 e < 2.7. A autorização para executar o plano permite desenvolver esta exceção limitada ao congelamento. A versão de lançamento foi definida como 1.1.4; sua publicação continua condicionada aos gates e ao aceite. O artefato local 1.1.3 anterior serviu somente para validação, nunca para substituir uma versão publicada.
|
|
4
|
+
|
|
5
|
+
A CLI usa OptionParser, configuração explícita e a API existente, sem boot Rails. ENV pertence à CLI. O alias Rake também não inicializa Rails. O generator Rails é somente um adaptador do instalador. Não há descoberta de revisão ou identidade por variáveis do fornecedor.
|
|
6
|
+
|
|
7
|
+
`legacy/1.2` aponta para código anterior (b2a1347), portanto não foi adotada como ref transitória. O backport deve partir de uma ref de manutenção confirmada baseada em 1.2.1; nenhuma branch foi trocada automaticamente.
|
|
8
|
+
|
|
9
|
+
A implementação atual fornece JSON em todas as respostas operacionais. O contrato desta entrega mantém a CLI leve: não oferece boot Rails; credenciais de initializer continuam atendidas pela API existente. Conflitos exibem o template proposto com o conteúdo anterior omitido por privacidade; faça merge manual ou use force explicitamente. Não gera configuração pública automaticamente. Templates de CI são fragmentos para merge manual e exigem os outputs reais exportados pelo cliente.
|
|
10
|
+
|
|
11
|
+
Gates pendentes: instalação e execução em cada Ruby legado, Rails 4.2/5.2 nos pares documentados, receipt/ledger/projeção no SaaS local, execução nos fornecedores, backport transitório e aceite de manutenção/release. A suíte standalone e o smoke do pacote foram adicionados à matriz existente; testes locais no Ruby 3.4 não comprovam suporte legado.
|
|
12
|
+
|
|
13
|
+
Revisão do contrato: diagnose exige a configuração completa de notificação, mas não autentica; host HTTPS obrigatório; metadados acima do limite do protocolo são rejeitados. Opções fora do comando correto são erros. Verify preserva verification_status do receipt, desliga dependências e nunca envia deploy. A CLI desativa retries e backlog; notify ainda pode enviar eventos de dependências. Falha no close após notify impede sucesso confirmado. Escrita usa arquivo temporário, criação exclusiva ou substituição explícita, com rechecagem de symlinks.
|
|
14
|
+
|
|
15
|
+
Preparação da matriz: [procedimento e helper Docker](../legacy-test-environment.md). Sintaxe validada com gramática Ruby 2.2 é evidência estática apenas.
|
|
16
|
+
|
|
17
|
+
Evidência local desta revisão: 201 exemplos RSpec passaram com Gemfile temporário e ferramentas locais no Ruby 3.4; 17 testes de CLI/configuração/fechamento (84 assertions), 2 testes de adaptadores (7 assertions) e 6 testes HTTPS (36 assertions) passaram. O pacote foi construído e o executável extraído respondeu help. Isso não equivale à instalação em Ruby suportado. A gramática Ruby 2.2 foi verificada estaticamente. RuboCop local 1.57 é suplementar; o gate oficial continua sendo 0.49 nas imagens legadas.
|
|
18
|
+
|
|
19
|
+
Correções da revisão de segurança: lexer SQL conservador com rejeição de entrada truncada/ambígua e validação completa antes de inspeção; sanitização de Symbol; cópia estrutural limitada antes da construção e merge de eventos; instalador POSIX baseado em descritores, usando Fiddle da biblioteca padrão para openat/mkdirat/linkat/renameat/unlinkat. Não há shell ou biblioteca nativa escolhida pelo usuário. A raiz é aberta uma vez por instalação e os descendentes são abertos sem seguir symlinks; a escrita fica ancorada aos diretórios abertos. Os testes de corrida simulam substituições entre as operações e verificam ausência de alteração em diretório externo.
|
|
20
|
+
|
|
21
|
+
Evidência após as correções de segurança: gates de core/segurança/pacote passaram em Docker Linux/amd64 nos cinco Rubies 2.2.10–2.6.10, com 221 exemplos RSpec, RuboCop 0.49.1 sem ocorrências em 225 arquivos, 25 testes adicionais de fonte (127 assertions) e 6 testes HTTPS da gem instalada (36 assertions) por runtime. Os gates Rails/Sidekiq, fornecedores, SaaS e promoção continuam separados.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Transitional deploy automation port
|
|
2
|
+
|
|
3
|
+
Base: main 1.2.1 (`b31d703`), branch feat/transitional-deploy-automation-1.2.2. The cherry-picked CLI and security behavior is retained; the gemspec remains Ruby >= 2.7 and < 3.5. Version 1.2.2 is a limited port, not the planned 2.x migration.
|
|
4
|
+
|
|
5
|
+
Review against main confirmed the existing Rails Error Reporter, fiber-aware context, Action Cable, Faraday, W3C/OpenTelemetry integration paths remain in place. Agent context changes are limited to bounded copies/merge and breadcrumb preservation. Tests exercise ordinary modern behavior and the five security regressions.
|
|
6
|
+
|
|
7
|
+
Unlike the legacy release, this line uses Bundler 2.4.22/RuboCop 1.57, a transitional core matrix, real Rails 7 fixtures and Sidekiq 7 middleware-chain fixtures. PR and release share a reusable validation workflow; framework dependency locks are uploaded as evidence. The old legacy scripts remain historical and cannot validate this gem's Ruby requirement.
|
|
8
|
+
|
|
9
|
+
The CLI remains lightweight and never boots Rails implicitly. Generator integration uses the same installer. Optional Rails credential boot is deferred to the distinct modern plan. No protocol/schema change, hard-mode activation or SaaS rollout is included. See [readiness](../release-1.2.2-readiness.md) for observed results and pending gates.
|
|
10
|
+
|
|
11
|
+
Local verification passed the six core runtimes, eight combined Rails/Sidekiq application pairs and six standalone Sidekiq middleware pairs, plus the audit and release-readiness execution gates. Remaining external/approval gates and evidence limitations are recorded in readiness; no compatibility status or published capability is promoted implicitly.
|