chronos-ruby 1.1.1 → 1.1.3

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: f2ff96797e03af3f2ec69047e39bd05cce161f74704264851903d72508120399
4
- data.tar.gz: 7b809747cbdfcee40abc07989945c76b25576176f20b8792ac6840f6b9624e36
3
+ metadata.gz: 348e3ca2ba28d8d97f80281bf0ffb545b013dfac248d7f14527f5d955513d7a2
4
+ data.tar.gz: 44e7047ef9d47aac49f5a22e416447aa82efd3944a93eabd61eb36fa74d3fb2b
5
5
  SHA512:
6
- metadata.gz: 15bbdc2faf14f1e2684a9c3f27ee5fec193c34cd3342d9910e3a617ba9ea113e3e221904fb0d736c842465f4bbbe59d1d293b32cce2f820f954156fc36ae41d4
7
- data.tar.gz: c47fbd431496ab36cbc3d7c0b1cc5a0360ba6433cfc1aef1efce12b14a793f7ea7cda443da2e27edcde88604de3c203aa911ce5846e9acf2361bf35bc4fe25b9
6
+ metadata.gz: 2b4b15808ff7363b470d0c4348fc0a338f4c2ea3eb4112db5b5d6e9c1437315ea57f7ac70f84e7618ea2f120e9210425c31041b328cdc9940c2ebc8593f4a2f3
7
+ data.tar.gz: 92a4bdf9041d68747c5c139061f9000f9526ac26ba9b1b913d73fb1413dd4492764bbb700067e7ffdec7610ebf4e16d671b49792c05e2e694664ca97b72b6e99
data/CHANGELOG.md CHANGED
@@ -4,6 +4,33 @@ All notable changes are documented here. The project follows Semantic Versioning
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.1.3] - 2026-08-13
8
+
9
+ ### Changed
10
+
11
+ - expanded the gem summary and description to clarify its exception, metrics, and telemetry monitoring purpose;
12
+ - highlighted https://chronosmonitor.com.br as the official Chronos Monitor platform for receiving and visualizing observability data;
13
+ - synchronized stable legacy release references and installation examples with version `1.1.3`.
14
+
15
+ ## [1.1.2] - 2026-08-13
16
+
17
+ ### Changed
18
+
19
+ - the generated Rails initializer now exposes only common application-facing options with safe environment overrides;
20
+ - the official Chronos endpoint remains an internal default and is no longer assigned in generated initializers;
21
+ - Rails derives the service name from the application namespace when `CHRONOS_SERVICE_NAME` is absent;
22
+ - Rails applications automatically install the optional Sidekiq 4/5 client and server middleware when Sidekiq is available.
23
+
24
+ ### Fixed
25
+
26
+ - configuration snapshots no longer freeze the Rails-owned logger, preventing later logger extensions from raising `FrozenError`;
27
+ - logger lookup and optional Sidekiq installation failures are contained so they cannot abort Rails boot.
28
+
29
+ ### Security
30
+
31
+ - `CHRONOS_SSL_VERIFY` remains enabled by default and unknown Boolean values retain the secure default;
32
+ - generated Boolean overrides accept only explicit `1/0`, `true/false`, `yes/no`, and `on/off` forms.
33
+
7
34
  ## [1.1.1] - 2026-08-11
8
35
 
9
36
  ### Changed
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Chronos Ruby
2
2
 
3
- Chronos Ruby 1.1.1 é 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.
3
+ Chronos Ruby 1.1.3 é 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
5
  ## O que a gem coleta
6
6
 
@@ -24,7 +24,7 @@ A gem não varre variáveis de ambiente, sistema de arquivos ou lockfiles e não
24
24
 
25
25
  ## Versões Ruby e Rails suportadas
26
26
 
27
- A versão 1.1.1 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. Ruby 2.7/Rails 6 não é declarado nesta release porque ainda não possui aplicação e matriz completas.
27
+ A versão 1.1.3 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. Ruby 2.7/Rails 6 não é declarado nesta release porque ainda não possui aplicação e matriz completas.
28
28
 
29
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
 
@@ -33,7 +33,7 @@ Rubies e frameworks antigos estão fora do suporte de segurança de seus mantene
33
33
  Obrigatório: adicione a versão estável ao `Gemfile`.
