chronos-ruby 0.9.0.pre.4 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84266b3c93fc92c15268d44e3625762f471c9cf99fa0523b6f5d883f846906e4
4
- data.tar.gz: bf3d2c641bbb7f117a1c9c76519fa756057f72108d899cb64d86e2eeff305423
3
+ metadata.gz: 3fc9daff111666fdf7309797c5f8aa81a639c8f59ea1733be48740b9aea6b247
4
+ data.tar.gz: a8d7cd786b233078e5516e3d1ce0c92b986d045ebd4d8c29a7d9cd80ae75fb93
5
5
  SHA512:
6
- metadata.gz: 9b54a3aef38f706677794b39740558586d9c69f083a3c2b3f2dc6ea20e3b60f2fe84765eb61a44fe2f230a03c03dcb27047cdd7a1853b14fc805fcb914d7cfb8
7
- data.tar.gz: 2f915f461e658f93269d35e52f6d728ff32ef90a4a6ac765a6b92194a1fc53b06ca5350b2bc34c8d84197bf2263d523ead9a62ada46edbd9ae46363d3de27e05
6
+ metadata.gz: 1f60a09480aa5766676d673579ffe1b5b007d044881fc9b1f70f672c414ddf7e1a014cc63eaeee8ee6f63fa7261aa5dc92f8f9b1cc6089898ecf015d1940a83c
7
+ data.tar.gz: '08342c5a665004cbfa9fec52164f86e82d003b3d587bf931ae220c44ec4188c91141852e424f726f55a7b7d5dec4592190dc7cef9dc6c4e05f0eec8255bd32b4'
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.0.0] - 2026-07-29
8
+
9
+ ### Added
10
+
11
+ - stable legacy release gates for Ruby 2.2.10 through 2.6.10, Rails 4.2/5.2, Sidekiq 4/5, documentation, repeatable comparison, and fake-endpoint load validation;
12
+ - the remaining mandatory module documents and ADRs for feature detection, context storage, sampling, and future OpenTelemetry interoperability.
13
+
14
+ ### Changed
15
+
16
+ - promoted the reviewed public API and protocol v1 implementation from `0.9.0.pre.4` to `1.0.0`;
17
+ - release publishing now accepts `v1.*` tags and cannot publish until every legacy compatibility and release-readiness job succeeds;
18
+ - compatibility status is now `Supported` only for the exact runtime/framework combinations covered by green release gates.
19
+
20
+ ### Security
21
+
22
+ - stable artifacts continue to use RubyGems Trusted Publishing, SHA-256 checksums, SPDX SBOMs, strict payload privacy contracts, and dependency auditing;
23
+ - package signing remains deferred until a trusted signing-key lifecycle is available.
24
+
7
25
  ## [0.9.0.pre.4] - 2026-07-22
8
26
 
9
27
  ### Added
data/README.md CHANGED
@@ -1,73 +1,73 @@
1
1
  # Chronos Ruby
2
2
 
3
- Chronos Ruby is the framework-independent client for sending Ruby application errors and bounded telemetry to Chronos. Version 0.9 adds synchronous deploy tracking and bounded release correlation across every event.
3
+ Chronos Ruby 1.0.0 é o agente independente de framework para enviar exceções e telemetria limitada de aplicações Ruby ao Chronos. Esta é a linha estável legado, compatível com o protocolo v1 e voltada a Ruby 2.2.10–2.6.
4
4
 
5
- ## What the gem collects
5
+ ## O que a gem coleta
6
6
 
7
- Version 0.9 can collect:
7
+ A versão 1.0 pode coletar:
8
8
 
9
- - exception class, message, structured backtrace, and chained causes;
10
- - timestamp, severity, tags, and an optional fingerprint;
11
- - application-supplied context, parameters, session, and user fields;
12
- - Ruby version, engine, platform, process ID, opaque thread ID, and hostname;
13
- - application version, environment, and service name.
14
- - Rack method, normalized route, status, duration, request ID, host, query-free path, optional user agent, controller/action, response size, trace ID, and already-parsed parameters when the middleware is used;
15
- - bounded breadcrumbs explicitly supplied by the application or integration.
16
- - release, revision, deploy ID, environment, service, region, and instance correlation;
17
- - explicit bounded deployment metadata supplied through the public API or integration.
9
+ - classe, mensagem, backtrace estruturado e causas encadeadas da exceção;
10
+ - timestamp, severidade, tags e fingerprint opcional;
11
+ - contexto, parâmetros, sessão e usuário fornecidos pela aplicação;
12
+ - versão, engine e plataforma Ruby, PID, thread opaca e hostname;
13
+ - ambiente, serviço, versão da aplicação, release, revision, deploy ID, região e instância;
14
+ - método, rota normalizada, status, duração e breakdown de requests Rack/Rails;
15
+ - SQL normalizado sem literais/binds e sinais heurísticos de desempenho;
16
+ - jobs Sidekiq/Active Job, cache, HTTP externo explicitamente instrumentado e dependências carregadas;
17
+ - breadcrumbs limitados fornecidos pela aplicação ou por integrações.
18
18
 
19
- See [Data collected](docs/data-collected.md) for the complete field table.
19
+ Veja a tabela completa em [Dados coletados](docs/data-collected.md).
20
20
 
21
- ## What is not collected by default
21
+ ## O que não é coletado por padrão
22
22
 
23
- Chronos Ruby does not inspect environment variables, request/response bodies, cookies, Authorization headers, source code, database contents, lockfiles, or gem paths. Dependency reporting reads only already loaded gem names and versions once per agent. Application-supplied fields are recursively sanitized, but applications should still avoid sending unnecessary personal, health, financial, or authentication data.
23
+ A gem não varre variáveis de ambiente, sistema de arquivos ou lockfiles e não lê bodies HTTP, cookies, headers de autorização, conteúdo de e-mail, SQL bruto, binds, valores de cache ou código-fonte. O inventário de dependências contém somente nomes e versões carregados, uma vez por agente. A aplicação continua responsável por minimização e base legal dos dados enviados.
24
24
 
25
- ## Supported Ruby and Rails versions
25
+ ## Versões Ruby e Rails suportadas
26
26
 
27
- Version 0.x targets Ruby 2.2.10 through Ruby 2.6. Version 0.5 provides best-effort Rails 4.2 through 5.2 integration through public framework APIs and feature detection. All supported combinations must pass dedicated CI before being listed as supported.
27
+ A versão 1.0.0 suporta Ruby puro e Rack em Ruby 2.2.10, 2.3.8, 2.4.10, 2.5.9 e 2.6.10. As combinações Rails validadas são Rails 4.2 com Ruby 2.2.10/2.3.8 e Rails 5.2 com Ruby 2.5.9/2.6.10. Sidekiq 4.2.10 com Ruby 2.2.10 e Sidekiq 5.2.10 com Ruby 2.5.9 também possuem gates dedicados.
28
28
 
29
- See [Compatibility](docs/compatibility.md).
29
+ Rubies e frameworks antigos estão fora do suporte de segurança de seus mantenedores. A Chronos oferece compatibilidade técnica, não manutenção de segurança do runtime. Veja [Compatibilidade](docs/compatibility.md).
30
30
 
31
- ## Plain Ruby installation
31
+ ## Instalação em Ruby puro
32
32
 
33
- The current public build is a pre-release. Add its exact version to the application's `Gemfile`:
33
+ Obrigatório: adicione a versão estável ao `Gemfile`.
34
34
 
35
35
  ```ruby
36
- gem "chronos-ruby", "0.9.0.pre.4"
36
+ gem "chronos-ruby", "~> 1.0.0"
37
37
  ```
38
38
 
39
- Install with a Bundler version compatible with the application. For the oldest supported runtime:
39
+ Em runtimes antigos, use Bundler compatível:
40
40
 
41
41
  ```bash
42
42
  gem install bundler -v 1.17.3
43
43
  bundle _1.17.3_ install
44
44
  ```
45
45
 
46
- Without Bundler:
46
+ Sem Bundler:
47
47
 
48
48
  ```bash
49
- gem install chronos-ruby --pre
49
+ gem install chronos-ruby -v 1.0.0
50
50
  ```
51
51
 
52
- ## Rails installation
52
+ ## Instalação em Rails
53
53
 
54
- Version 0.5 exposes Rails support explicitly, keeping Rails and ActiveSupport out of plain Ruby applications:
54
+ Obrigatório: carregue a integração Rails explicitamente para manter Rails/ActiveSupport fora de aplicações Ruby puras.
55
55
 
56
56
  ```ruby
57
- gem "chronos-ruby", "0.9.0.pre.4", :require => "chronos/rails"
57
+ gem "chronos-ruby", "~> 1.0.0", :require => "chronos/rails"
58
58
  ```
59
59
 
60
- Generate the initializer with:
60
+ Gere o initializer:
61
61
 
62
62
  ```bash
63
63
  rails generate chronos:install
64
64
  ```
65
65
 
