chronos-ruby 1.2.0.pre.2 → 1.2.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: 28ccfc363bc7f73eb18a10d36e0457d8697ffe52dae4f939fa81a4cbe6938609
4
- data.tar.gz: ac5d64237250a9d9d1e26da86649698dd09eda1afb7a115fb87eb2edf6d3183b
3
+ metadata.gz: 77021c8f603c5908e1e31bb85824a1dcadb6b73917492f51e617128a81170157
4
+ data.tar.gz: af6c9e930a0c6ea86154c9cfb89b60e2dd6920d934d2afca611a2d129496fa3e
5
5
  SHA512:
6
- metadata.gz: 58987b0079af3abcd99ee06f6c2739833719d95ae29ef7764997f37c01745f269521453d610a7bfd7b9081c26593590c469d58d52a502ab752668d1d1d2d4e19
7
- data.tar.gz: ba3277ee0bbc7fd67186e605505659ae2db7a1add6cad35c08bcf30669b1e7140f5c004ad9ace8154d2a25a72af9d6938aacf2ac04ea0da4dd9924700b0c2df8
6
+ metadata.gz: f2b69c2ef1d1acaaf1e6ded9182e2daeb78549b71ae48e06b0e982fe79d41655f6c4d5c44a0736f683cdb476a90558d5df2561e2f090013e235d4a3ccc1eeddd
7
+ data.tar.gz: 4989786700879e83e42fb70b9bdfec2e025271d0f97edf294d75e1c2138f40fb1e80e8a7477cadb4cd634fa3fb1c2e80295b7b47858444fad4903df2e831d918
data/CHANGELOG.md CHANGED
@@ -4,6 +4,31 @@ All notable changes are documented here. The project follows Semantic Versioning
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.2.0] - 2026-08-12
8
+
9
+ ### Added
10
+
11
+ - automatic Sidekiq client and server middleware installation when Sidekiq is available in a Rails application;
12
+ - Rails application namespace discovery as the default service name when `CHRONOS_SERVICE_NAME` is absent;
13
+ - environment-driven defaults for the most frequently customized Rails, transport, privacy, and APM settings in the generated initializer.
14
+
15
+ ### Changed
16
+
17
+ - promoted the Ruby 2.7–3.4 transitional line from `1.2.0.pre.2` to the stable `1.2.0` release;
18
+ - simplified the generated Rails initializer while retaining safe SDK defaults and explicit application overrides;
19
+ - kept the official Chronos endpoint internal instead of exposing `config.host` in generated initializers;
20
+ - Sidekiq telemetry now activates through the ordinary Rails integration without requiring `chronos/sidekiq` explicitly.
21
+
22
+ ### Fixed
23
+
24
+ - configuration snapshots no longer freeze the Rails-owned logger, preventing `FrozenError` during later Rails 8 and dotenv logger initialization;
25
+ - Rails logger lookup and optional Sidekiq installation remain contained so integration failures cannot abort application boot.
26
+
27
+ ### Security
28
+
29
+ - boolean environment overrides accept only explicit true/false forms and fall back to documented safe defaults;
30
+ - existing bounded payload, sanitization, trace validation, and optional OpenTelemetry behavior remain unchanged under protocol v1.
31
+
7
32
  ## [1.2.0.pre.2] - 2026-08-11
8
33
 
9
34
  ### Changed
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Chronos Ruby
2
2
 