34
34
 
35
35
  ```ruby
36
- gem "chronos-ruby", "~> 1.1.1"
36
+ gem "chronos-ruby", "~> 1.1.3"
37
37
  ```
38
38
 
39
39
  Em runtimes antigos, use Bundler compatível:
@@ -46,7 +46,7 @@ bundle _1.17.3_ install
46
46
  Sem Bundler:
47
47
 
48
48
  ```bash
49
- gem install chronos-ruby -v 1.1.1
49
+ gem install chronos-ruby -v 1.1.3
50
50
  ```
51
51
 
52
52
  ## Instalação em Rails
@@ -54,7 +54,7 @@ gem install chronos-ruby -v 1.1.1
54
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", "~> 1.1.1", :require => "chronos/rails"
57
+ gem "chronos-ruby", "~> 1.1.3", :require => "chronos/rails"
58
58
  ```
59
59
 
60
60
  Gere o initializer:
@@ -76,7 +76,6 @@ require "chronos"
76
76
  Chronos.configure do |config|
77
77
  config.project_id = ENV["CHRONOS_PROJECT_ID"]
78
78
  config.project_key = ENV["CHRONOS_PROJECT_KEY"]
79
- config.host = "https://chronosmonitor.com.br"
80
79
  config.environment = ENV["APP_ENV"] || "production"
81
80
  config.service_name = "billing"
82
81
  config.app_version = ENV["APP_VERSION"]
@@ -205,13 +204,15 @@ Por padrão, SQL bruto e binds não são lidos pelo pipeline de análise. A insp
205
204
 
206
205
  ## Sidekiq e Active Job
207
206
 
208
- A versão `0.6.0.pre.1` introduziu middleware Sidekiq 4/5; a API estável mantém o require explícito:
207
+ A versão `0.6.0.pre.1` introduziu middleware Sidekiq 4/5. Em Rails, a versão 1.1.3 detecta Sidekiq e instala automaticamente os middlewares de cliente e servidor:
209
208
 
210
209
  ```ruby
211
210
  gem "sidekiq", "~> 5.0"
212
- gem "chronos-ruby", "~> 1.1.1", :require => "chronos/sidekiq"
211
+ gem "chronos-ruby", "~> 1.1.3", :require => "chronos/rails"
213
212
  ```
214
213
 
214
+ Aplicações Ruby sem Rails continuam usando `require "chronos/sidekiq"` explicitamente.
215
+
215
216
  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).
216
217
 
217
218
  ## Deploy tracking
@@ -262,7 +263,6 @@ A gem não varre o ambiente. Leia somente variáveis escolhidas pela aplicação
262
263
  Chronos.configure do |config|
263
264
  config.project_id = ENV["CHRONOS_PROJECT_ID"]
264
265
  config.project_key = ENV["CHRONOS_PROJECT_KEY"]
265
- config.host = ENV["CHRONOS_HOST"]
266
266
  config.environment = ENV["APP_ENV"] || "production"
267
267
  config.enabled = ENV["CHRONOS_ENABLED"] != "false"
268
268
  config.queue_size = 100
@@ -33,7 +33,7 @@ Chronos Ruby 1.1 is the current stable legacy line. Technical compatibility does
33
33
 
34
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.
35
35
 
36
- The release workflow repeats every supported pair before publishing. Historical 1.0 evidence remains in [Version 1.0 readiness](release-1.0-readiness.md); the 1.1 candidate is recorded in [Version 1.1 readiness](release-1.1-readiness.md).
36
+ The release workflow repeats every supported pair before publishing. Version 1.1.3 evidence is recorded in [Version 1.1.3 readiness](release-1.1.3-readiness.md); historical evidence remains in [Version 1.1.2 readiness](release-1.1.2-readiness.md), [Version 1.0 readiness](release-1.0-readiness.md), and [Version 1.1 readiness](release-1.1-readiness.md).
37
37
 
38
38
  Status meanings:
39
39
 
@@ -16,7 +16,7 @@ Run:
16
16
  rails generate chronos:install
17
17
  ```
18
18
 