66
- The Railtie installs the Rack middleware and notification subscribers idempotently. Automatic integration is disabled in test and console by default and can be controlled with `rails_enabled`, `rails_capture_in_test`, `rails_capture_in_console`, and `rails_capture_user_agent`. See [Rails 4.2 and 5.2 integration](docs/modules/rails-legacy.md).
66
+ A Versão 0.5 introduziu Railtie, middleware e subscribers idempotentes por APIs públicas e feature detection. A coleta automática fica desativada em test e console por padrão. Veja [Rails legado](docs/modules/rails-legacy.md).
67
67
 
68
- ## Minimum configuration
68
+ ## Configuração mínima
69
69
 
70
- `project_id`, `project_key`, and an HTTPS `host` are required while the agent is enabled:
70
+ Obrigatório quando o agente está habilitado: `project_id`, `project_key` e `host` HTTPS. Recomendado: definir ambiente e serviço explicitamente.
71
71
 
72
72
  ```ruby
73
73
  require "chronos"
@@ -82,43 +82,28 @@ Chronos.configure do |config|
82
82
  end
83
83
  ```
84
84
 
85
- HTTPS verification is enabled by default. HTTP requires explicitly setting `ssl_verify = false` and should only be used with a local test server.
86
-
87
- ## Verify the Chronos integration
88
-
89
- After configuring the application, Rails projects can verify credentials and end-to-end ingestion with:
85
+ TLS é verificado por padrão. HTTP exige `ssl_verify = false` explicitamente e deve ser limitado a endpoints locais de teste. Depois de configurar, valide credenciais e ingestão:
90
86
 
91
87
  ```bash
92
88
  bundle exec rake chronos:verify_integration
93
89
  ```
94
90
 
95
- The task sends one synthetic exception identified as an integration verification and prints one JSON object. It exits with status `0` only when Chronos confirms valid credentials and receipt of the correlated event; configuration, authentication, inactive-project, network, protocol, rate-limit, and receiver failures exit nonzero with safe guidance.
96
-
97
- Plain Ruby Rakefiles can install the same task explicitly after loading their configuration:
91
+ O task envia uma exceção sintética identificada e retorna código `0` após uma resposta v1 correlacionada. Em Ruby puro, instale o task com `require "chronos/rake_tasks"` e `Chronos::RakeTasks.install`; por código, use `Chronos.verify_integration`. Veja [Verificação da integração](docs/modules/integration-verification.md).
98
92
 
99
- ```ruby
100
- require "chronos"
101
- # Chronos.configure { |config| ... }
102
- require "chronos/rake_tasks"
103
- Chronos::RakeTasks.install
104
- ```
93
+ ## Captura automática
105
94
 
106
- Ruby code may call `result = Chronos.verify_integration`, inspect `result.success?`, and serialize `result.to_h` or `result.to_json`. The result contains only bounded contract fields; it never exposes `project_key`, raw server responses, stack traces, source paths, or receiver internals. See [Integration verification](docs/modules/integration-verification.md).
107
-
108
- ## Automatic capture
109
-
110
- Rack applications can capture unhandled exceptions automatically and preserve the application error semantics:
95
+ Opcional em Rack: instale o middleware. Ele notifica exceções não tratadas, preserva a mesma exceção para a aplicação e não consome bodies.
111
96
 
112
97
  ```ruby
113
98
  use Chronos::Integrations::Rack::Middleware,
114
99
  :include_user_agent => false
115
100
  ```
116
101
 
117
- The middleware notifies asynchronously and re-raises the same exception. It never reads the request body, raw query string, cookies, authorization headers, or response body. See [Rack integration and context](docs/modules/rack-context.md).
102
+ Em Rails, o Railtie instala middleware e subscribers uma única vez. Veja [Monitoramento de requests](docs/modules/request-monitoring.md).
118
103
 
119
- ## Manual capture
104
+ ## Captura manual
120
105
 
121
- Asynchronous capture is recommended for application code:
106
+ Recomendado no fluxo da aplicação: captura assíncrona.
122
107
 
123
108
  ```ruby
124
109
  begin
@@ -129,27 +114,27 @@ rescue StandardError => error
129
114
  end
130
115
  ```
131
116
 
132
- Synchronous capture waits for the HTTP result and is useful in scripts or controlled shutdown paths:
117
+ Opcional para scripts e shutdown controlado: captura síncrona.
133
118
 
134
119
  ```ruby
135
120
  delivered = Chronos.notify_sync(RuntimeError.new("import failed"))
136
121
  ```
137
122
 
138
- Both methods return `false` instead of allowing an internal agent error to escape.
123
+ Falhas internas retornam `false` e não escapam para o fluxo principal.
139
124
 
140
- ## User context
125
+ ## Contexto de usuário
141
126
 
142
- User data is opt-in and must contain only values your application is allowed to send:
127
+ Contexto de usuário é opt-in. Envie somente campos necessários e autorizados:
143
128
 
144
129
  ```ruby
145
130
  Chronos.notify(error, :user => {"id" => "customer-42", "role" => "operator"})
146
131
  ```
147
132
 
148
- Version 0.4 sanitizes this context before delivery and before it can enter retry storage. Data minimization remains the application's responsibility.
133
+ O valor é limitado e sanitizado, mas a minimização continua sendo responsabilidade da aplicação. Veja [Contexto de execução](docs/modules/context.md).
149
134
 
150
135
  ## Breadcrumbs
151
136
 
152
- Breadcrumbs use a fixed circular buffer scoped to the current execution:
137
+ Breadcrumbs formam um buffer circular delimitado no escopo atual:
153
138
 
154
139
  ```ruby
155
140
  Chronos.add_breadcrumb(
@@ -159,35 +144,25 @@ Chronos.add_breadcrumb(
159
144
  )
160
145
  ```
161
146
 
162
- No log, SQL, HTTP, cache, job, request body, or response body payload is collected automatically. Unknown categories become `custom`, and metadata is bounded and sanitized before queueing.
147
+ A gem não transforma logs, SQL ou bodies em breadcrumbs brutos. Veja [Breadcrumbs](docs/modules/breadcrumbs.md).
163
148
 
164
- ## Filters and LGPD
149
+ ## Filtros e LGPD
165
150
 
166
- Version 0.4 recursively redacts sensitive keys and detects Bearer tokens, JWTs, e-mail addresses, CPF, CNPJ, and valid payment-card candidates in free text. IPv4 addresses are anonymized by default. Applications can add blocklist matchers, hash selected identifiers, or install custom filters:
151
+ A gem bloqueia chaves sensíveis e detecta Bearer tokens, JWTs, e-mails, CPF, CNPJ e candidatos válidos a cartão. IPv4 é anonimizado por padrão. Opcionalmente, amplie a blocklist, aplique hash irreversível ou filtros próprios:
167
152
 
168
153
  ```ruby
169
154
  Chronos.configure do |config|
170
- # required options omitted
171
155
  config.blocklist_keys += [:medical_record, /bank_account/i]
172
156
  config.hash_keys += [:customer_id]
173
157
  config.filters << proc { |key, value| key.to_s == "internal_reference" ? "[REMOVED]" : value }
174
158
  end
175
159
  ```
176
160
 
177
- Sanitization runs before queueing and transport. See [Privacy and LGPD](docs/privacy-lgpd.md) for behavior, limitations, health and financial examples, and a payload audit procedure.
161
+ Sanitização ocorre antes de fila, retry e backlog. Veja [Privacidade e LGPD](docs/privacy-lgpd.md).
178
162
 
179
163
  ## Ignore rules
180
164
 
181
- Entire environments can be ignored:
182
-
183
- ```ruby
184
- Chronos.configure do |config|
185
- # required options omitted
186
- config.ignored_environments = ["development", "test"]
187
- end
188
- ```
189
-
190
- Version `0.9.0.pre.2` adds bounded local rules after configuration:
165
+ Ambientes inteiros podem ser ignorados na configuração. A versão `0.9.0.pre.2` introduziu regras locais limitadas, preservadas na API estável:
191
166
 
192
167
  ```ruby
193
168
  Chronos.ignore_if do |notice|
@@ -195,17 +170,14 @@ Chronos.ignore_if do |notice|
195
170
  end
196
171
  ```
197
172
 
198
- Rules receive an immutable normalized notice, run before serialization/queueing, and must return exactly `true` to discard. The default limit is 20 and the hard configurable maximum is 100. A failing rule is contained. See [Bounded local ignore rules](docs/modules/ignore-rules.md).
173
+ A regra recebe um notice normalizado e imutável, e somente `true` descarta. Falhas do callback são contidas. Veja [Ignore rules](docs/modules/ignore-rules.md).
199
174
 
200
- ## Performance monitoring
175
+ ## Monitoramento de performance
201
176
 
202
- Version 0.7 aggregates request, query, and job observations into bounded `metric_batch` events. Groups include count, error count/rate, total/min/max/average duration, fixed histogram buckets, status counts, and component breakdown. Percentiles are calculated in the SaaS without retaining every local duration.
203
-
204
- SQL comments and literal values are removed before a bounded normalized query and SHA-256 fingerprint are produced. Binds are never read. Slow, repeated, possible N+1, long-transaction, connection-error, and deadlock signals are heuristic and require server-side confirmation. Group count, active trace count, fingerprints per trace, histogram buckets, and batch size all have fixed limits. See [Essential APM aggregation](docs/modules/apm-aggregation.md).
177
+ A Versão 0.7 introduziu agregação local de requests, queries e jobs em `metric_batch`; a Versão 0.8 adicionou HTTP externo. Grupos possuem contagem, erro, duração, histograma, status e breakdown limitados. Percentis são calculados no SaaS.
205
178
 
