railwatch 1.0.0 → 1.1.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 +24 -0
- data/lib/generators/railwatch/install/templates/railwatch.ts +11 -5
- data/lib/railwatch/configuration.rb +0 -4
- data/lib/railwatch/reporter.rb +10 -1
- data/lib/railwatch/version.rb +1 -1
- 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: c905c857b9616e0eb4a38518afa97d787f0ee12eab644c950671278ec28ef0e3
|
|
4
|
+
data.tar.gz: 98e4c9103ac4231d2a676b55ceca51ff36d9c84c8570c97391c0eb4d07675b27
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b31a6f1ae9843426a8480c3f6c9ee8551c886083d6643069cfbd35e5cc7275416fa047d06270d80ce8410619bf0b7431f5ebb0cf9204a59be50ce1f3a30fc08
|
|
7
|
+
data.tar.gz: ed4a1f14aef82b6586b8fd86cd86071b5741906de30f89e12f28327d9e9aeaac664fcbbfc6a2ae1d674ec2ee2599fbcd141fb86c30b44db58c84900f7d21b841
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,30 @@
|
|
|
6
6
|
filled in by the release commit, which is also the only commit that
|
|
7
7
|
touches lib/railwatch/version.rb and Gemfile.lock. See CONTRIBUTING.md. -->
|
|
8
8
|
|
|
9
|
+
## 1.1.1 (2026-10-24)
|
|
10
|
+
|
|
11
|
+
- The browser client names the first page load after its Inertia
|
|
12
|
+
component again on inertia_rails 3.23+, which renders the page object as
|
|
13
|
+
`<script data-page="app" type="application/json">` instead of a
|
|
14
|
+
`data-page` attribute on `<div id="app">`. The client only read the
|
|
15
|
+
attribute, so every initial load (the only visits that carry LCP, CLS,
|
|
16
|
+
INP and TTFB) arrived with no component: per-page web vitals were empty.
|
|
17
|
+
Apps that copied the client (`app/frontend/lib/railwatch.ts`) need the
|
|
18
|
+
same change in their copy.
|
|
19
|
+
|
|
20
|
+
## 1.1.0 (2026-10-22)
|
|
21
|
+
|
|
22
|
+
- A receiver that refuses the connection (nothing listening: a Railwatch
|
|
23
|
+
server restarting, or a deploy handing over to the next container) no
|
|
24
|
+
longer counts as backpressure. The retry ladder it starts used to double
|
|
25
|
+
the sampling divisor every flush tick, so the app's first requests after
|
|
26
|
+
the server came back were sampled out: a fresh app recorded 23-29 of 30
|
|
27
|
+
requests sent right after its embedded server was killed and restarted,
|
|
28
|
+
in every one of 10 runs. A timeout, a 5xx and a full buffer are still
|
|
29
|
+
pressure.
|
|
30
|
+
- `Configuration#local?` is gone. It was kept in 1.0.0 only for
|
|
31
|
+
railwatch-server 0.1.0; railwatch-server 0.1.1 no longer calls it.
|
|
32
|
+
|
|
9
33
|
## 1.0.0 (2026-10-22)
|
|
10
34
|
|
|
11
35
|
- **Breaking: `railwatch` is the agent only.** It instruments the app and
|
|
@@ -659,13 +659,19 @@ function startVitals() {
|
|
|
659
659
|
)
|
|
660
660
|
}
|
|
661
661
|
|
|
662
|
-
// The component the server rendered this page with, off the
|
|
663
|
-
//
|
|
662
|
+
// The component the server rendered this page with, off the serialized page
|
|
663
|
+
// object: inertia_rails 3.23+ renders it as <script data-page="app"
|
|
664
|
+
// type="application/json">, older ones as <div id="app" data-page="...">.
|
|
665
|
+
// Inertia's own events take over from here.
|
|
664
666
|
function pageComponent(): string | undefined {
|
|
665
667
|
try {
|
|
666
|
-
const
|
|
667
|
-
|
|
668
|
-
)
|
|
668
|
+
const script = document.querySelector(
|
|
669
|
+
'script[data-page="app"][type="application/json"]',
|
|
670
|
+
)
|
|
671
|
+
const raw = script
|
|
672
|
+
? script.textContent
|
|
673
|
+
: document.getElementById("app")?.dataset.page
|
|
674
|
+
const page = JSON.parse(raw ?? "{}") as { component?: string }
|
|
669
675
|
return page.component
|
|
670
676
|
} catch {
|
|
671
677
|
// Not an Inertia-rendered page, or the payload moved. Report it anyway.
|
|
@@ -284,10 +284,6 @@ module Railwatch
|
|
|
284
284
|
@enabled && token.present?
|
|
285
285
|
end
|
|
286
286
|
|
|
287
|
-
# Always false: there is no embedded transport any more. Only
|
|
288
|
-
# railwatch-server 0.1.0 calls it.
|
|
289
|
-
def local? = false
|
|
290
|
-
|
|
291
287
|
# Both halves present. Read late (not at boot) so credentials set from an
|
|
292
288
|
# initializer, an env var or the configure task all count.
|
|
293
289
|
def http_basic_auth_configured?
|
data/lib/railwatch/reporter.rb
CHANGED
|
@@ -72,6 +72,7 @@ module Railwatch
|
|
|
72
72
|
@flush_requested = false
|
|
73
73
|
@urgent_at = nil
|
|
74
74
|
@retry_attempt = 0
|
|
75
|
+
@unreachable = false
|
|
75
76
|
@retry_at = nil
|
|
76
77
|
@retry_batch = nil
|
|
77
78
|
# Ruby ivars hold object references atomically. The reporter is the
|
|
@@ -400,6 +401,7 @@ module Railwatch
|
|
|
400
401
|
@backpressure_factor = MAX_BACKPRESSURE_FACTOR if @config.backpressure
|
|
401
402
|
end
|
|
402
403
|
@retry_attempt += 1
|
|
404
|
+
@unreachable = result.status.nil? && result.error.to_s.start_with?("Errno::ECONNREFUSED")
|
|
403
405
|
if @retry_attempt > MAX_RETRY_ATTEMPTS
|
|
404
406
|
@buffer.account_dropped(batch.records.size + batch.dropped,
|
|
405
407
|
bytes: batch.bytes + batch.dropped_bytes)
|
|
@@ -506,6 +508,7 @@ module Railwatch
|
|
|
506
508
|
@in_flight_dropped_bytes = 0
|
|
507
509
|
@retry_attempt = 0
|
|
508
510
|
@retry_at = nil
|
|
511
|
+
@unreachable = false
|
|
509
512
|
end
|
|
510
513
|
end
|
|
511
514
|
|
|
@@ -600,8 +603,14 @@ module Railwatch
|
|
|
600
603
|
|
|
601
604
|
buffered, _, buffered_bytes, = @buffer.stats
|
|
602
605
|
high_water = @config.backpressure_high_water
|
|
606
|
+
# A retry ladder is pressure when the receiver is struggling (a timeout,
|
|
607
|
+
# a 5xx). Not when nothing listens (ECONNREFUSED): that is a server
|
|
608
|
+
# restarting or a deploy handing over, back in a second or two, and
|
|
609
|
+
# sampling down meanwhile only lost the app's first requests after it.
|
|
610
|
+
# The buffer's high-water mark still bounds a receiver that stays away.
|
|
611
|
+
retrying = @retry_attempt.positive? && !@unreachable
|
|
603
612
|
pressured = buffered >= @config.buffer_size * high_water ||
|
|
604
|
-
buffered_bytes >= @config.buffer_bytes * high_water ||
|
|
613
|
+
buffered_bytes >= @config.buffer_bytes * high_water || retrying
|
|
605
614
|
@backpressure_factor = if pressured
|
|
606
615
|
[ @backpressure_factor * 2.0, MAX_BACKPRESSURE_FACTOR ].min
|
|
607
616
|
else
|
data/lib/railwatch/version.rb
CHANGED