Commit 9a8d47f
authored
feat(xdbg): V3→V4 migration latency monitor (#3338)
## Summary
- Adds a **V3→V4 migration latency test** to xdbg (`test
migration-latency` subcommand)
- Integrates the test into the **client monitor entrypoint.sh loop**
(runs every 5 minutes alongside identity/group/message tests)
- Fixes a **pre-existing bug** where all PushGateway metric pushes
silently failed (fire-and-forget `tokio::spawn` was cancelled when
short-lived xdbg subprocesses exited)
## What it does
1. Creates a V3 identity and group on production
2. Sends a tagged message via V3
3. Polls the V4 testnet replication node until the message appears (or
times out)
4. Records `xdbg_migration_latency_seconds` histogram,
`xdbg_migration_success_total` / `xdbg_migration_failure_total` counters
5. Pushes all metrics to PushGateway (awaited, not fire-and-forget)
## Key design decisions
- Migration test always uses V3 **production** and V4 **testnet**
(`grpc.testnet.xmtp.network`), regardless of `WORKSPACE` env — this is
the only migration path that exists
- `push_metrics()` and `record_phase_metric()` changed from sync/spawn
to **async with `.await`** — this fixes metrics for ALL existing tests
(identity, group, message), not just migration
## Files changed
- `src/app/test.rs` — new `migration_latency_test()` + `.await` on
existing push calls
- `src/metrics.rs` — dedicated migration histogram/counters + async push
fix
- `src/args.rs` — `MigrationLatency` variant + CLI args
- `docker/entrypoint.sh` — migration test integration in loop
- `src/app/generate/{identity,groups,messages}.rs` — `.await` on push
calls (async fix)
## Verified in production
Deployed to testnet-dev ECS, two full loop iterations confirmed:
- Migration latency: **2.2s – 3.9s**, 100% success rate
- All metrics flowing to PushGateway (zero push errors)
- Identity, group, message tests all passing1 parent 2f6afaa commit 9a8d47f
7 files changed
Lines changed: 408 additions & 30 deletions
File tree
- apps/xmtp_debug
- docker
- src
- app
- generate
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
23 | 32 | | |
24 | 33 | | |
25 | 34 | | |
| |||
46 | 55 | | |
47 | 56 | | |
48 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
49 | 69 | | |
50 | 70 | | |
51 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | | - | |
| 103 | + | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| |||
207 | 209 | | |
208 | 210 | | |
209 | 211 | | |
210 | | - | |
| 212 | + | |
211 | 213 | | |
212 | 214 | | |
213 | 215 | | |
| |||
261 | 263 | | |
262 | 264 | | |
263 | 265 | | |
264 | | - | |
| 266 | + | |
265 | 267 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| 90 | + | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
200 | | - | |
| 201 | + | |
| 202 | + | |
201 | 203 | | |
202 | 204 | | |
203 | 205 | | |
| |||
309 | 311 | | |
310 | 312 | | |
311 | 313 | | |
312 | | - | |
| 314 | + | |
313 | 315 | | |
314 | 316 | | |
315 | 317 | | |
| |||
334 | 336 | | |
335 | 337 | | |
336 | 338 | | |
337 | | - | |
| 339 | + | |
| 340 | + | |
338 | 341 | | |
339 | 342 | | |
340 | 343 | | |
| |||
349 | 352 | | |
350 | 353 | | |
351 | 354 | | |
352 | | - | |
| 355 | + | |
| 356 | + | |
353 | 357 | | |
354 | 358 | | |
355 | 359 | | |
| |||
375 | 379 | | |
376 | 380 | | |
377 | 381 | | |
378 | | - | |
| 382 | + | |
| 383 | + | |
379 | 384 | | |
380 | 385 | | |
381 | 386 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
| 324 | + | |
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| |||
0 commit comments