206
179
  ```ruby
207
180
  Chronos.configure do |config|
208
- # required connection settings omitted
209
181
  config.apm_enabled = true
210
182
  config.apm_max_groups = 200
211
183
  config.apm_flush_count = 100
@@ -216,42 +188,22 @@ Chronos.configure do |config|
216
188
  end
217
189
  ```
218
190
 
219
- ## Sidekiq and Active Job
220
-
221
- Version `0.6.0.pre.1` adds optional Sidekiq 4/5 middleware:
222
-
223
- ```ruby
224
- gem "sidekiq", "~> 5.0"
225
- gem "chronos-ruby", "0.9.0.pre.4", :require => "chronos/sidekiq"
226
- ```
227
-
228
- The client middleware propagates only trace/request identifiers in a versioned Sidekiq-envelope field and never changes worker arguments. The server records class, queue, JID, retry count, duration, calculable queue latency, bounded arguments/tags, status, and error class. Values pass through the shared sanitizer before delivery. Failed jobs are notified once and the original exception is re-raised. See [Sidekiq 4/5 legacy integration](docs/modules/sidekiq-legacy.md).
191
+ SQL bruto e binds não são lidos. Sinais de query lenta, repetição, possível N+1, transação longa, conexão e deadlock são heurísticos. Veja [APM](docs/modules/apm-aggregation.md), [Requests](docs/modules/request-monitoring.md) e [SQL](docs/modules/sql-monitoring.md).
229
192
 
230
- When Active Job is available, the Rails integration propagates only bounded trace/request identifiers in a namespaced serialized field without changing job arguments. It records adapter, job/provider IDs, class, queue, attempts, duration, status, and error class, and captures a supplied failure once. See [Active Job legacy integration](docs/modules/active-job.md).
193
+ ## Sidekiq e Active Job
231
194
 
232
- ## External HTTP, cache, and dependencies
233
-
234
- Version 0.8 instruments only explicitly selected `Net::HTTP` connection objects, avoiding a global monkey patch:
195
+ A versão `0.6.0.pre.1` introduziu middleware Sidekiq 4/5; a API estável mantém o require explícito:
235
196
 
236
197
  ```ruby
237
- Chronos.configure do |config|
238
- # required connection settings omitted
239
- config.external_http_enabled = true
240
- config.external_http_trace_headers = true
241
- end
242
-
243
- http = Net::HTTP.new("payments.example.com", 443)
244
- http.use_ssl = true
245
- Chronos.instrument_net_http(http)
198
+ gem "sidekiq", "~> 5.0"
199
+ gem "chronos-ruby", "~> 1.0.0", :require => "chronos/sidekiq"
246
200
  ```
247
201
 
248
- The wrapper records only sanitized host, method, status, duration, timeout, connection-error flag, and error class. It propagates `X-Chronos-Trace-ID` and `X-Chronos-Request-ID` when available and never reads URL path/query, Authorization, request body, response body, or error message.
249
-
250
- Rails cache telemetry omits raw keys by default. Set `cache_key_mode = :sha256` to emit a project-scoped hash; `:none` is the default. Dependency reporting is enabled by default, reads at most 100 already loaded gem specs, and emits one independent `dependencies` event per agent. Set `dependency_reporting = false` to disable it. See [External HTTP](docs/modules/external-http.md), [Cache observability](docs/modules/cache-observability.md), and [Dependency inventory](docs/modules/dependencies.md).
202
+ O envelope de contexto não altera argumentos públicos e contém somente IDs limitados de trace/request. 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).
251
203
 
252
204
  ## Deploy tracking
253
205
 
254
- Version 0.9 sends deployment metadata synchronously and adds a bounded correlation block to every event:
206
+ A Versão 0.9 introduziu deploy síncrono e correlação fixa em todos os eventos:
255
207
 
256
208
  ```ruby
257
209
  Chronos.notify_deploy(
@@ -263,55 +215,35 @@ Chronos.notify_deploy(
263
215
  )
264
216
  ```
265
217
 
266
- Configure `app_version`, `revision`, `deploy_id`, `environment`, `service_name`, `region`, and `instance_id` in each newly deployed process so subsequent telemetry carries the same release identity. The gem never scans environment variables or Git automatically.
218
+ Configure release/revision/deploy na inicialização de cada novo processo. A gem não Git ou variáveis automaticamente. Capistrano é opcional; Kamal e GitHub Actions usam exemplos em `examples/deploy/`. Veja [Deploys](docs/modules/deploys.md).
267
219
 
268
- Optional Capistrano support loads through `chronos/capistrano`. Manual, Kamal-command, and GitHub Actions examples share the explicit deploy command under `examples/deploy/`. See [Deploy tracking and release correlation](docs/modules/deploy-tracking.md).
220
+ ## Fila assíncrona
269
221
 
270
- ## Asynchronous queue
271
-
272
- The queue has a fixed capacity and drops the newest event when full. Worker threads are created lazily after the first accepted event. The default capacity is 100 events with one worker.
222
+ A fila tem capacidade fixa, descarta o evento mais novo quando cheia e cria workers somente após a primeira captura aceita.
273
223
 
274
224
  ```mermaid
275
225
  flowchart LR
276
- E[Exception] --> N[Notice builder]
277
- N --> P[Privacy sanitizer]
278
- P --> S[Safe bounded serializer]
279
- S --> D[Delivery pipeline]
280
- D --> Q[Bounded queue]
281
- Q --> W[Fixed worker pool]
282
- W --> R[Retry and circuit breaker]
283
- R --> H[Net::HTTP transport]
284
- R --> B[Bounded memory backlog]
226
+ E[Exceção ou telemetria] --> N[Normalização]
227
+ N --> P[Sanitização]
228
+ P --> S[Serialização limitada]
229
+ S --> D[Pipeline de entrega]
230
+ D --> Q[Fila limitada]
231
+ Q --> W[Workers fixos]
232
+ W --> H[Net::HTTP]
233
+ W --> B[Backlog em memória]
285
234
  ```
286
235
 
287
- Use `Chronos.flush(timeout)` to wait for accepted events and `Chronos.close(timeout)` during shutdown. Workers are recreated after a process fork.
288
-
289
- ## Retry and backlog
290
-
291
- The resilience layer introduced in version 0.3 retries network errors, HTTP `408`, `429`, and `5xx` responses with exponential backoff, bounded jitter, and a finite attempt count. Other `4xx` responses are permanent and are not retried. A circuit breaker pauses requests after repeated failures, preventing retry storms.
292
-
293
- After retries are exhausted, the already sanitized `SerializedEvent` may enter a fixed-capacity memory backlog. The backlog drops new items when full, is lost when the process exits, and never writes to disk. A later successful half-open probe drains backlog items as new events arrive.
294
-
295
- The SaaS may return a JSON policy in the bounded `X-Chronos-Remote-Configuration` response header. Only sampling rate, enabled event types, a lower payload limit, exact ignored fingerprints, send interval, and kill switch are accepted. Remote values cannot change the host, project credentials, TLS, local maximums, code, or regular expressions. See [Retry and backlog](docs/modules/retry-backlog.md) and [Remote configuration](docs/modules/remote-configuration.md).
236
+ Use `Chronos.flush(timeout)` antes de encerrar e `Chronos.close(timeout)` no shutdown. Workers são recriados após fork. Veja [Fila assíncrona](docs/modules/async-queue.md).
296
237
 
297
- ## How it works internally
238
+ ## Retry e backlog
298
239
 
299
- The code follows hexagonal boundaries:
240
+ Retry cobre erros de rede, HTTP `408`, `429` e `5xx`, com backoff exponencial, jitter e tentativas limitadas. Outros `4xx` são permanentes. Circuit breaker reduz tempestades de retry.
300
241
 
301
- - `Chronos::Core` contains immutable notices, sanitization, and safe normalization;
302
- - `Chronos::Application` coordinates capture;
303
- - `Chronos::Application::DeliveryPipeline` owns bounded retry and remote policy;
304
- - `Chronos::Ports` defines delivery behavior;
305
- - `Chronos::Adapters` implements Net::HTTP delivery and thread-local context;
306
- - `Chronos::Integrations::Rack` implements optional automatic Rack capture;
307
- - `Chronos::Rails` implements the optional Railtie, installer, generator, and public-notification adapters;
308
- - `Chronos::Internal` owns bounded queueing, workers, and defensive logging.
242
+ O backlog guarda somente eventos já sanitizados/serializados, possui capacidade fixa, vive em memória e é perdido no encerramento. Configuração remota aceita apenas sampling, tipos habilitados, limite menor de payload, fingerprints exatas, intervalo e kill switch; nunca altera host, credenciais, TLS ou executa código. Veja [Retry e backlog](docs/modules/retry-backlog.md), [Sampling](docs/modules/sampling.md) e [Configuração remota](docs/modules/remote-configuration.md).
309
243
 