19
- The generator creates `config/initializers/chronos.rb`. The template reads only explicitly named `CHRONOS_*` variables, uses `Rails.env`, adopts `Rails.logger` when available, and disables automatic integration in test and console by default. It invokes the idempotent installer as a fallback for applications that disabled Bundler auto-require, so the Railtie and initializer paths cannot create duplicate hooks. It never scans all environment variables or modifies routes and application classes.
19
+ The generator creates `config/initializers/chronos.rb`. The concise template reads only explicitly named `CHRONOS_*` variables, uses documented safe defaults, derives the service name from the Rails application namespace, adopts `Rails.logger` without freezing it, and disables automatic integration in test and console by default. It invokes the idempotent installer as a fallback for applications that disabled Bundler auto-require, so the Railtie and initializer paths cannot create duplicate hooks. When Sidekiq is available, the installer also activates its existing optional client and server middleware. It never scans all environment variables or modifies routes and application classes.
20
20
 
21
21
  ## Captured integrations
22
22
 
@@ -57,4 +57,4 @@ The repository contains independent applications under `examples/rails-4.2` and
57
57
 
58
58
  ## Limits
59
59
 
60
- Version 0.7 aggregates controller, SQL, and job timings into bounded APM batches. SQL literals and binds remain excluded while a bounded normalized query and fingerprint are produced. Sidekiq support remains a separate optional integration. Version `0.9.0.pre.2` provides bounded Active Job trace/request propagation through a namespaced serialized field; adapters that replace the standard Active Job serialization/execution hooks require separate compatibility evidence.
60
+ Version 0.7 aggregates controller, SQL, and job timings into bounded APM batches. SQL literals and binds remain excluded while a bounded normalized query and fingerprint are produced. Sidekiq remains an optional dependency but is installed automatically when present in Rails. Version `0.9.0.pre.2` provides bounded Active Job trace/request propagation through a namespaced serialized field; adapters that replace the standard Active Job serialization/execution hooks require separate compatibility evidence.
@@ -1,13 +1,13 @@
1
1
  # Sidekiq 4/5 legacy integration
2
2
 
3
- Version `0.6.0.pre.1` starts the legacy jobs line with optional Sidekiq 4 and 5 client and server middleware. Load it after declaring Sidekiq:
3
+ Version `0.6.0.pre.1` starts the legacy jobs line with optional Sidekiq 4 and 5 client and server middleware. Version `1.1.3` installs it automatically when Sidekiq is available in a Rails application:
4
4
 
5
5
  ```ruby
6
6
  gem "sidekiq", "~> 5.0"
7
- gem "chronos-ruby", "~> 1.1.0", :require => "chronos/sidekiq"
7
+ gem "chronos-ruby", "~> 1.1.3", :require => "chronos/rails"
8
8
  ```
9
9
 
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.
10
+ Plain Ruby applications continue to use `require "chronos/sidekiq"` explicitly. Both entry points install middleware through the public `configure_client` and `configure_server` APIs. They do nothing when Sidekiq is unavailable, and the framework-independent core never requires Sidekiq. Installation adds no Chronos thread or Redis/database connection per job; delivery continues through the agent's existing fixed worker pool.
11
11
 
12
12
  The client middleware adds a top-level `chronos` metadata object to the Sidekiq envelope. It never changes the public `args` array. Only `trace_id` and `request_id` propagate, with schema version and enqueue time. The server scopes that context for the worker, measures duration and calculable queue latency, and emits one `job` event.
13
13
 
