Extract the last time activity for ChatOps queries
Goal
Clones do not account for user chat activity and are being removed after the standard duration timeout because the clone logs don't contain a statement
label. For example,
2021-03-25 03:31:46.519 UTC,"joe_56","test_small",85,"195.201.198.254:57620",605c0422.55,3,"PARSE",2021-03-25 03:31:46 UTC,4/48,0,LOG,00000,"duration: 0.560 ms parse lrupsc_34_0: EXPLAIN (FORMAT TEXT) s
elect 1;",,,,,,,,,""
2021-03-25 03:31:46.520 UTC,"joe_56","test_small",85,"195.201.198.254:57620",605c0422.55,4,"BIND",2021-03-25 03:31:46 UTC,4/49,0,LOG,00000,"duration: 0.040 ms bind lrupsc_34_0: EXPLAIN (FORMAT TEXT) sel
ect 1;",,,,,,,,,""
2021-03-25 03:31:46.520 UTC,"joe_56","test_small",85,"195.201.198.254:57620",605c0422.55,5,"EXPLAIN",2021-03-25 03:31:46 UTC,4/49,0,LOG,00000,"duration: 0.436 ms execute lrupsc_34_0: EXPLAIN (FORMAT TEX
T) select 1;",,,,,,,,,""
So, a user gets an error:
ERROR: failed to connect to host=localhost user=joe database=dblab:
server error (FATAL: password authentication failed for user "joe" (SQLSTATE 28P01))
Fix the PostgreSQL log parser to detect idleness properly.
TODO / How to implement
Acceptance criteria
Edited by Artyom Kartasov