310
- The core has no dependency on Rails, Rack, Sidekiq, or ActiveSupport. See [Architecture](docs/architecture.md).
244
+ ## Configuração por ambiente
311
245
 
312
- ## Environment-specific configuration
313
-
314
- Configuration values are explicit; the gem never scans the process environment. Read only the variables your application chooses:
246
+ A gem não varre o ambiente. Leia somente variáveis escolhidas pela aplicação:
315
247
 
316
248
  ```ruby
317
249
  Chronos.configure do |config|
@@ -322,102 +254,69 @@ Chronos.configure do |config|
322
254
  config.enabled = ENV["CHRONOS_ENABLED"] != "false"
323
255
  config.queue_size = 100
324
256
  config.workers = 1
325
- config.timeout = 5.0
326
- config.open_timeout = 2.0
327
257
  config.max_retries = 3
328
- config.retry_base_interval = 0.5
329
- config.retry_max_interval = 30.0
330
- config.retry_jitter = 0.25
331
258
  config.backlog_size = 100
332
- config.circuit_failure_threshold = 5
333
- config.circuit_reset_timeout = 30.0
334
259
  config.remote_configuration = true
335
- config.context_store = :thread_local
336
- config.breadcrumb_capacity = 20
337
- config.breadcrumb_max_bytes = 2048
338
260
  config.apm_enabled = true
339
- config.apm_max_groups = 200
340
- config.apm_flush_count = 100
341
261
  config.external_http_enabled = false
342
262
  config.cache_key_mode = :none
343
263
  config.dependency_reporting = true
344
264
  config.app_version = ENV["APP_VERSION"]
345
265
  config.revision = ENV["GIT_SHA"]
346
266
  config.deploy_id = ENV["DEPLOY_ID"]
347
- config.region = ENV["REGION"]
348
- config.instance_id = ENV["INSTANCE_ID"]
349
267
  end
350
268
  ```
351
269
 
352
- All options are documented in [Configuration](docs/configuration.md).
270
+ Todas as opções, defaults e limites estão em [Configuração](docs/configuration.md).
353
271
 
354
272
  ## Troubleshooting
355
273
 
356
- Configuration errors are raised during `Chronos.configure`. Capture and delivery errors are contained and optionally reported to the configured logger. Verify credentials, HTTPS certificates, timeouts, and `Chronos.flush` results. See [Troubleshooting](docs/troubleshooting.md).
274
+ Erros de configuração são levantados durante `Chronos.configure`; falhas de captura/entrega são contidas e podem ir ao logger seguro. Confirme TLS, credenciais, timeouts e retorno de `flush`. Consulte [Troubleshooting](docs/troubleshooting.md).
357
275
 
358
276
  ## Benchmark
359
277
 
360
- Run the version 0.9 benchmarks with:
278
+ O gate estável executa comparação Rack repetível e carga contra endpoint fake:
361
279
 
362
280
  ```bash
363
- bundle _1.17.3_ exec ruby benchmarks/capture_exception.rb
364
- bundle _1.17.3_ exec ruby benchmarks/serialization.rb
365
- bundle _1.17.3_ exec ruby benchmarks/filtering.rb
366
- bundle _1.17.3_ exec ruby benchmarks/queue.rb
367
- bundle _1.17.3_ exec ruby benchmarks/retry_backlog.rb
368
- bundle _1.17.3_ exec ruby benchmarks/request_overhead.rb
369
- bundle _1.17.3_ exec ruby benchmarks/rails_notifications.rb
370
- bundle _1.17.3_ exec ruby benchmarks/sidekiq_middleware.rb
371
- bundle _1.17.3_ exec ruby benchmarks/apm_aggregation.rb
372
- bundle _1.17.3_ exec ruby benchmarks/external_http.rb
373
- bundle _1.17.3_ exec ruby benchmarks/correlation.rb
281
+ ITERATIONS=50000 WARMUP=5000 SAMPLES=7 bundle _1.17.3_ exec ruby benchmarks/comparative.rb
282
+ ITERATIONS=500 bundle _1.17.3_ exec ruby benchmarks/fake_endpoint_load.rb
374
283
  ```
375
284
 
376
- Results depend on runtime, hardware, and payload. No performance comparison is claimed until repeatable measurements are published.
285
+ Resultados dependem de runtime e hardware. Não há alegação genérica de superioridade; registre CPU, SO, Ruby, commit, warmup, amostras, mediana e dispersão. Outros benchmarks ficam em `benchmarks/` e estão descritos em [Performance](docs/performance.md).
377
286
 
378
- ## Migration from Airbrake
287
+ ## Migração do Airbrake
379
288
 
380
- An Airbrake migration guide will be added before the legacy 1.0 release. Version 0.9 does not claim API compatibility or automatic replacement.
289
+ Migre por etapas e mantenha os dois agentes juntos somente durante a validação, evitando duplicidade prolongada. Callbacks e notices não são API-compatíveis e devem ser traduzidos/testados explicitamente. Consulte o [guia de migração do Airbrake](docs/migration-from-airbrake.md).
381
290
 
382
- ## Local development
291
+ ## Desenvolvimento local
383
292
 
384
- Clone the repository, install Bundler 1.17.3, and run setup:
293
+ Instale Bundler 1.17.3 e as dependências:
385
294
 
386
295
  ```bash
387
296
  gem install bundler -v 1.17.3
388
297
  bin/setup
389
298
  ```
390
299
 
391
- Open an interactive console:
392
-
393
- ```bash
394
- bin/console
395
- ```
396
-
397
- Install the current source locally:
398
-
399
- ```bash
400
- bundle _1.17.3_ exec rake install
401
- ```
300
+ Use `bin/console` para inspeção e `bundle _1.17.3_ exec rake install` para instalar a fonte localmente. A arquitetura hexagonal está descrita em [Arquitetura](docs/architecture.md).
402
301
 
403
- ## Tests
302
+ ## Testes
404
303
 
405
- Run the complete suite on the current Ruby:
304
+ Execute suíte e lint no runtime atual:
406
305
 
407
306
  ```bash
408
307
  bundle _1.17.3_ exec rake
409
308
  ```
410
309
 
411
- The legacy CI matrix covers Ruby 2.2.10, 2.3.8, 2.4.10, 2.5.9, and 2.6.10. Network integration tests use a local fake HTTP server.
310
+ A matriz CI cobre Ruby 2.2.102.6.10, aplicações Rails 4.2/5.2 e Sidekiq 4/5. O workflow de release repete toda a matriz, documentação, benchmark comparativo e carga antes de publicar.
412
311
 
413
- ## Contributing
312
+ ## Contribuição
414
313
 
415
- Open an issue before introducing a new public API or dependency. Every public class requires YARD documentation, tests, module documentation, and compatibility evidence. See [CONTRIBUTING.md](CONTRIBUTING.md).
314
+ Abra uma issue antes de adicionar API pública ou dependência. Classes públicas precisam de YARD, testes, documentação de módulo e evidência de compatibilidade. Veja [CONTRIBUTING.md](CONTRIBUTING.md).
416
315
 
417
- ## Security
316
+ ## Segurança
418
317
 
419
- Never include credentials in event context or logs. Report vulnerabilities privately according to [SECURITY.md](SECURITY.md). Ruby 2.2 through 2.6 are end-of-life; Chronos provides technical compatibility, not runtime security maintenance.
318
+ Nunca inclua credenciais no contexto. Releases usam Trusted Publishing, checksum SHA-256 e SBOM; dependências passam por auditoria. Reporte vulnerabilidades pelo canal privado de [SECURITY.md](SECURITY.md).
420
319
 
421
- ## License
320
+ ## Licença
422
321
 