@@ -0,0 +1,21 @@
1
+ # Version 1.1.2 release evidence
2
+
3
+ Version `1.1.2` is a backward-compatible maintenance release of the stable legacy line. It simplifies the generated Rails initializer, keeps the official host internal, derives a default Rails service name, preserves application ownership of the logger, and automatically installs the existing optional Sidekiq 4/5 middleware in Rails applications.
4
+
5
+ The release preserves Ruby 2.2.10–2.6.10, Rails 4.2/5.2, Sidekiq 4.2.10/5.2.10, and protocol `schema_version: "1.0"`. It introduces no mandatory framework dependency and no transitional 1.2-only API.
6
+
7
+ ## Required gates
8
+
9
+ - complete unit, integration, contract, privacy, concurrency, transport, and lint suite on Ruby 2.2.10–2.6.10;
10
+ - real Rails 4.2 applications on Ruby 2.2.10/2.3.8 and Rails 5.2 applications on Ruby 2.5.9/2.6.10;
11
+ - real Sidekiq 4.2.10 and 5.2.10 client/server middleware smoke tests;
12
+ - generated initializer boot, service-name fallback, logger mutability, optional Sidekiq installation, and idempotency tests;
13
+ - documentation verification, repeatable benchmarks, and the bounded fake-endpoint privacy/load gate;
14
+ - gem build, package inspection, SHA-256 checksum, SPDX SBOM, and RubyGems Trusted Publishing.
15
+
16
+ The release tag must be exactly `v1.1.2` and match `Chronos::VERSION`. Do not publish manually. After the reviewed commit and all gates are green:
17
+
18
+ ```bash
19
+ git tag v1.1.2
20
+ git push origin v1.1.2
21
+ ```
@@ -0,0 +1,22 @@
1
+ # Version 1.1.3 release evidence
2
+
3
+ Version `1.1.3` is a backward-compatible documentation and package-metadata maintenance release of the stable legacy line. It clarifies that the gem captures exceptions, metrics, and telemetry from Ruby and Rails applications and identifies https://chronosmonitor.com.br as the official Chronos Monitor platform for receiving and visualizing those observability signals.
4
+
5
+ The release preserves Ruby 2.2.10–2.6.10, Rails 4.2/5.2, Sidekiq 4.2.10/5.2.10, and protocol `schema_version: "1.0"`. It changes no runtime behavior, public API, collected field, framework dependency, or compatibility claim.
6
+
7
+ ## Required gates
8
+
9
+ - complete unit, integration, contract, privacy, concurrency, transport, and lint suite on Ruby 2.2.10–2.6.10;
10
+ - real Rails 4.2 applications on Ruby 2.2.10/2.3.8 and Rails 5.2 applications on Ruby 2.5.9/2.6.10;
11
+ - real Sidekiq 4.2.10 and 5.2.10 client/server middleware smoke tests;
12
+ - documentation and pull request description verification;
13
+ - dependency audit with the CI-pinned tooling;
14
+ - repeatable query-analysis and Rack benchmarks plus the bounded fake-endpoint privacy/load gate;
15
+ - gem build, package inspection, SHA-256 checksum, SPDX SBOM, and RubyGems Trusted Publishing.
16
+
17
+ The release tag must be exactly `v1.1.3` and match `Chronos::VERSION`. Do not publish manually. After the reviewed commit and all gates are green:
18
+
19
+ ```bash
20
+ git tag v1.1.3
21
+ git push origin v1.1.3
22
+ ```
@@ -56,7 +56,7 @@ Require `chronos/capistrano` after the Capistrano/Rake task DSL is loaded. The i
56
56
 
57
57
  ## Sidekiq telemetry is missing
58
58
 
59
- Require `chronos/sidekiq` after Sidekiq is available and configure Chronos before jobs run. The entry point uses Sidekiq's public client/server middleware configuration and remains optional. Requiring only `chronos` or `chronos/rails` does not load Sidekiq. A job already enqueued before client middleware installation may lack propagated trace context, but server timing and failure capture can still run.
59
+ In Rails, require `chronos/rails` and configure Chronos before jobs run; version 1.1.3 detects Sidekiq and installs its public client/server middleware automatically. In plain Ruby, require `chronos/sidekiq` explicitly after Sidekiq is available. Sidekiq remains optional in both cases. A job already enqueued before client middleware installation may lack propagated trace context, but server timing and failure capture can still run.
60
60
 
61
61
  ## A failed Sidekiq job appears twice
62
62
 
@@ -3,7 +3,7 @@ module Chronos
3
3
  #
4
4
  # @responsibility Expose validated settings without mutable containers.
5
5
  # @motivation Keep capture behavior stable while multiple threads run.
6
- # @limits It cannot be edited after creation.
6
+ # @limits Snapshot values cannot be edited; the host application's logger remains externally owned.
7
7
  # @collaborators Configuration and runtime services.
8
8
  # @thread_safety Safe to share between threads after construction.