3
- Chronos Ruby 1.1.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.
3
+ Chronos Ruby 1.2.0 é o agente para enviar exceções, métricas e telemetria limitada de aplicações Ruby e Rails ao Chronos. Esta é a linha estável atual para Ruby 2.7–3.4, compatível com o protocolo v1.
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 candidata 1.2.0.pre.2 continua a linha transitional para Ruby 2.7–3.4, Rails 7.x e Sidekiq 7. Ela adiciona contexto por Fiber, Rails Error Reporter, Action Cable, Faraday, Trace Context W3C opcional e coexistência com um SDK OpenTelemetry já configurado. Use-a explicitamente em staging enquanto a matriz transitional é validada; as linhas legadas permanecem disponíveis em releases anteriores.
27
+ A versão estável 1.2.0 atende a linha transitional para Ruby 2.7–3.4, Rails 7.x e Sidekiq 7. Ela adiciona contexto por Fiber, Rails Error Reporter, Action Cable, Faraday, Trace Context W3C opcional, integração automática com Sidekiq em Rails e coexistência com um SDK OpenTelemetry já configurado. Combinações ainda classificadas como `Best effort` devem ser validadas pela aplicação antes da adoção em produção; as linhas legadas permanecem disponíveis em releases anteriores.
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,14 +33,14 @@ 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.0"
36
+ gem "chronos-ruby", "~> 1.2.0"
37
37
  ```
38
38
 
39
- Em runtimes antigos, use Bundler compatível:
39
+ Use Bundler 2 em um runtime suportado:
40
40
 
41
41
  ```bash
42
- gem install bundler -v 1.17.3
43
- bundle _1.17.3_ install
42
+ gem install bundler -v "~> 2.4"
43
+ bundle install
44
44
  ```
45
45
 
46
46
  Sem Bundler:
@@ -205,15 +205,18 @@ Por padrão, SQL bruto e binds não são lidos pelo pipeline de análise. A insp
205
205
 
206
206
  ## Sidekiq e Active Job
207
207
 
208
- A integração mantém o require explícito e suporta a API pública de middleware do Sidekiq 7:
208
+ A integração Rails detecta o Sidekiq e instala automaticamente os middlewares de cliente e servidor. O carregamento
209
+ explícito continua disponível para aplicações sem Rails e suporta a API pública de middleware do Sidekiq 7:
209
210
 
210
211
  O suporte histórico começou em `0.6.0.pre.1`; aplicações em Sidekiq 4/5 devem permanecer numa release legada compatível.
211
212
 
212
213
  ```ruby
213
214
  gem "sidekiq", "~> 5.0"
214
- gem "chronos-ruby", "~> 1.1.0", :require => "chronos/sidekiq"
215
+ gem "chronos-ruby", "~> 1.1.0"
215
216
  ```
216
217
 
218
+ Em uma aplicação Ruby sem Rails, use `require "chronos/sidekiq"`.
219
+
217
220
  O envelope de contexto não altera argumentos públicos e contém somente IDs limitados de trace/span/request e flags. Active Job usa um campo serializado com namespace (`chronos_context`) e hooks públicos. Erros aninhados são deduplicados e reerguidos. Veja [Sidekiq legado](docs/modules/sidekiq-legacy.md), [Active Job](docs/modules/active-job.md) e [Jobs](docs/modules/job-monitoring.md).
218
221
 
219
222
  ## Deploy tracking
@@ -305,21 +308,20 @@ Migre por etapas e mantenha os dois agentes juntos somente durante a validação
305
308
 
306
309
  ## Desenvolvimento local
307
310
 
308
- Instale Bundler 1.17.3 e as dependências:
311
+ Instale as dependências:
309
312
 
310
313
  ```bash
311
- gem install bundler -v 1.17.3
312
314
  bin/setup
313
315
  ```
314
316
 
315
- 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).
317
+ Use `bin/console` para inspeção e `bundle exec rake install` para instalar a fonte localmente. A arquitetura hexagonal está descrita em [Arquitetura](docs/architecture.md).
316
318
 
317
319
  ## Testes
318
320
 
319
321
  Execute suíte e lint no runtime atual:
320
322
 
321
323
  ```bash
