Commit 4b2eff7
Add more WAL metrics (#3685)
Adding a bunch of WAL metrics in hopes of better seeing the impact of
deployment on a busy instance.
`pg_stat_activity.wait_event_type/wait_event` for our backend: these are
really the source of truth on when the wal sender becomes idle
(`wait_event_type=Client, wait_event= WalSenderWaitForWAL`) because
there's nothing to send (even if the current lsn is ahead of what was
sent to us because of an unfinished transaction). However, it also can
change many times a second and polling once every few minutes is pretty
sparse. Putting it in in case it's still useful.
Commit LSN on the receiver - the latest we've received from Postgres so
far
`pg_stat_replication.sent_lsn` - we don't always have permission to read
this one but saw some discrepancies with commit LSN so keeping as
optional for debugging purposes
Current LSN - to diff with commit LSN
Deltas between PG-side LSNs, just for convenience
`pg_stat_replication_slots.spill_txns/spill_count/spill_bytes` (PG16+),
`logical_decoding_work_mem` (PG13+) - to see what the PG is doing after
reconnect and before it sent anything to us, and be able to diagnose bad
setting
---
Misc quality of life metrics:
`pg_replication_slots.safe_wal_size` (PG13+) - monitor danger zone when
we're behind or there's a burst
`pg_replication_slots.active/wal_status`, `pg_stat_activity.state`
---------
Co-authored-by: Copilot <[email protected]>1 parent 81d02ea commit 4b2eff7
File tree
7 files changed
+386
-75
lines changed- flow
- activities
- connectors/postgres
- otel_metrics
- protos
7 files changed
+386
-75
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1191 | 1191 | | |
1192 | 1192 | | |
1193 | 1193 | | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
1194 | 1207 | | |
1195 | 1208 | | |
1196 | 1209 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
881 | 881 | | |
882 | 882 | | |
883 | 883 | | |
| 884 | + | |
884 | 885 | | |
885 | 886 | | |
886 | 887 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | 281 | | |
289 | 282 | | |
290 | 283 | | |
291 | 284 | | |
292 | | - | |
| 285 | + | |
| 286 | + | |
293 | 287 | | |
294 | | - | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
295 | 318 | | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
301 | 367 | | |
302 | 368 | | |
303 | 369 | | |
304 | 370 | | |
305 | 371 | | |
306 | 372 | | |
307 | | - | |
308 | 373 | | |
| 374 | + | |
309 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
310 | 379 | | |
| 380 | + | |
311 | 381 | | |
312 | 382 | | |
313 | | - | |
314 | | - | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
315 | 416 | | |
316 | 417 | | |
317 | 418 | | |
318 | 419 | | |
319 | 420 | | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
327 | 441 | | |
328 | 442 | | |
329 | 443 | | |
| |||
0 commit comments