9
9
  # @compatibility Ruby 2.2.10 through Ruby 2.6.
@@ -17,7 +17,7 @@ module Chronos
17
17
  def initialize(values)
18
18
  Configuration::ATTRIBUTES.each do |attribute|
19
19
  value = values[attribute]
20
- deep_freeze(value)
20
+ deep_freeze(value) unless attribute == :logger
21
21
  instance_variable_set("@#{attribute}", value)
22
22
  end
23
23
  freeze
@@ -34,6 +34,7 @@ module Chronos
34
34
 
35
35
  install_middleware(application, options)
36
36
  install_active_job
37
+ install_sidekiq
37
38
  @subscriber.install
38
39
  self.class.applications[application.object_id] = true
39
40
  end
@@ -65,6 +66,24 @@ module Chronos
65
66
  Chronos::Integrations::ActiveJob.install(::ActiveJob::Base, @notifier)
66
67
  end
67
68
 
69
+ def install_sidekiq
70
+ library = sidekiq_library
71
+ return false unless library
72
+
73
+ Chronos::Integrations::Sidekiq.install(library, @notifier)
74
+ rescue StandardError
75
+ false
76
+ end
77
+
78
+ def sidekiq_library
79
+ return ::Sidekiq if defined?(::Sidekiq)
80
+
81
+ require "sidekiq"
82
+ ::Sidekiq if defined?(::Sidekiq)
83
+ rescue LoadError
84
+ nil
85
+ end
86
+
68
87
  def environment
69
88
  defined?(::Rails) && ::Rails.respond_to?(:env) ? ::Rails.env.to_s : nil
70
89
  end
data/lib/chronos/rails.rb CHANGED
@@ -2,6 +2,7 @@ require "chronos"
2
2
  require "chronos/rails/active_record_query_inspector"
3
3
  require "chronos/rails/notifications_subscriber"
4
4
  require "chronos/integrations/active_job"
5
+ require "chronos/integrations/sidekiq"
5
6
  require "chronos/rails/installer"
6
7
 
7
8
  require "chronos/rails/railtie" if defined?(::Rails::Railtie)
@@ -14,5 +15,16 @@ module Chronos
14
15
  # @limits Version 0.5 targets public APIs present in Rails 4.2 and 5.2.
15
16
  # @thread_safety Installation and subscriptions are protected against duplication.
16
17
  # @compatibility Rails 4.2 through Rails 5.2 with their supported legacy Rubies.
17
- module Rails; end
18
+ module Rails
19
+ class << self
20
+ # Returns the namespace that owns the Rails application class.
21
+ def application_name(application = ::Rails.application)
22
+ class_name = application.class.name.to_s
23
+ name = class_name.sub(/::Application\z/, "")
24
+ name.empty? || name == class_name ? nil : name
25
+ rescue StandardError
26
+ nil
27
+ end
28
+ end
29
+ end
18
30
  end
@@ -1,4 +1,4 @@
1
1
  module Chronos
2
2
  # Current version of the legacy Chronos Ruby agent.
3
- VERSION = "1.1.1".freeze
3
+ VERSION = "1.1.3".freeze
4
4
  end
@@ -1,165 +1,61 @@
1
1
  require "chronos/rails"
2
2
 
3
- # This initializer lists every public Chronos option so the application's
4
- # monitoring behavior is explicit and can be reviewed in one place.
3
+ # Common Chronos settings. Every environment variable is optional unless your
4
+ # Chronos project requires it; omitted values fall back to safe SDK defaults.
5
+ env_boolean = lambda do |name, default|
6
+ normalized = ENV[name].to_s.downcase
7
+ next true if %w(1 true yes on).include?(normalized)
8
+ next false if %w(0 false no off).include?(normalized)
9
+
10
+ default
11
+ end
12
+
5
13
  Chronos.configure do |config|
6
- # Identifies the project that will receive monitoring events.
14
+ # Identification and authentication
7
15
  config.project_id = ENV["CHRONOS_PROJECT_ID"]
8
- # Authenticates event delivery. Keep this value in a secret manager.
9
16
  config.project_key = ENV["CHRONOS_PROJECT_KEY"]