322
- bundle _1.17.3_ exec rake
324
+ bundle exec rake
323
325
  ```
324
326
 
325
327
  A matriz CI cobre a linha transitional e os checks de pacote/documentação; workflows legados preservam evidência das releases anteriores.
@@ -1,6 +1,6 @@
1
1
  # Compatibility
2
2
 
3
- Chronos Ruby 1.2.0.pre.2 is the current candidate of the transitional line for Rails 7 and Sidekiq 7. Combinations remain `Best effort` until their dedicated CI and real-application gates pass. Technical compatibility does not make an end-of-life Ruby, Rails, Rack, or Sidekiq release secure. Versions 1.0 and 1.1 remain the frozen legacy line.
3
+ Chronos Ruby 1.2.0 is the current stable release of the transitional line for modern Ruby, Rails, and Sidekiq applications. Individual combinations remain `Best effort` until their dedicated CI and real-application gates pass; a stable package version does not by itself promote an unverified combination to `Supported`. Technical compatibility does not make an end-of-life Ruby, Rails, Rack, or Sidekiq release secure. Versions 1.0 and 1.1 remain the frozen legacy line.
4
4
 
5
5
  ## Core and Rack
6
6
 
@@ -27,7 +27,7 @@ Chronos Ruby 1.2.0.pre.2 is the current candidate of the transitional line for R
27
27
 
28
28
  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.
29
29
 
30
- Historical evidence remains in [Version 1.0 readiness](release-1.0-readiness.md) and [Version 1.1 readiness](release-1.1-readiness.md).
30
+ Release evidence is recorded in [Version 1.2 readiness](release-1.2-readiness.md). Historical evidence remains in [Version 1.0 readiness](release-1.0-readiness.md) and [Version 1.1 readiness](release-1.1-readiness.md).
31
31
 
32
32
  Status meanings:
33
33
 
@@ -0,0 +1,33 @@
1
+ # Version 1.2 release readiness
2
+
3
+ Version `1.2.0` promotes the transitional Ruby 2.7–3.4 line to a stable package. It includes Rails 7 integration, Sidekiq 7 middleware, fiber-aware context, optional W3C Trace Context, Rails Error Reporter, Action Cable, Faraday, and coexistence with an application-managed OpenTelemetry SDK. The wire protocol remains `schema_version: "1.0"`.
4
+
5
+ ## Release gates
6
+
7
+ The `v1.2.0` tag must match `Chronos::VERSION`. The release workflow blocks publishing until all of these jobs succeed:
8
+
9
+ - the full RSpec and RuboCop suite on Ruby 2.7, 3.0, 3.1, 3.2, 3.3, and 3.4;
10
+ - documentation and contract verification through `script/verify_docs`;
11
+ - bounded query-analysis and comparative benchmarks;
12
+ - the 500-event fake-endpoint delivery and privacy gate;
13
+ - a second full suite run on the publishing runtime;
14
+ - gem build, SHA-256 checksum, SPDX SBOM generation, and RubyGems Trusted Publishing.
15
+
16
+ Local release preparation must additionally verify syntax, package contents, version consistency, and a clean generated initializer. Publication is performed only by the protected GitHub Actions environment; do not run `gem push` manually.
17
+
18
+ ## Compatibility claims
19
+
20
+ A stable gem version and a supported framework/runtime pair are separate claims. Only combinations with complete CI and real-application evidence may be marked `Supported` in [compatibility](compatibility.md). Other intended combinations remain `Best effort` and should be validated in staging before production adoption.
21
+
22
+ Legacy Ruby 2.2–2.6, Rails 4/5, and Sidekiq 4/5 applications must remain on a compatible 1.0/1.1 release. Version 1.2 requires Ruby `>= 2.7` and `< 3.5`.
23
+
24
+ ## Publishing
25
+
26
+ After the final commit and all branch checks are green:
27
+
28
+ ```bash
29
+ git tag v1.2.0
30
+ git push origin v1.2.0
31
+ ```
32
+
33
+ After Trusted Publishing completes, verify a clean install and run `chronos:verify_integration` against a non-production project before announcing the release as latest.
@@ -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
  install_error_reporter
38
39
  @subscriber.install
39
40
  self.class.applications[application.object_id] = true
@@ -66,6 +67,24 @@ module Chronos
66
67
  Chronos::Integrations::ActiveJob.install(::ActiveJob::Base, @notifier)
67
68
  end
68
69
 
70
+ def install_sidekiq
71
+ library = sidekiq_library
72
+ return false unless library
73
+
74
+ Chronos::Integrations::Sidekiq.install(library, @notifier)
75
+ rescue StandardError
76
+ false
77
+ end
78
+
79
+ def sidekiq_library
80
+ return ::Sidekiq if defined?(::Sidekiq)
81
+
82
+ require "sidekiq"
83
+ ::Sidekiq if defined?(::Sidekiq)
84
+ rescue LoadError
85
+ nil
86
+ end
87
+
69
88
  def install_error_reporter
70
89
  return false unless defined?(::Rails) && ::Rails.respond_to?(:error)
71
90
 
data/lib/chronos/rails.rb CHANGED
@@ -3,6 +3,7 @@ require "chronos/rails/active_record_query_inspector"
3
3
  require "chronos/rails/notifications_subscriber"
4
4
  require "chronos/rails/error_reporter_subscriber"
5
5
  require "chronos/integrations/active_job"
6
+ require "chronos/integrations/sidekiq"
6
7
  require "chronos/rails/installer"
7
8
 
8
9
  require "chronos/rails/railtie" if defined?(::Rails::Railtie)
@@ -15,5 +16,16 @@ module Chronos
15
16
  # @limits Version 0.5 targets public APIs present in Rails 4.2 and 5.2.
16
17
  # @thread_safety Installation and subscriptions are protected against duplication.
17
18
  # @compatibility Rails 4.2 through Rails 5.2 with their supported legacy Rubies.
18
- module Rails; end
19
+ module Rails
20
+ class << self
21
+ # Returns the namespace that owns the Rails application class.
22
+ def application_name(application = ::Rails.application)
23
+ class_name = application.class.name.to_s
24
+ name = class_name.sub(/::Application\z/, "")
25
+ name.empty? || name == class_name ? nil : name
26
+ rescue StandardError
27
+ nil
28
+ end
29
+ end
30
+ end
19
31
  end
@@ -1,4 +1,4 @@
1
1
  module Chronos
2
2
  # Current version of the transitional Chronos Ruby agent.
3
- VERSION = "1.2.0.pre.2".freeze
3
+ VERSION = "1.2.0".freeze
4
4
  end
@@ -1,185 +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
+ value = ENV[name]
7
+ normalized = value.to_s.downcase
8
+ next true if %w(1 true yes on).include?(normalized)
9
+ next false if %w(0 false no off).include?(normalized)
10
+
11
+ default
12
+ end
13
+
5
14
  Chronos.configure do |config|
6
15
  # Identification and authentication
7
-
8
- # Identifies the project that will receive monitoring events.
9
16
  config.project_id = ENV["CHRONOS_PROJECT_ID"]
10
- # Authenticates event delivery. Keep this value in a secret manager.
11
17
  config.project_key = ENV["CHRONOS_PROJECT_KEY"]
12
- # Defines the Chronos Monitor endpoint used to deliver events.
13
- config.host = "https://chronosmonitor.com.br"
14
- # Labels events with the current Rails environment.
15
- config.environment = Rails.env.to_s
16
- # Identifies the deployed application version in events and releases.
18
+ config.environment = ENV.fetch("CHRONOS_ENVIRONMENT", Rails.env.to_s)
19
+ config.service_name = ENV["CHRONOS_SERVICE_NAME"] || Chronos::Rails.application_name
17
20
  config.app_version = ENV["CHRONOS_APP_VERSION"]
18
- # Distinguishes this application from other monitored services.
19
- config.service_name = ENV["CHRONOS_SERVICE_NAME"]
20
- # Records the source revision, such as a Git commit SHA.
21
21
  config.revision = ENV["CHRONOS_REVISION"]
22
- # Associates events with a specific deployment.
23
- config.deploy_id = ENV["CHRONOS_DEPLOY_ID"]
24
- # Identifies the infrastructure region where the application is running.
25
- config.region = ENV["CHRONOS_REGION"]
26
- # Identifies the process, container, or host that produced an event.
27
- config.instance_id = ENV["CHRONOS_INSTANCE_ID"]
28
- # Removes the application root from file paths reported to Chronos.
29
- config.root_directory = Rails.root.to_s
30
- # Sends internal Chronos diagnostics through the Rails logger.
31
- config.logger = Rails.logger if Rails.respond_to?(:logger)
32
-
33
- # Transport and delivery
34
-
35
- # Limits how long an established request may wait for the Chronos server.
36
- config.timeout = 5
37
- # Limits how long Chronos may wait while opening a network connection.
38
- config.open_timeout = 2
39
- # Sets the maximum number of events waiting in the in-memory queue.
40
- config.queue_size = 100
41
- # Sets the number of background workers that deliver queued events.
42
- config.workers = 1
43
- # Enables or disables all Chronos event collection and delivery.
44
- config.enabled = true
45
- # Controls whether captured exceptions are sent to Chronos.
46
- config.error_notifications = true
47
- # Prevents delivery from the listed application environments.
48
- config.ignored_environments = []
49
- # Routes outbound requests through a proxy URL when one is required.
50
- config.proxy = nil
51
- # Verifies the TLS certificate presented by the Chronos endpoint.
52
- config.ssl_verify = true
53
- # Identifies this SDK in outbound HTTP requests.
54
- config.user_agent = "chronos-ruby/#{Chronos::VERSION}"
55
- # Rejects serialized events larger than this number of bytes.
56
- config.max_payload_size = 1_048_576
57
- # Compresses request payloads with gzip when enabled.
58
- config.gzip = false
59
-
60
- # Privacy and filtering
61
-
62
- # Removes values whose keys commonly contain credentials or private data.
63
- config.blocklist_keys = Chronos::Configuration::DEFAULT_BLOCKLIST_KEYS.dup
64
- # Keeps only the listed keys when this list is not empty.
65
- config.allowlist_keys = []
66
- # Applies custom callables that can transform or discard events.
67
- config.filters = []
68
- # Replaces values for these keys with stable hashes instead of raw data.
69
- config.hash_keys = []
70
- # Removes the final segment of captured IP addresses.
71
- config.anonymize_ip = true
72
- # Discards events that match any configured ignore rule.
73
- config.ignore_rules = []
74
- # Limits the number of ignore rules evaluated for each event.
75
- config.max_ignore_rules = 20
76
-
77
- # Reliability and remote configuration
78
22
 
79
- # Sets the number of delivery retries after a recoverable failure.
80
- config.max_retries = 3
81
- # Sets the initial delay, in seconds, for exponential retry backoff.
82
- config.retry_base_interval = 0.5
83
- # Caps the retry delay, in seconds.
84
- config.retry_max_interval = 30
85
- # Randomizes retry delays to prevent synchronized retry traffic.
86
- config.retry_jitter = 0.25
87
- # Keeps this many failed events in memory for later delivery attempts.
88
- config.backlog_size = 100
89
- # Opens the circuit breaker after this many consecutive failures.
90
- config.circuit_failure_threshold = 5
91
- # Waits this many seconds before testing an open circuit again.
92
- config.circuit_reset_timeout = 30
93
- # Allows the server to supply bounded runtime configuration updates.
94
- config.remote_configuration = true
95
- # Limits the size of an accepted remote configuration response, in bytes.
96
- config.remote_config_max_bytes = 4_096
97
- # Captures this fraction of eligible events, from 0.0 to 1.0.
98
- config.sampling_rate = 1.0
99
- # Restricts remote collection to these event categories.
100
- config.enabled_event_types = %w(
101
- exception request query job cache external_http dependencies deploy metric_batch
102
- )
103
- # Caps the server-requested interval between deliveries, in seconds.
104
- config.max_remote_send_interval = 60
105
-
106
- # Execution context and breadcrumbs
107
-
108
- # Isolates trace and request context between concurrent fibers.
109
- config.context_store = :fiber_local
110
- # Keeps this many recent breadcrumbs per execution context.
111
- config.breadcrumb_capacity = 20
112
- # Limits the serialized size of each breadcrumb, in bytes.
113
- config.breadcrumb_max_bytes = 2_048
114
-
115
- # Rails integration
116
-
117
- # Installs Rails request, job, cache, SQL, and error integrations.
118
- config.rails_enabled = true
119
- # Captures events from Rails console sessions when enabled.
120
- config.rails_capture_in_console = false
121
- # Captures events while the Rails test environment is running when enabled.
122
- config.rails_capture_in_test = false
123
- # Includes the request User-Agent in request metadata when enabled.
124
- config.rails_capture_user_agent = false
23
+ # General behavior and transport
24
+ config.enabled = env_boolean.call("CHRONOS_ENABLED", true)
25
+ config.error_notifications = env_boolean.call("CHRONOS_ERROR_NOTIFICATIONS", true)
26
+ config.ssl_verify = env_boolean.call("CHRONOS_SSL_VERIFY", true)
27
+ config.timeout = ENV.fetch("CHRONOS_TIMEOUT", "5").to_f
28
+ config.open_timeout = ENV.fetch("CHRONOS_OPEN_TIMEOUT", "2").to_f
29
+ config.queue_size = ENV.fetch("CHRONOS_QUEUE_SIZE", "100").to_i
30
+ config.workers = ENV.fetch("CHRONOS_WORKERS", "1").to_i
31
+ config.sampling_rate = ENV.fetch("CHRONOS_SAMPLING_RATE", "1.0").to_f
32
+ config.ignored_environments = ENV.fetch("CHRONOS_IGNORED_ENVIRONMENTS", "")
33
+ .split(",").map(&:strip).reject(&:empty?)
34
+
35
+ # Rails integration and privacy
36
+ config.root_directory = Rails.root.to_s
37
+ config.rails_enabled = env_boolean.call("CHRONOS_RAILS_ENABLED", true)
38
+ config.rails_capture_in_console = env_boolean.call("CHRONOS_RAILS_CAPTURE_IN_CONSOLE", false)
39
+ config.rails_capture_in_test = env_boolean.call("CHRONOS_RAILS_CAPTURE_IN_TEST", false)
40
+ config.anonymize_ip = env_boolean.call("CHRONOS_ANONYMIZE_IP", true)
125
41
 
126
42
  # Application performance monitoring
127
-
128
- # Enables transaction, span, query, and aggregate performance monitoring.
129
- config.apm_enabled = true
130
- # Limits the number of metric groups retained between flushes.
131
- config.apm_max_groups = 200
132
- # Flushes APM aggregates after this many observations.
133
- config.apm_flush_count = 100
134
- # Sends at most this many APM items in one request.
135
- config.apm_batch_size = 50
136
- # Limits the SQL queries recorded for a single request or transaction.
137
- config.apm_max_queries_per_request = 100
138
- # Marks SQL queries slower than this duration, in milliseconds.
139
- config.apm_slow_query_threshold_ms = 500
140
- # Marks transactions longer than this duration, in milliseconds.
141
- config.apm_long_transaction_threshold_ms = 1_000
142
- # Reports repeated equivalent queries after this count is reached.
143
- config.apm_n_plus_one_threshold = 5
144
- # Defines the duration buckets, in milliseconds, used by APM histograms.
145
- config.apm_histogram_buckets = [5, 10, 25, 50, 100, 250, 500, 1_000, 2_500, 5_000]
146
- # Retains active trace state for this many seconds.
147
- config.apm_trace_ttl_seconds = 60
148
- # Normalizes SQL and records bounded query analysis metadata.
149
- config.apm_query_analysis_enabled = true
150
- # Limits the number of analyzed queries retained per transaction.
151
- config.apm_query_analysis_max_queries = 100
152
- # Enables database-specific query inspection for slow queries.
153
- config.apm_query_inspection_enabled = false
154
- # Collects database query statistics when inspection supports them.
155
- config.apm_query_statistics_enabled = false
156
- # Collects query execution plans when inspection supports them.
157
- config.apm_query_plan_enabled = false
158
- # Inspects only queries at least this slow, in milliseconds.
159
- config.apm_query_inspection_min_duration_ms = 500
160
- # Limits the inspected queries retained per transaction.
161
- config.apm_query_inspection_max_queries = 20
162
- # Tracks database transaction lifecycles and durations.
163
- config.apm_transaction_tracking_enabled = true
164
- # Limits the database connections tracked for transaction state.
165
- config.apm_transaction_max_connections = 100
166
-
167
- # Distributed tracing and integrations
168
-
169
- # Instruments supported outbound HTTP clients when enabled.
170
- config.external_http_enabled = false
171
- # Propagates Chronos trace headers on instrumented outbound requests.
172
- config.external_http_trace_headers = true
173
- # Extracts and injects the standard W3C traceparent header when enabled.
174
- config.w3c_trace_context = false
175
- # Reuses an active OpenTelemetry span without configuring its SDK.
176
- config.opentelemetry_bridge = true
177
- # Controls cache key reporting; :none avoids collecting cache key material.
178
- config.cache_key_mode = :none
179
- # Reports a bounded inventory of application dependencies.
180
- config.dependency_reporting = true
181
- # Limits the number of dependencies included in an inventory event.
182
- config.dependency_max_items = 100
43
+ config.apm_enabled = env_boolean.call("CHRONOS_APM_ENABLED", true)
44
+ config.apm_slow_query_threshold_ms = ENV.fetch(
45
+ "CHRONOS_APM_SLOW_QUERY_THRESHOLD_MS", "500"
46
+ ).to_f
47
+ config.apm_long_transaction_threshold_ms = ENV.fetch(
48
+ "CHRONOS_APM_LONG_TRANSACTION_THRESHOLD_MS", "1000"
49
+ ).to_f
50
+ config.apm_n_plus_one_threshold = ENV.fetch("CHRONOS_APM_N_PLUS_ONE_THRESHOLD", "5").to_i
51
+ config.external_http_enabled = env_boolean.call("CHRONOS_EXTERNAL_HTTP_ENABLED", false)
52
+
53
+ # Chronos keeps the shared Rails logger mutable and contains logger failures.
54
+ begin
55
+ config.logger = Rails.logger if Rails.respond_to?(:logger)
56
+ rescue StandardError
57
+ # Chronos safely continues without an application logger.
58
+ end
183
59
  end
184
60
 
185
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.2.0.pre.2
4
+ version: 1.2.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-08-11 00:00:00.000000000 Z
11
+ date: 2026-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -164,6 +164,7 @@ files:
164
164
  - docs/protocol-v1.md
165
165
  - docs/release-1.0-readiness.md
166
166
  - docs/release-1.1-readiness.md
167
+ - docs/release-1.2-readiness.md
167
168
  - docs/security-review.md
168
169
  - docs/semver.md
169
170
  - docs/troubleshooting.md
@@ -267,9 +268,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
267
268
  version: '3.5'
268
269
  required_rubygems_version: !ruby/object:Gem::Requirement
269
270
  requirements:
270
- - - ">"
271
+ - - ">="
271
272
  - !ruby/object:Gem::Version
272
- version: 1.3.1
273
+ version: '0'
273
274
  requirements: []
274
275
  rubygems_version: 3.4.22
275
276
  signing_key: