chronos-ruby 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/README.md +9 -9
- data/docs/compatibility.md +1 -1
- data/docs/modules/rails-legacy.md +2 -2
- data/docs/modules/sidekiq-legacy.md +3 -3
- data/docs/release-1.1.2-readiness.md +21 -0
- data/docs/troubleshooting.md +1 -1
- data/lib/chronos/configuration/snapshot.rb +2 -2
- data/lib/chronos/rails/installer.rb +19 -0
- data/lib/chronos/rails.rb +13 -1
- data/lib/chronos/version.rb +1 -1
- data/lib/generators/chronos/install/templates/chronos.rb +50 -154
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 96db5e8fa31836510cfe450df09d41a235f7c70c05d085c80b76c61ca8afdc74
|
|
4
|
+
data.tar.gz: 9837a7eab93a50edc9c2d170bab8b8a084a4749427b67615c0a4bb1805b79ee3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3992ca7200cb52336fc4da5a47302de867a41fb602ed82ec803f6624251cdf4f321e6c19e339f001911d4775baaa54389a6ecc44ab45e79256c1fe8194e67031
|
|
7
|
+
data.tar.gz: fc0456b0c1ae67d67ab499812f3e2a9405c112e93105e2671e730cca3edd29085586fa3d1dab9a23543f224da011a291fe4a454d1af7be94c14e4ef8f7d98564
|
data/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,25 @@ All notable changes are documented here. The project follows Semantic Versioning
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [1.1.2] - 2026-08-13
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- the generated Rails initializer now exposes only common application-facing options with safe environment overrides;
|
|
12
|
+
- the official Chronos endpoint remains an internal default and is no longer assigned in generated initializers;
|
|
13
|
+
- Rails derives the service name from the application namespace when `CHRONOS_SERVICE_NAME` is absent;
|
|
14
|
+
- Rails applications automatically install the optional Sidekiq 4/5 client and server middleware when Sidekiq is available.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- configuration snapshots no longer freeze the Rails-owned logger, preventing later logger extensions from raising `FrozenError`;
|
|
19
|
+
- logger lookup and optional Sidekiq installation failures are contained so they cannot abort Rails boot.
|
|
20
|
+
|
|
21
|
+
### Security
|
|
22
|
+
|
|
23
|
+
- `CHRONOS_SSL_VERIFY` remains enabled by default and unknown Boolean values retain the secure default;
|
|
24
|
+
- generated Boolean overrides accept only explicit `1/0`, `true/false`, `yes/no`, and `on/off` forms.
|
|
25
|
+
|
|
7
26
|
## [1.1.1] - 2026-08-11
|
|
8
27
|
|
|
9
28
|
### Changed
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Chronos Ruby
|
|
2
2
|
|
|
3
|
-
Chronos Ruby 1.1.
|
|
3
|
+
Chronos Ruby 1.1.2 é 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.
|
|
27
|
+
A versão 1.1.2 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.
|
|
36
|
+
gem "chronos-ruby", "~> 1.1.2"
|
|
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.
|
|
49
|
+
gem install chronos-ruby -v 1.1.2
|
|
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.
|
|
57
|
+
gem "chronos-ruby", "~> 1.1.2", :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
|
|
207
|
+
A versão `0.6.0.pre.1` introduziu middleware Sidekiq 4/5. Em Rails, a versão 1.1.2 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.
|
|
211
|
+
gem "chronos-ruby", "~> 1.1.2", :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
|
data/docs/compatibility.md
CHANGED
|
@@ -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.
|
|
36
|
+
The release workflow repeats every supported pair before publishing. Version 1.1.2 evidence is recorded in [Version 1.1.2 readiness](release-1.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).
|
|
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
|
|
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
|
|
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.
|
|
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.2` 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.
|
|
7
|
+
gem "chronos-ruby", "~> 1.1.2", :require => "chronos/rails"
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
`chronos/sidekiq`
|
|
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
|
+
```
|
data/docs/troubleshooting.md
CHANGED
|
@@ -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
|
-
|
|
59
|
+
In Rails, require `chronos/rails` and configure Chronos before jobs run; version 1.1.2 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
|
|
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
|
|
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
|
data/lib/chronos/version.rb
CHANGED
|
@@ -1,165 +1,61 @@
|
|
|
1
1
|
require "chronos/rails"
|
|
2
2
|
|
|
3
|
-
#
|
|
4
|
-
#
|
|
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
|
-
#
|
|
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
|
-
|
|
11
|
-
config.
|
|
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
|
-
#
|
|
72
|
-
config.
|
|
73
|
-
|
|
74
|
-
config.
|
|
75
|
-
|
|
76
|
-
config.
|
|
77
|
-
|
|
78
|
-
config.
|
|
79
|
-
|
|
80
|
-
config.
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
#
|
|
84
|
-
config.
|
|
85
|
-
|
|
86
|
-
config.
|
|
87
|
-
|
|
88
|
-
config.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
config.
|
|
93
|
-
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
config.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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.
|
|
4
|
+
version: 1.1.2
|
|
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
|
+
date: 2026-08-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -166,6 +166,7 @@ files:
|
|
|
166
166
|
- docs/protocol-v1.md
|
|
167
167
|
- docs/release-1.0-readiness.md
|
|
168
168
|
- docs/release-1.1-readiness.md
|
|
169
|
+
- docs/release-1.1.2-readiness.md
|
|
169
170
|
- docs/security-review.md
|
|
170
171
|
- docs/semver.md
|
|
171
172
|
- docs/troubleshooting.md
|