423
- Chronos Ruby is distributed under the terms of the MIT License. See [LICENSE.txt](LICENSE.txt).
322
+ Chronos Ruby é distribuída sob a licença MIT. Veja [LICENSE.txt](LICENSE.txt).
@@ -0,0 +1,25 @@
1
+ # ADR-007 — Feature detection nas integrações
2
+
3
+ ## Status
4
+
5
+ Aceito para 1.0.
6
+
7
+ ## Contexto
8
+
9
+ Rails 4.2/5.2, Active Job e Sidekiq 4/5 expõem conjuntos diferentes de constantes e hooks. Comparar apenas números de versão cria falsos positivos em instalações parciais.
10
+
11
+ ## Decisão
12
+
13
+ Integrações opcionais verificam a presença da biblioteca e das APIs públicas necessárias antes de instalar middleware, subscribers ou extensões. A instalação é idempotente e não exige Zeitwerk.
14
+
15
+ ## Alternativas
16
+
17
+ Branches por versão e uso de APIs privadas foram rejeitados por fragilidade e custo de manutenção.
18
+
19
+ ## Consequências positivas
20
+
21
+ O núcleo permanece carregável em Ruby puro e combinações validadas compartilham adapters menores.
22
+
23
+ ## Consequências negativas
24
+
25
+ Cada caminho detectado exige contrato e aplicação de exemplo; uma biblioteca que imite parcialmente a API pode precisar de tratamento dedicado.
@@ -0,0 +1,25 @@
1
+ # ADR-008 — Context store por runtime
2
+
3
+ ## Status
4
+
5
+ Aceito para 1.0 legado.
6
+
7
+ ## Contexto
8
+
9
+ Requests e jobs concorrentes não podem compartilhar usuário, parâmetros, breadcrumbs ou trace ID, mas Ruby 2.2 não oferece uma estratégia fiber-local moderna uniforme.
10
+
11
+ ## Decisão
12
+
13
+ Definir uma porta de context store e usar armazenamento thread-local na linha 0.x/1.0 legado. Todo escopo restaura o valor anterior e limpa em `ensure`; somente IDs permitidos atravessam processos.
14
+
15
+ ## Alternativas
16
+
17
+ Estado global foi rejeitado por vazamento entre execuções. Fiber local foi adiado para a linha moderna.
18
+
19
+ ## Consequências positivas
20
+
21
+ O isolamento é testável e o núcleo não depende da primitiva concreta.
22
+
23
+ ## Consequências negativas
24
+
25
+ Threads e fibers criadas pela aplicação exigem propagação explícita; adapters futuros precisam preservar a mesma porta.
@@ -0,0 +1,25 @@
1
+ # ADR-009 — Sampling limitado localmente
2
+
3
+ ## Status
4
+
5
+ Aceito para 1.0.
6
+
7
+ ## Contexto
8
+
9
+ O agente precisa controlar volume durante carga alta e aceitar redução remota sem permitir expansão inesperada da coleta.
10
+
11
+ ## Decisão
12
+
13
+ Usar `sampling_rate` local como teto. Configuração remota pode somente reduzir a taxa, desabilitar tipos ou ativar kill switch. As opções são allowlisted, limitadas e nunca incluem código/regex.
14
+
15
+ ## Alternativas
16
+
17
+ Sampling exclusivamente no servidor desperdiça transporte. Sampling remoto sem teto local foi rejeitado por privacidade e previsibilidade.
18
+
19
+ ## Consequências positivas
20
+
21
+ O operador conserva controle e a decisão ocorre antes de HTTP/retry.
22
+
23
+ ## Consequências negativas
24
+
25
+ Sampling uniforme pode perder eventos raros; análises devem considerar a taxa efetiva.
@@ -0,0 +1,25 @@
1
+ # ADR-010 — Interoperabilidade futura com OpenTelemetry
2
+
3
+ ## Status
4
+
5
+ Adiado; limite aceito para 1.0 legado.
6
+
7
+ ## Contexto
8
+
9
+ O Chronos precisa correlacionar trace/request sem duplicar SDKs ou impor dependências modernas a Ruby 2.2–2.6.
10
+
11
+ ## Decisão
12
+
13
+ Manter IDs de correlação e portas independentes do fornecedor na 1.0. Não depender de OpenTelemetry nem instalar instrumentação global na linha legado. Uma ponte opcional será projetada na linha transitional/modern e deverá traduzir somente campos permitidos.
14
+
15
+ ## Alternativas
16
+
17
+ Adicionar o SDK como dependência obrigatória foi rejeitado por incompatibilidade e overhead. Copiar spans completos foi rejeitado por cardinalidade e privacidade.
18
+
19
+ ## Consequências positivas
20
+
21
+ O protocolo v1 permanece estável e aplicações legadas não recebem novas dependências.
22
+
23
+ ## Consequências negativas
24
+
25
+ Não há propagação automática com ecossistemas OpenTelemetry na 1.0; integrações futuras exigirão contrato e matriz próprios.
@@ -1,9 +1,13 @@
1
1
  # ADR-018: Pre-1.0 hardening gates
2
2
 
3
+ ## Status
4
+
5
+ Concluído pela versão 1.0.0.
6
+
3
7
  ## Decision
4
8
 
5
- Keep the release at `0.9.0.pre.2` while any mandatory 1.0 evidence remains external or incomplete. Add bounded local ignore rules, Active Job envelope propagation, real Sidekiq compatibility jobs, repeatable comparative/load benchmarks, and explicit release/security policies.
9
+ Keep the release in prerelease while any mandatory 1.0 evidence remains external or incomplete. Promote only after bounded local ignore rules, Active Job envelope propagation, real Sidekiq compatibility jobs, repeatable comparative/load benchmarks, and explicit release/security policies are present and green.
6
10
 
7
11
  ## Consequences
8
12
 
9
- The stable API is not promised before the full legacy matrix passes. Active Job gains one namespaced serialized field without changing arguments. Application callbacks remain bounded in count but their execution cost belongs to the application. Package checksums are used until a trusted signing lifecycle is available.
13
+ The complete candidate matrix passed before the 1.0 promotion. Active Job has one namespaced serialized field without changing arguments. Application callbacks remain bounded in count but their execution cost belongs to the application. Trusted Publishing, package checksums and SBOMs are used until a trusted signing lifecycle is available.
@@ -1,36 +1,43 @@
1
1
  # Compatibility
2
2
 
3
- Chronos Ruby 0.x is the legacy line. Technical compatibility does not make an end-of-life Ruby or Rails release secure.
3
+ Chronos Ruby 1.0 is the stable legacy line. Technical compatibility does not make an end-of-life Ruby, Rails, Rack, or Sidekiq release secure.
4
4
 
5
- | Ruby | Rails integration | Status | Evidence |
6
- |---|---|---|---|
7
- | 2.2.10 | Rails 4.2 | Best effort | Core CI, Rails 4.2 example, dedicated smoke gate |
8
- | 2.3.8 | Rails 4.2 / 5.0 | Best effort | Core CI and feature-detection contract; dedicated app gate incomplete |
9
- | 2.4.10 | Rails 4.2 / 5.0 | Best effort | Core CI and feature-detection contract; dedicated app gate incomplete |
10
- | 2.5.9 | Rails 5.2 | Best effort | Core CI, Rails 5.2 example, dedicated smoke gate |
11
- | 2.6.10 | Rails 5.2 | Best effort | Core CI and feature-detection contract; dedicated app gate incomplete |
12
- | 2.7 and newer | None in 0.x | Unsupported | Belongs to transitional or modern lines |
13
-
14
- | Ruby | Sidekiq integration | Status | Evidence |
15
- |---|---|---|---|
16
- | 2.2.10 | Sidekiq 4.2.10 | Best effort | Unit/integration contracts and dedicated real-gem Docker job |
17
- | 2.5.9 | Sidekiq 5.2.10 | Best effort | Unit/integration contracts and dedicated real-gem Docker job |
5
+ ## Core and Rack
18
6
 
19
- Version 0.5 includes Rails 4.2 and 5.2 applications plus a dedicated matrix, but this document conservatively keeps the combinations at `Best effort` until all release-gate evidence, including fake-server payload validation, is green. Rails 5.0 uses the same feature-detected public APIs but does not yet have its own example application.
7
+ | Ruby | Status | Evidence |
8
+ |---|---|---|
9
+ | 2.2.10 | Supported | Full unit, integration, contract, Rack, concurrency, fork, transport, privacy, and lint gate |
10
+ | 2.3.8 | Supported | Same dedicated Docker gate |
11
+ | 2.4.10 | Supported | Same dedicated Docker gate |
12
+ | 2.5.9 | Supported | Same dedicated Docker gate |
13
+ | 2.6.10 | Supported | Same dedicated Docker gate |
14
+ | 2.7 and newer | Unsupported in 1.x legacy | Belongs to the transitional or modern lines |
20
15
 
21
- Version `0.9.0.pre.2` adds dedicated Sidekiq 4.2.10 and 5.2.10 real-gem jobs. Status remains `Best effort` until both external jobs pass on the release candidate.
16
+ ## Rails
22
17
 
23
- Active Job propagation uses the standard `serialize`, `deserialize`, and `perform_now` extension points with a namespaced bounded field. Rails 4.2/5.2 example jobs and unit contracts provide evidence; the complete external matrix must still pass before stable support is declared.
18
+ | Ruby | Rails | Status | Evidence |
19
+ |---|---|---|---|
20
+ | 2.2.10 | 4.2 | Supported | Real application boot, successful/error request, SQL, view, cache, Active Job, mailer, fake endpoint, flush, and shutdown |
21
+ | 2.3.8 | 4.2 | Supported | Same dedicated application gate |
22
+ | 2.5.9 | 5.2 | Supported | Same dedicated application gate |
23
+ | 2.6.10 | 5.2 | Supported | Same dedicated application gate |
24
+ | Other Ruby/Rails pairs | — | Unsupported | No complete release gate; feature detection alone is not a support claim |
24
25
 
25
- Version `0.7.0.pre.1` keeps the same Ruby/Rails matrix and implements APM aggregation without modern concurrency or SQL-parser dependencies. Its compatibility remains `Best effort` until request/SQL/job aggregate payloads pass the dedicated fake-server gates for every listed runtime.
26
+ ## Sidekiq
27
+
28
+ | Ruby | Sidekiq | Status | Evidence |
29
+ |---|---|---|---|
30
+ | 2.2.10 | 4.2.10 | Supported | Real-gem client/server middleware smoke with context, success/failure, and deduplication |
31
+ | 2.5.9 | 5.2.10 | Supported | Same dedicated application gate |
32
+ | Other Ruby/Sidekiq pairs | — | Unsupported | No complete release gate |
26
33
 
