rails_event_viewer 0.4.0 → 0.4.1
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 +6 -0
- data/README.md +2 -0
- data/lib/generators/rails_event_viewer/install/templates/initializer.rb.erb +4 -0
- data/lib/rails_event_viewer/adapters/active_record.rb +3 -1
- data/lib/rails_event_viewer/version.rb +1 -1
- data/lib/rails_event_viewer.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d23e7d737a8e9d46d9ccbc7b5eafca59dbff648f3fd8deef10576d45555fbe3a
|
|
4
|
+
data.tar.gz: 9931baf5951842895eeacb45a87d56e50f2294dbbb0b105972995bdcfd7becf9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca612bc3fc3a3f16fa398cac9179a5dd23adc54021384693f552abc6333789ed6c8b0fb9904c3b7ca5a57bdfb90e60857292be0bd395beb82f99cbd05118f016
|
|
7
|
+
data.tar.gz: 89c8fe09a4ca8a901b2737b013280cbea230ca8a7ab9c10ffd5656a0e2e5214f30667e11e9f8a23e5c6db49575e9cda27851f060336ece2f08b985aa52e2015f
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.1 (2026-10-03)
|
|
4
|
+
|
|
5
|
+
Added:
|
|
6
|
+
|
|
7
|
+
- `config.transactional`, on by default. With `async = false`, set it to `false` so a failed event write does not abort the transaction caller's code is running in.
|
|
8
|
+
|
|
3
9
|
## 0.4.0 (2026-10-03)
|
|
4
10
|
|
|
5
11
|
Breaking:
|
data/README.md
CHANGED
|
@@ -60,6 +60,7 @@ RailsEventViewer.configure do |config|
|
|
|
60
60
|
config.buffer_size = 100 # flush after this many events
|
|
61
61
|
config.flush_interval = 2 # or after this many seconds
|
|
62
62
|
config.sample_rate = 1.0 # 0.1 keeps 10% of events
|
|
63
|
+
config.transactional = true # with async = false, a failed write aborts the transaction
|
|
63
64
|
|
|
64
65
|
config.captured_events = [] # empty captures everything
|
|
65
66
|
config.ignored_events += [/^debug\./] # strings or regexes
|
|
@@ -74,6 +75,7 @@ Internal Rails events such as `active_record.*` and `action_controller.*` are ig
|
|
|
74
75
|
## Sync vs async
|
|
75
76
|
|
|
76
77
|
- With `async = false`, each event is written inside your transaction, and a failed write is reported to `Rails.error`. In development and test, where Rails sets `raise_on_error`, it raises instead.
|
|
78
|
+
Sync writes are transactional by default, so a failed event write aborts the transaction on PostgreSQL. Set `transactional = false` to run each write in a savepoint instead.
|
|
77
79
|
- With `async = true`, events wait in an in-memory buffer and are lost if the process is killed. Set `config.buffer` to your own `RailsEventViewer::Buffer`, for example backed by Redis, to keep them.
|
|
78
80
|
|
|
79
81
|
## Authentication
|
|
@@ -49,6 +49,10 @@ RailsEventViewer.configure do |config|
|
|
|
49
49
|
# Useful for high-volume production environments
|
|
50
50
|
# config.sample_rate = 1.0
|
|
51
51
|
|
|
52
|
+
# With async = false, events are written inside the transaction. By default a failed
|
|
53
|
+
# write aborts it. Set to false to run each write in a savepoint so host's own writes survive.
|
|
54
|
+
# config.transactional = true
|
|
55
|
+
|
|
52
56
|
# ==========================================================================
|
|
53
57
|
# General Configuration
|
|
54
58
|
# ==========================================================================
|
data/lib/rails_event_viewer.rb
CHANGED
|
@@ -14,6 +14,7 @@ module RailsEventViewer
|
|
|
14
14
|
mattr_accessor :buffer_size, default: 100 # Flush after N events
|
|
15
15
|
mattr_accessor :flush_interval, default: 2 # Flush every N seconds
|
|
16
16
|
mattr_accessor :sample_rate, default: 1.0 # 1.0 = 100%, 0.1 = 10%
|
|
17
|
+
mattr_accessor :transactional, default: true # false = a failed sync write does not abort the caller's transaction
|
|
17
18
|
mattr_accessor :buffer, default: Buffers::Memory.new
|
|
18
19
|
|
|
19
20
|
mattr_accessor :retention_period, default: 7.days
|