10
- # Defines the Chronos Monitor endpoint used to deliver events.
11
- config.host = "https://chronosmonitor.com.br"
12
- # Labels events with the current Rails environment.
13
- config.environment = Rails.env.to_s
14
- # Identifies the deployed application version.
17
+ config.environment = ENV.fetch("CHRONOS_ENVIRONMENT", Rails.env.to_s)
18
+ config.service_name = ENV["CHRONOS_SERVICE_NAME"] || Chronos::Rails.application_name
15
19
  config.app_version = ENV["CHRONOS_APP_VERSION"]
16
- # Distinguishes this application from other monitored services.
17
- config.service_name = ENV["CHRONOS_SERVICE_NAME"]
18
- # Records the source revision, such as a Git commit SHA.
19
20
  config.revision = ENV["CHRONOS_REVISION"]
20
- # Associates events with a specific deployment.
21
- config.deploy_id = ENV["CHRONOS_DEPLOY_ID"]
22
- # Identifies the infrastructure region running the application.
23
- config.region = ENV["CHRONOS_REGION"]
24
- # Identifies the process, container, or host producing an event.
25
- config.instance_id = ENV["CHRONOS_INSTANCE_ID"]
26
- # Removes the application root from reported file paths.
27
- config.root_directory = Rails.root.to_s
28
- # Sends internal Chronos diagnostics through the Rails logger.
29
- config.logger = Rails.logger if Rails.respond_to?(:logger)
30
-
31
- # Limits how long an established request waits for the server.
32
- config.timeout = 5
33
- # Limits how long Chronos waits while opening a connection.
34
- config.open_timeout = 2
35
- # Sets the maximum number of events in the in-memory queue.
36
- config.queue_size = 100
37
- # Sets the number of background delivery workers.
38
- config.workers = 1
39
- # Enables or disables all event collection and delivery.
40
- config.enabled = true
41
- # Controls whether captured exceptions are sent to Chronos.
42
- config.error_notifications = true
43
- # Prevents delivery from the listed application environments.
44
- config.ignored_environments = []
45
- # Routes outbound requests through a proxy URL when required.
46
- config.proxy = nil
47
- # Verifies the TLS certificate presented by the endpoint.
48
- config.ssl_verify = true
49
- # Identifies this SDK in outbound HTTP requests.
50
- config.user_agent = "chronos-ruby/#{Chronos::VERSION}"
51
- # Rejects serialized events larger than this number of bytes.
52
- config.max_payload_size = 1_048_576
53
- # Compresses request payloads with gzip when enabled.
54
- config.gzip = false
55
-
56
- # Removes values whose keys commonly contain private data.
57
- config.blocklist_keys = Chronos::Configuration::DEFAULT_BLOCKLIST_KEYS.dup
58
- # Keeps only the listed keys when this list is not empty.
59
- config.allowlist_keys = []
60
- # Applies custom callables that transform or discard events.
61
- config.filters = []
62
- # Replaces values for these keys with stable hashes.
63
- config.hash_keys = []
64
- # Removes the final segment of captured IP addresses.
65
- config.anonymize_ip = true
66
- # Discards events matching any configured ignore rule.
67
- config.ignore_rules = []
68
- # Limits the ignore rules evaluated for each event.
69
- config.max_ignore_rules = 20
70
21
 