27
- Version `0.8.0.pre.1` uses per-object `Module#prepend`, legacy `Net::HTTP`, standard-library SHA-256, and loaded-spec feature detection. It adds no runtime dependency and keeps the same matrix. Outbound HTTP, cache, and dependency gates must pass every listed runtime before support is promoted.
34
+ Active Job uses the public `serialize`, `deserialize`, and `perform_now` extension points with a bounded namespaced field. Support follows the validated Rails pairs above. Adapters that bypass these hooks require their own evidence.
28
35
 
29
- Version `0.9.0.pre.1` adds only standard-library URI/SecureRandom processing, bounded hashes, and the existing synchronous delivery path. Capistrano is optional and feature-detected; Kamal and GitHub Actions integrations are commands/examples. The Ruby/Rails matrix remains unchanged and `Best effort` until deploy/correlation payload gates pass every listed runtime.
36
+ The release workflow repeats every supported pair before publishing. The green candidate evidence that permitted the 1.0 promotion is recorded in [Version 1.0 readiness](release-1.0-readiness.md).
30
37
 
31
38
  Status meanings:
32
39
 
33
- - Supported: the complete required compatibility gate passes.
34
- - Best effort: intended to work, but the complete gate has not passed yet.
40
+ - Supported: every mandatory compatibility gate for the exact pair passes.
41
+ - Best effort: intended to work but missing a complete gate; no 1.0 pair is advertised this way.
35
42
  - Deprecated: still tested while removal is planned.
36
- - Unsupported: outside this release line.
43
+ - Unsupported: outside the tested 1.0 contract.
@@ -4,4 +4,4 @@ After `1.0.0`, a public API scheduled for removal remains available for at least
4
4
 
5
5
  Warnings are emitted at most once per process through the configured safe logger and must not include application payloads. Security fixes, behavior that can expose secrets, and upstream runtime incompatibilities may require faster action; the security advisory and changelog must explain the exception. Ruby/Rails support changes are recorded in `docs/compatibility.md` before removal.
6
6
 
7
- Prereleases may revise APIs without the full stable window, but every incompatible revision must remain explicit. Version `0.9.0.pre.2` introduces no removal.
7
+ Prereleases may revise APIs without the full stable window, but every incompatible revision must remain explicit. Version `1.0.0` starts the stable deprecation window and introduces no removal.
@@ -1,6 +1,6 @@
1
1
  # Migration from Airbrake
2
2
 
3
- Version `0.9.0.pre.2` provides a staged migration path. Run both agents only long enough to compare delivery, then remove Airbrake to avoid duplicate reports and overhead.
3
+ Version `1.0.0` provides a staged migration path. Run both agents only long enough to compare delivery, then remove Airbrake to avoid duplicate reports and overhead.
4
4
 
5
5
  | Airbrake concept | Chronos equivalent |
6
6
  |---|---|
@@ -0,0 +1,23 @@
1
+ # Breadcrumbs
2
+
3
+ ## Problema e limite
4
+
5
+ Breadcrumbs preservam uma trilha curta do fluxo que antecedeu uma falha. Não são logs, tracing completo ou armazenamento de payloads brutos.
6
+
7
+ ## Fluxo e classes
8
+
9
+ `Chronos.add_breadcrumb` normaliza a categoria e os metadados em `Chronos::Core::Breadcrumb`. `BreadcrumbBuffer` mantém um anel de capacidade fixa no context store. O `NoticeBuilder` copia a fotografia atual; sanitizer e serializer aplicam novamente limites antes da entrega.
10
+
11
+ ## Extensão, riscos e exemplo
12
+
13
+ Integrações podem registrar apenas categorias conhecidas e metadados de baixa cardinalidade. Mensagens e metadados continuam sendo dados da aplicação e podem conter informação pessoal se o chamador ignorar minimização.
14
+
15
+ ```ruby
16
+ Chronos.add_breadcrumb(
17
+ :category => "custom",
18
+ :message => "invoice queued",
19
+ :metadata => {"provider" => "example"}
20
+ )
21
+ ```
22
+
23
+ Os limites e a herança por captura são testados em `spec/unit/core/breadcrumb_spec.rb`, `spec/unit/agent_spec.rb` e nos specs de Rack.
@@ -0,0 +1,21 @@
1
+ # Contexto de execução
2
+
3
+ ## Problema e limite
4
+
5
+ O contexto relaciona uma exceção ou métrica ao request/job atual sem criar dependência do núcleo com Rack, Rails ou Sidekiq. Ele guarda somente valores delimitados e não é um repositório de estado da aplicação.
6
+
7
+ ## Fluxo e classes
8
+
9
+ `Chronos::Ports::ContextStore` define `get`, `set`, `clear` e `with_context`. Na linha legado, `Chronos::Adapters::ThreadLocalContextStore` isola o valor por thread. A fachada combina o contexto explícito com o escopo atual; o serializer sanitiza e limita tudo antes da fila. Rack limpa o escopo em `ensure`, enquanto Sidekiq e Active Job propagam apenas `trace_id` e `request_id`.
10
+
11
+ ## Extensão, riscos e exemplo
12
+
13
+ Um adaptador alternativo pode ser configurado quando implementar a porta completa. Ele precisa restaurar escopos aninhados e garantir limpeza após exceções. Thread local não acompanha automaticamente fibers ou threads criadas pela aplicação; nesses casos, propague somente os identificadores permitidos.
14
+
15
+ ```ruby
16
+ Chronos.with_context("trace_id" => "trace-42", "request_id" => "request-7") do
17
+ Chronos.notify(RuntimeError.new("failure"))
18
+ end
19
+ ```
20
+
21
+ Os contratos estão em `spec/unit/ports/context_store_spec.rb`, `spec/unit/adapters/thread_local_context_store_spec.rb` e `spec/integration/rack_middleware_concurrency_spec.rb`.
@@ -0,0 +1,23 @@
1
+ # Deploys
2
+
3
+ ## Problema e limite
4
+
5
+ Deploys criam o marco temporal usado para comparar erros e desempenho antes/depois de uma release. A gem informa o evento; reconciliação e análise pertencem ao SaaS.
6
+
7
+ ## Fluxo e classes
8
+
9
+ `Chronos.notify_deploy` passa atributos explícitos a `Core::DeployNormalizer`, sanitiza o evento e usa entrega síncrona com idempotência. `CorrelationContext` copia release, revision, deploy ID, ambiente, serviço, região e instância para todos os envelopes. Uma entrega bem-sucedida libera um novo snapshot de dependências.
10
+
11
+ ## Extensão, riscos e exemplo
12
+
13
+ Capistrano possui hook opcional; Kamal e GitHub Actions usam comandos documentados. A gem não lê Git nem variáveis automaticamente. O retorno `false` deve ser tratado conforme a política de deploy da aplicação.
14
+
15
+ ```ruby
16
+ Chronos.notify_deploy(
17
+ :environment => "production",
18
+ :revision => ENV["GIT_SHA"],
19
+ :version => ENV["APP_VERSION"]
20
+ )
21
+ ```
22
+
23
+ Veja `spec/unit/core/deploy_normalizer_spec.rb`, `spec/unit/integrations/capistrano_spec.rb` e `spec/integration/deploy_delivery_spec.rb`.
@@ -0,0 +1,22 @@
1
+ # Monitoramento de jobs
2
+
3
+ ## Problema e limite
4
+
5
+ Jobs precisam manter correlação entre enqueue e execução e registrar duração/falha sem abrir threads ou conexões por job. A versão 1.0 cobre Sidekiq 4/5 e Active Job disponível em Rails 4.2/5.2; Resque e Delayed Job permanecem fora do escopo estável.
6
+
7
+ ## Fluxo e classes
8
+
9
+ O middleware Sidekiq injeta um envelope Chronos separado dos argumentos públicos. O servidor restaura contexto, mede fila/execução e deduplica exceções aninhadas. A integração Active Job usa os hooks públicos de serialização e `perform_now`. As observações seguem para `ApmAggregator` e as exceções para o notice pipeline.
10
+
11
+ ## Extensão, riscos e exemplo
12
+
13
+ Adapters que substituem hooks públicos exigem testes próprios. Argumentos Sidekiq são limitados e sanitizados, mas a aplicação deve evitar segredos e dados pessoais desnecessários.
14
+
15
+ ```ruby
16
+ require "chronos/sidekiq"
17
+ Sidekiq.configure_server do |config|
18
+ config.server_middleware { |chain| chain.add Chronos::Integrations::Sidekiq::ServerMiddleware }
19
+ end
20
+ ```
21
+
22
+ Veja `spec/unit/integrations/sidekiq_spec.rb`, `spec/unit/integrations/active_job_spec.rb` e `spec/integration/sidekiq_delivery_spec.rb`.
@@ -0,0 +1,20 @@
1
+ # Monitoramento de requests
2
+
3
+ ## Problema e limite
4
+
5
+ Requests Rack/Rails alimentam métricas de duração, status e breakdown com dimensões limitadas. O módulo não lê bodies, cookies, autorização ou query string bruta.
6
+
7
+ ## Fluxo e classes
8
+
9
+ O middleware Rack cria contexto isolado e mede o request. Subscribers Rails enriquecem controller/action e evitam duplicação. `CaptureTelemetry` envia a observação a `ApmAggregator`; por padrão ela integra um `metric_batch`, e com APM desativado vira evento individual sanitizado.
10
+
11
+ ## Extensão, riscos e exemplo
12
+
13
+ Rotas devem ser normalizadas para evitar cardinalidade por ID. Aplicações Rack podem fornecer um normalizador por meio dos campos já aceitos, sem incluir parâmetros sensíveis.
14
+
15
+ ```ruby
16
+ use Chronos::Integrations::Rack::Middleware,
17
+ :include_user_agent => false
18
+ ```
19
+
20
+ Veja `spec/integration/rack_middleware_spec.rb`, `spec/integration/rack_middleware_concurrency_spec.rb` e `spec/integration/apm_aggregation_delivery_spec.rb`.
@@ -0,0 +1,22 @@
1
+ # Informações de runtime
2
+
3
+ ## Problema e limite
4
+
5
+ O agente identifica o runtime necessário para diagnóstico e inventário sem varrer o ambiente, o sistema de arquivos ou conexões da aplicação. A versão 1.0 não implementa profiling nem coleta contínua de CPU/RSS.
6
+
7
+ ## Fluxo e classes
8
+
9
+ `Chronos::Core::RuntimeInfo` produz engine, versão, plataforma, PID, thread opaca e hostname permitido. `DependencyReporter` adiciona versões já carregadas de Ruby, Rails, servidor, adaptador de banco e Sidekiq em um evento separado e limitado, no máximo uma vez por agente e após deploy bem-sucedido.
10
+
11
+ ## Extensão, riscos e exemplo
12
+
13
+ Aplicações podem configurar versão, release, região e instância explicitamente. Hostname, IDs de processo e inventário podem ser dados pessoais ou revelar topologia; desative `dependency_reporting` quando a finalidade não justificar a coleta.
14
+
15
+ ```ruby
16
+ Chronos.configure do |config|
17
+ config.dependency_reporting = false
18
+ config.app_version = "2026.07.29"
19
+ end
20
+ ```
21
+
22
+ Veja `spec/unit/core/runtime_info_spec.rb`, `spec/unit/application/dependency_reporter_spec.rb` e `spec/integration/dependency_delivery_spec.rb`.
@@ -0,0 +1,22 @@
1
+ # Sampling
2
+
3
+ ## Problema e limite
4
+
5
+ Sampling reduz volume de eventos sem permitir que o servidor amplie a coleta decidida localmente. Ele não substitui quotas no receptor e não deve ser usado para esconder falhas do agente.
6
+
7
+ ## Fluxo e classes
8
+
9
+ `Chronos::Configuration` valida `sampling_rate` entre `0.0` e `1.0`. `Chronos::Application::RemoteConfiguration` calcula o limite efetivo, que nunca excede o valor local, e `DeliveryPipeline` decide antes do transporte. Deploys e verificações explícitas usam seus próprios caminhos síncronos e não são descartados pelo sampling comum.
10
+
11
+ ## Extensão, riscos e exemplo
12
+
13
+ O gerador aleatório pode ser injetado nos objetos internos para testes determinísticos; a API pública expõe somente a taxa. Taxas baixas podem ocultar eventos raros e não garantem amostragem estatística estratificada.
14
+
15
+ ```ruby
16
+ Chronos.configure do |config|
17
+ config.sampling_rate = 0.25
18
+ config.remote_configuration = true
19
+ end
20
+ ```
21
+
22
+ O comportamento é coberto por `spec/unit/application/remote_configuration_spec.rb`, `spec/unit/application/delivery_pipeline_spec.rb` e `spec/integration/deploy_delivery_spec.rb`.
@@ -4,7 +4,7 @@ Version `0.6.0.pre.1` starts the legacy jobs line with optional Sidekiq 4 and 5
4
4
 
