chronos-ruby 1.1.0 → 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 +27 -0
- data/README.md +11 -10
- data/docs/compatibility.md +1 -1
- data/docs/configuration.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/configuration.rb +2 -1
- 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 +52 -10
- 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,33 @@ 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
|
+
|
|
26
|
+
## [1.1.1] - 2026-08-11
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- the Rails install generator now writes every public configuration option with explanatory English comments;
|
|
31
|
+
- the official `https://chronosmonitor.com.br` endpoint is now the default host when applications omit `config.host`;
|
|
32
|
+
- generated initializers no longer read `CHRONOS_HOST`, while explicit `config.host` assignments remain supported.
|
|
33
|
+
|
|
7
34
|
## [1.1.0] - 2026-08-05
|
|
8
35
|
|
|
9
36
|
### Added
|
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.0
|
|
|
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:
|
|
@@ -67,7 +67,8 @@ A Versão 0.5 introduziu Railtie, middleware e subscribers idempotentes por APIs
|
|
|
67
67
|
|
|
68
68
|
## Configuração mínima
|
|
69
69
|
|
|
70
|
-
Obrigatório quando o agente está habilitado: `project_id
|
|
70
|
+
Obrigatório quando o agente está habilitado: `project_id` e `project_key`. O `host` usa
|
|
71
|
+
`https://chronosmonitor.com.br` por padrão. Recomendado: definir ambiente e serviço explicitamente.
|
|
71
72
|
|
|
72
73
|
```ruby
|
|
73
74
|
require "chronos"
|
|
@@ -75,7 +76,6 @@ require "chronos"
|
|
|
75
76
|
Chronos.configure do |config|
|
|
76
77
|
config.project_id = ENV["CHRONOS_PROJECT_ID"]
|
|
77
78
|
config.project_key = ENV["CHRONOS_PROJECT_KEY"]
|
|
78
|
-
config.host = "https://chronos.example.com"
|
|
79
79
|
config.environment = ENV["APP_ENV"] || "production"
|
|
80
80
|
config.service_name = "billing"
|
|
81
81
|
config.app_version = ENV["APP_VERSION"]
|
|
@@ -204,13 +204,15 @@ Por padrão, SQL bruto e binds não são lidos pelo pipeline de análise. A insp
|
|
|
204
204
|
|
|
205
205
|
## Sidekiq e Active Job
|
|
206
206
|
|
|
207
|
-
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:
|
|
208
208
|
|
|
209
209
|
```ruby
|
|
210
210
|
gem "sidekiq", "~> 5.0"
|
|
211
|
-
gem "chronos-ruby", "~> 1.1.
|
|
211
|
+
gem "chronos-ruby", "~> 1.1.2", :require => "chronos/rails"
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
+
Aplicações Ruby sem Rails continuam usando `require "chronos/sidekiq"` explicitamente.
|
|
215
|
+
|
|
214
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).
|
|
215
217
|
|
|
216
218
|
## Deploy tracking
|
|
@@ -261,7 +263,6 @@ A gem não varre o ambiente. Leia somente variáveis escolhidas pela aplicação
|
|
|
261
263
|
Chronos.configure do |config|
|
|
262
264
|
config.project_id = ENV["CHRONOS_PROJECT_ID"]
|
|
263
265
|
config.project_key = ENV["CHRONOS_PROJECT_KEY"]
|
|
264
|
-
config.host = ENV["CHRONOS_HOST"]
|
|
265
266
|
config.environment = ENV["APP_ENV"] || "production"
|
|
266
267
|
config.enabled = ENV["CHRONOS_ENABLED"] != "false"
|
|
267
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
|
|
data/docs/configuration.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|---|---:|---|---|
|
|
7
7
|
| `project_id` | Yes when enabled | `nil` | Public project identifier included in the envelope |
|
|
8
8
|
| `project_key` | Yes when enabled | `nil` | Secret authentication key sent only as an HTTP header |
|
|
9
|
-
| `host` |
|
|
9
|
+
| `host` | Optional | `https://chronosmonitor.com.br` | Absolute Chronos HTTP endpoint; HTTPS is required by default |
|
|
10
10
|
| `environment` | Recommended | `production` | Application environment |
|
|
11
11
|
| `app_version` | Optional | `nil` | Application release/version identifier |
|
|
12
12
|
| `service_name` | Recommended | `nil` | Logical service name |
|
|
@@ -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
|
|
@@ -23,6 +23,7 @@ module Chronos
|
|
|
23
23
|
class Configuration
|
|
24
24
|
include Internal::ConfigurationValidation
|
|
25
25
|
include Internal::ApmConfigurationValidation
|
|
26
|
+
DEFAULT_HOST = "https://chronosmonitor.com.br".freeze
|
|
26
27
|
DEFAULT_BLOCKLIST_KEYS = %w(
|
|
27
28
|
password password_confirmation passwd secret api_key apikey authorization
|
|
28
29
|
token access_token refresh_token private_key client_secret cookie set-cookie
|
|
@@ -105,7 +106,7 @@ module Chronos
|
|
|
105
106
|
def initialize_core_defaults
|
|
106
107
|
@project_id = nil
|
|
107
108
|
@project_key = nil
|
|
108
|
-
@host =
|
|
109
|
+
@host = DEFAULT_HOST
|
|
109
110
|
@environment = "production"
|
|
110
111
|
@app_version = nil
|
|
111
112
|
@service_name = nil
|
|
@@ -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,20 +1,62 @@
|
|
|
1
1
|
require "chronos/rails"
|
|
2
2
|
|
|
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
|
+
|
|
3
13
|
Chronos.configure do |config|
|
|
4
|
-
#
|
|
14
|
+
# Identification and authentication
|
|
5
15
|
config.project_id = ENV["CHRONOS_PROJECT_ID"]
|
|
6
16
|
config.project_key = ENV["CHRONOS_PROJECT_KEY"]
|
|
7
|
-
config.
|
|
8
|
-
config.
|
|
9
|
-
config.service_name = ENV["CHRONOS_SERVICE_NAME"]
|
|
17
|
+
config.environment = ENV.fetch("CHRONOS_ENVIRONMENT", Rails.env.to_s)
|
|
18
|
+
config.service_name = ENV["CHRONOS_SERVICE_NAME"] || Chronos::Rails.application_name
|
|
10
19
|
config.app_version = ENV["CHRONOS_APP_VERSION"]
|
|
11
|
-
config.
|
|
20
|
+
config.revision = ENV["CHRONOS_REVISION"]
|
|
21
|
+
|
|
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)
|
|
12
51
|
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
|
17
59
|
end
|
|
18
60
|
|
|
19
|
-
#
|
|
61
|
+
# Installation is idempotent, regardless of when the Railtie was evaluated.
|
|
20
62
|
Chronos::Rails::Installer.new.install(Rails.application)
|
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
|