71
- # Sets the number of retries after a recoverable failure.
72
- config.max_retries = 3
73
- # Sets the initial exponential-backoff delay in seconds.
74
- config.retry_base_interval = 0.5
75
- # Caps the retry delay in seconds.
76
- config.retry_max_interval = 30
77
- # Randomizes retry delays to prevent synchronized traffic.
78
- config.retry_jitter = 0.25
79
- # Keeps this many failed events for later delivery attempts.
80
- config.backlog_size = 100
81
- # Opens the circuit breaker after consecutive failures.
82
- config.circuit_failure_threshold = 5
83
- # Waits this many seconds before testing an open circuit.
84
- config.circuit_reset_timeout = 30
85
- # Allows bounded runtime configuration from the server.
86
- config.remote_configuration = true
87
- # Limits an accepted remote configuration response in bytes.
88
- config.remote_config_max_bytes = 4_096
89
- # Captures this fraction of eligible events, from 0.0 to 1.0.
90
- config.sampling_rate = 1.0
91
- # Restricts remote collection to these event categories.
92
- config.enabled_event_types = %w(
93
- exception request query job cache external_http dependencies deploy metric_batch
94
- )
95
- # Caps the server-requested delivery interval in seconds.
96
- config.max_remote_send_interval = 60
97
-
98
- # Stores request and trace context independently in each thread.
99
- config.context_store = :thread_local
100
- # Keeps this many recent breadcrumbs per execution context.
101
- config.breadcrumb_capacity = 20
102
- # Limits each serialized breadcrumb in bytes.
103
- config.breadcrumb_max_bytes = 2_048
104
-
105
- # Installs Rails request, job, cache, SQL, and error integrations.
106
- config.rails_enabled = true
107
- # Captures events from Rails console sessions when enabled.
108
- config.rails_capture_in_console = false
109
- # Captures events from the Rails test environment when enabled.
110
- config.rails_capture_in_test = false
111
- # Includes the request User-Agent in metadata when enabled.
112
- config.rails_capture_user_agent = false
113
-
114
- # Enables transaction, span, query, and performance aggregation.
115
- config.apm_enabled = true
116
- # Limits the metric groups retained between flushes.
117
- config.apm_max_groups = 200
118
- # Flushes APM aggregates after this many observations.
119
- config.apm_flush_count = 100
120
- # Sends at most this many APM items in one request.
121
- config.apm_batch_size = 50
122
- # Limits SQL queries recorded for one request or transaction.
123
- config.apm_max_queries_per_request = 100
124
- # Marks queries slower than this duration in milliseconds.
125
- config.apm_slow_query_threshold_ms = 500
126
- # Marks transactions longer than this duration in milliseconds.
127
- config.apm_long_transaction_threshold_ms = 1_000
128
- # Reports repeated equivalent queries after this count.
129
- config.apm_n_plus_one_threshold = 5
130
- # Defines duration buckets in milliseconds for APM histograms.
131
- config.apm_histogram_buckets = [5, 10, 25, 50, 100, 250, 500, 1_000, 2_500, 5_000]
132
- # Retains active trace state for this many seconds.
133
- config.apm_trace_ttl_seconds = 60
134
- # Normalizes SQL and records bounded analysis metadata.
135
- config.apm_query_analysis_enabled = true
136
- # Limits analyzed queries retained per transaction.
137
- config.apm_query_analysis_max_queries = 100
138
- # Enables database-specific inspection for slow queries.
139
- config.apm_query_inspection_enabled = false
140
- # Collects database query statistics when supported.
141
- config.apm_query_statistics_enabled = false
142
- # Collects query execution plans when supported.
143
- config.apm_query_plan_enabled = false
144
- # Inspects only queries at least this slow in milliseconds.
145
- config.apm_query_inspection_min_duration_ms = 500
146
- # Limits inspected queries retained per transaction.
147
- config.apm_query_inspection_max_queries = 20
148
- # Tracks database transaction lifecycles and durations.
149
- config.apm_transaction_tracking_enabled = true
150
- # Limits database connections tracked for transaction state.
151
- config.apm_transaction_max_connections = 100
152
-
153
- # Instruments supported outbound HTTP clients when enabled.
154
- config.external_http_enabled = false
155
- # Propagates Chronos trace headers on outbound requests.
156
- config.external_http_trace_headers = true
157
- # Controls cache key reporting; :none collects no key material.
158
- config.cache_key_mode = :none
159
- # Reports a bounded inventory of application dependencies.
160
- config.dependency_reporting = true
161
- # Limits dependencies included in an inventory event.
162
- config.dependency_max_items = 100
22
+ # General behavior and transport
23
+ config.enabled = env_boolean.call("CHRONOS_ENABLED", true)
24
+ config.error_notifications = env_boolean.call("CHRONOS_ERROR_NOTIFICATIONS", true)
25
+ config.ssl_verify = env_boolean.call("CHRONOS_SSL_VERIFY", true)
26
+ config.timeout = ENV.fetch("CHRONOS_TIMEOUT", "5").to_f
27
+ config.open_timeout = ENV.fetch("CHRONOS_OPEN_TIMEOUT", "2").to_f
28
+ config.queue_size = ENV.fetch("CHRONOS_QUEUE_SIZE", "100").to_i
29
+ config.workers = ENV.fetch("CHRONOS_WORKERS", "1").to_i
30
+ config.sampling_rate = ENV.fetch("CHRONOS_SAMPLING_RATE", "1.0").to_f
31
+ config.ignored_environments = ENV.fetch("CHRONOS_IGNORED_ENVIRONMENTS", "")
32
+ .split(",").map(&:strip).reject(&:empty?)
33
+
34
+ # Rails integration and privacy
35
+ config.root_directory = Rails.root.to_s
36
+ config.rails_enabled = env_boolean.call("CHRONOS_RAILS_ENABLED", true)
37
+ config.rails_capture_in_console = env_boolean.call("CHRONOS_RAILS_CAPTURE_IN_CONSOLE", false)
38
+ config.rails_capture_in_test = env_boolean.call("CHRONOS_RAILS_CAPTURE_IN_TEST", false)
39
+ config.anonymize_ip = env_boolean.call("CHRONOS_ANONYMIZE_IP", true)
40
+
41
+ # Application performance monitoring
42
+ config.apm_enabled = env_boolean.call("CHRONOS_APM_ENABLED", true)
43
+ config.apm_slow_query_threshold_ms = ENV.fetch(
44
+ "CHRONOS_APM_SLOW_QUERY_THRESHOLD_MS", "500"
45
+ ).to_f
46
+ config.apm_long_transaction_threshold_ms = ENV.fetch(
47
+ "CHRONOS_APM_LONG_TRANSACTION_THRESHOLD_MS", "1000"
48
+ ).to_f
49
+ config.apm_n_plus_one_threshold = ENV.fetch("CHRONOS_APM_N_PLUS_ONE_THRESHOLD", "5").to_i
50
+ config.external_http_enabled = env_boolean.call("CHRONOS_EXTERNAL_HTTP_ENABLED", false)
51
+
52
+ # Chronos keeps the shared Rails logger mutable and contains logger failures.
53
+ begin
54
+ config.logger = Rails.logger if Rails.respond_to?(:logger)
55
+ rescue StandardError
56
+ # Chronos safely continues without an application logger.
57
+ nil
58
+ end
163
59
  end
164
60
 
165
61
  # Installation is idempotent, regardless of when the Railtie was evaluated.
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: 1.1.1
4
+ version: 1.1.3
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-08-11 00:00:00.000000000 Z
11
+ date: 2026-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,8 +86,11 @@ dependencies:
86
86
  - - '='
87
87
  - !ruby/object:Gem::Version
88
88
  version: 1.19.2
89
- description: Base do cliente Chronos para excecoes, telemetria e observabilidade em
90
- aplicacoes Ruby legadas.
89
+ description: Cliente oficial do Chronos para capturar e enviar exceções, métricas
90
+ e dados de telemetria de aplicações Ruby e Rails. A gem centraliza sinais de observabilidade
91
+ para facilitar o monitoramento, a análise de desempenho e o diagnóstico de falhas
92
+ no Chronos Monitor. Conheça a plataforma oficial de recebimento e visualização dos
93
+ dados em https://chronosmonitor.com.br.
91
94
  email:
92
95
  - antoniojeferson96@gmail.com
93
96
  executables: []
@@ -166,6 +169,8 @@ files:
166
169
  - docs/protocol-v1.md
167
170
  - docs/release-1.0-readiness.md
168
171
  - docs/release-1.1-readiness.md
172
+ - docs/release-1.1.2-readiness.md
173
+ - docs/release-1.1.3-readiness.md
169
174
  - docs/security-review.md
170
175
  - docs/semver.md
171
176
  - docs/troubleshooting.md
@@ -271,5 +276,5 @@ requirements: []
271
276
  rubygems_version: 3.4.22
272
277
  signing_key:
273
278
  specification_version: 4
274
- summary: Cliente Ruby para captura de eventos do Chronos
279
+ summary: Monitoramento de exceções, métricas e telemetria para Ruby e Rails
275
280
  test_files: []