5
5
  ```ruby
6
6
  gem "sidekiq", "~> 5.0"
7
- gem "chronos-ruby", "0.9.0.pre.4", :require => "chronos/sidekiq"
7
+ gem "chronos-ruby", "~> 1.0.0", :require => "chronos/sidekiq"
8
8
  ```
9
9
 
10
10
  `chronos/sidekiq` installs middleware through the public `configure_client` and `configure_server` APIs. It does nothing when Sidekiq is unavailable, and the core gem never requires Sidekiq. Installation adds no Chronos thread or Redis/database connection per job; delivery continues through the agent's existing fixed worker pool.
@@ -0,0 +1,22 @@
1
+ # Monitoramento SQL
2
+
3
+ ## Problema e limite
4
+
5
+ O monitoramento SQL mede operação, tabela e duração sem transmitir SQL bruto ou binds. Sinais locais de lentidão, repetição, possível N+1, transação longa, conexão e deadlock são diagnósticos heurísticos.
6
+
7
+ ## Fluxo e classes
8
+
9
+ `Rails::NotificationsSubscriber` extrai somente campos permitidos. `Core::SqlNormalizer` remove comentários e literais, limita identificadores e calcula fingerprint SHA-256. `ApmAggregator` mantém grupos e fingerprints por trace com capacidades fixas, então drena lotes pelo pipeline comum.
10
+
11
+ ## Extensão, riscos e exemplo
12
+
13
+ Thresholds podem ser configurados, mas dimensões de alta cardinalidade não devem ser adicionadas. Nomes de schema, tabela e coluna ainda podem revelar domínio e precisam de avaliação LGPD.
14
+
15
+ ```ruby
16
+ Chronos.configure do |config|
17
+ config.apm_slow_query_threshold_ms = 500.0
18
+ config.apm_n_plus_one_threshold = 5
19
+ end
20
+ ```
21
+
22
+ Veja `spec/unit/core/sql_normalizer_spec.rb`, `spec/unit/application/apm_aggregator_spec.rb` e `spec/integration/rails_telemetry_delivery_spec.rb`.
data/docs/performance.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Performance
2
2
 
3
- Performance is a functional requirement, but version 0.9 makes no unverified speed claim.
3
+ Performance is a functional requirement, but version 1.0 makes no unverified speed claim.
4
4
 
5
5
  Current controls:
6
6
 
@@ -29,7 +29,7 @@ Current controls:
29
29
 
30
30
  Run the scripts under `benchmarks/` and record Ruby version, operating system, CPU, warmup, iteration count, median, and dispersion before publishing results. `benchmarks/filtering.rb` measures privacy filtering, `benchmarks/retry_backlog.rb` measures fixed-memory outage behavior, `benchmarks/request_overhead.rb` compares Rack-protocol calls, and `benchmarks/rails_notifications.rb` isolates subscriber normalization overhead.
31
31
 
32
- ## Version 0.9.0.pre.4 release gates
32
+ ## Version 1.0.0 release gates
33
33
 
34
34
  `benchmarks/comparative.rb` compares the same successful Rack fixture without and with Chronos instrumentation. It performs configurable warmup, at least three samples, and reports median plus median absolute deviation. `benchmarks/fake_endpoint_load.rb` sends asynchronous exception events to a local TCP endpoint, verifies the v1 schema marker, ensures the secret key is absent from every payload, and fails on loss, rejection, invalid payload, or timeout.
35
35
 
@@ -40,6 +40,17 @@ ITERATIONS=500 bundle exec ruby benchmarks/fake_endpoint_load.rb
40
40
 
41
41
  Results are environment-specific evidence, not a general speed claim. Record CPU, OS, Ruby, gem commit, and environment variables with any published result. Airbrake comparison remains optional and must use a legally compatible, equivalent sanitized payload on the same supported runtime.
42
42
 
43
+ ### Stable candidate measurement
44
+
45
+ The 1.0 candidate was measured on 2026-07-29 on an Apple Silicon arm64 host running macOS 26.6, with Ruby 2.2.10 executing as x86_64. The working tree was based on commit `ce7c67852dd39406f514499b0347a67c5b09bb8c` plus the 1.0 release changes. This is release-gate evidence for this environment, not a universal performance claim.
46
+
47
+ | Gate | Configuration | Result |
48
+ |---|---|---|
49
+ | Rack comparison | 1,000 warmup calls, 10,000 calls/sample, 5 samples | direct median 0.016036 s (MAD 0.000187); Chronos median 0.482321 s (MAD 0.016988); median incremental work 46.628 µs/request |
50
+ | Fake endpoint load | 500 asynchronous exceptions, 2 workers, queue 500 | 500/500 accepted and received, zero invalid/secret-bearing payloads, 1.444941 s, 346.03 events/s |
51
+
52
+ The release workflow repeats both gates on the tag. It does not enforce a cross-hardware timing threshold; correctness, bounded delivery, complete receipt, privacy and repeatability are hard failures, while timing regressions are reviewed with the recorded environment.
53
+
43
54
  ## Version 0.5 Rails subscriber benchmark
44
55
 
45
56
  Run:
data/docs/protocol-v1.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Protocol v1 stability
2
2
 
3
- The schemas under `contracts/` are the source of truth for protocol v1. Version `0.9.0.pre.4` keeps `schema_version: "1.0"` and treats every required field, enum value, privacy exclusion, and maximum as a compatibility contract.
3
+ The schemas under `contracts/` are the source of truth for protocol v1. Version `1.0.0` freezes `schema_version: "1.0"` and treats every required field, enum value, privacy exclusion, and maximum as a compatibility contract.
4
4
 
5
5
  Compatible changes may add optional bounded fields or new event types accepted by the server. Removing or renaming a field, changing its type/meaning, weakening a bound, or making an optional field required needs a new protocol major schema. Authentication remains outside the JSON payload. Contract tests and `script/verify_docs` must pass before a release.
6
6
 
@@ -1,18 +1,20 @@
1
- # Version 1.0 readiness
1
+ # Version 1.0 release evidence
2
2
 
3
- Version `0.9.0.pre.4` is a hardening release, not the stable release. The local suite, lint, documentation verifier, build, load test, and comparative benchmark are required evidence. The release can advance to `1.0.0` only after the GitHub Actions matrix is green for every declared legacy Ruby/framework/job combination.
3
+ Version `1.0.0` is the first stable legacy release. Promotion was based on the complete candidate commit `ce7c67852dd39406f514499b0347a67c5b09bb8c`; future tags must pass the same gates again inside the release workflow before publishing.
4
4
 
5
- | Gate | State in pre.4 |
6
- |---|---|
7
- | Ruby pure, Rack, Rails 4.2/5.2 | Implemented; external legacy matrix must pass |
8
- | Sidekiq 4/5 real gems | Dedicated Docker matrix added; must pass |
9
- | Active Job metadata/error/context | Implemented and contract-tested |
10
- | filters, bounded ignore rules, context, breadcrumbs | Implemented and documented |
11
- | request/SQL/job APM, deploy, retry/backlog, remote configuration | Implemented and contract-tested |
12
- | payload fixture privacy | Contract-tested |
13
- | public API/options/protocol review | Documented; final review required |
14
- | Airbrake migration, SemVer, deprecation, security review | Added in pre.2 |
15
- | fake endpoint load and repeatable comparison | Executable gates added |
16
- | package signing | Not currently feasible; protected secret plus checksum is the interim control |
5
+ | Gate | Evidence for the candidate | Enforcement for the tag |
6
+ |---|---|---|
7
+ | Ruby 2.2.10–2.6.10 | [Legacy CI: success](https://github.com/antoniojefferson/chronos-ruby/actions/runs/29891291304) | `legacy-core` matrix |
8
+ | Rails 4.2/5.2 applications | [Legacy Rails CI: success](https://github.com/antoniojefferson/chronos-ruby/actions/runs/29891291287) | `legacy-rails` matrix |
9
+ | Sidekiq 4/5 real gems | [Legacy Sidekiq CI: success](https://github.com/antoniojefferson/chronos-ruby/actions/runs/29891291327) | `legacy-sidekiq` matrix |
10
+ | Documentation and package | [Repository checks: success](https://github.com/antoniojefferson/chronos-ruby/actions/runs/29891291350) | `release-readiness` plus publish build |
11
+ | Dependency audit | [Security: success](https://github.com/antoniojefferson/chronos-ruby/actions/runs/30251211355) | scheduled and pull-request security workflow |
12
+ | Unit/integration/contracts/lint | 179 examples, 0 failures; 197 files, 0 offenses on Ruby 2.2.10 | every core matrix job |
13
+ | Payload privacy | Contract tests reject secrets in payload and retry backlog | every core matrix job and fake-endpoint load gate |
14
+ | API/options/protocol | Public facade, configuration table, v1 schemas, SemVer and deprecation policy reviewed | documentation verifier and contract suite |
15
+ | Airbrake migration | Staged migration and rollback guide | documentation verifier |
16
+ | Load and repeatable comparison | Local bounded fake endpoint plus median/MAD Rack comparison | `release-readiness` job |
17
+ | Security/release artifacts | Security review, Trusted Publishing, SHA-256 and SPDX SBOM | publish job after all dependencies pass |
18
+ | Package signing | Not currently feasible without a trusted key lifecycle | documented residual control: OIDC publishing, checksum and SBOM |
17
19
 
18
- Do not change compatibility status from `Best effort` or create a `v1.0.0` tag until all external jobs and the dependency audit pass without skips.
20
+ `publish` depends on all four release jobs. A failed or skipped supported runtime/framework/job pair, documentation check, comparison, or load test prevents RubyGems publication.
@@ -1,6 +1,6 @@
1
- # Security review for 0.9.0.pre.4
1
+ # Security review for 1.0.0
2
2
 
3
- Review date: 2026-07-22. Scope: capture, serialization, transport, integration verification, remote configuration, framework/job integrations, release workflow, examples, and fixtures.
3
+ Review date: 2026-07-29. Scope: capture, serialization, transport, integration verification, remote configuration, framework/job integrations, stable release workflow, examples, and fixtures.
4
4
 
5
5
  Verified by contracts and implementation review:
6
6
 
@@ -14,4 +14,4 @@ Verified by contracts and implementation review:
14
14
  - fixture privacy is enforced by contract tests and dependency advisories are checked by the security workflow.
15
15
  - integration verification accepts only a strict correlated response and never exposes raw receiver bodies, credentials, stack traces, paths, SQL, or internal architecture.
16
16
 
17
- Residual risks: supported Ruby/Rails versions are end-of-life; in-memory backlog is lost at exit; application filters/ignore rules execute application code; project identifiers and documented job IDs may be personal data in some deployments; package signing is not enabled because no trusted certificate/key lifecycle exists. Release artifacts should use protected environments and published SHA-256 checksums until signing can be operated safely.
17
+ Residual risks: supported Ruby/Rails versions are end-of-life; in-memory backlog is lost at exit; application filters/ignore rules execute application code; project identifiers and documented job IDs may be personal data in some deployments; package signing is not enabled because no trusted certificate/key lifecycle exists. Stable artifacts use a protected environment, Trusted Publishing, SHA-256 checksums and SPDX SBOMs until signing can be operated safely.
@@ -1,4 +1,4 @@
1
1
  module Chronos
2
2
  # Current version of the legacy Chronos Ruby agent.
3
- VERSION = "0.9.0.pre.4".freeze
3
+ VERSION = "1.0.0".freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chronos-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0.pre.4
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antonio Jefferson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-22 00:00:00.000000000 Z
11
+ date: 2026-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -113,6 +113,10 @@ files:
113
113
  - docs/adr/ADR-004-bounded-queue.md
114
114
  - docs/adr/ADR-005-sanitize-before-backlog.md
115
115
  - docs/adr/ADR-006-versioned-event-contract.md
116
+ - docs/adr/ADR-007-feature-detection.md
117
+ - docs/adr/ADR-008-context-store.md
118
+ - docs/adr/ADR-009-sampling.md
119
+ - docs/adr/ADR-010-opentelemetry-interoperability.md
116
120
  - docs/adr/ADR-011-bounded-resilience-and-remote-control.md
117
121
  - docs/adr/ADR-012-rack-context-isolation.md
118
122
  - docs/adr/ADR-013-legacy-rails-notifications.md
@@ -131,21 +135,29 @@ files:
131
135
  - docs/modules/active-job.md
132
136
  - docs/modules/apm-aggregation.md
133
137
  - docs/modules/async-queue.md
138
+ - docs/modules/breadcrumbs.md
134
139
  - docs/modules/cache-observability.md
135
140
  - docs/modules/configuration.md
141
+ - docs/modules/context.md
136
142
  - docs/modules/dependencies.md
137
143
  - docs/modules/deploy-tracking.md
144
+ - docs/modules/deploys.md
138
145
  - docs/modules/external-http.md
139
146
  - docs/modules/ignore-rules.md
140
147
  - docs/modules/integration-verification.md
148
+ - docs/modules/job-monitoring.md
141
149
  - docs/modules/notice-pipeline.md
142
150
  - docs/modules/rack-context.md
143
151
  - docs/modules/rails-legacy.md
144
152
  - docs/modules/remote-configuration.md
153
+ - docs/modules/request-monitoring.md
145
154
  - docs/modules/retry-backlog.md
155
+ - docs/modules/runtime-metrics.md
156
+ - docs/modules/sampling.md
146
157
  - docs/modules/sanitization.md
147
158
  - docs/modules/serialization.md
148
159
  - docs/modules/sidekiq-legacy.md
160
+ - docs/modules/sql-monitoring.md
149
161
  - docs/modules/telemetry-events.md
150
162
  - docs/modules/transport.md
151
163
  - docs/performance.md
@@ -247,9 +259,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
247
259
  version: '2.7'
248
260
  required_rubygems_version: !ruby/object:Gem::Requirement
249
261
  requirements:
250
- - - ">"
262
+ - - ">="
251
263
  - !ruby/object:Gem::Version
252
- version: 1.3.1
264
+ version: '0'
253
265
  requirements: []
254
266
  rubygems_version: 3.4.22
255
267
  signing_key: