Gerrit FE2BE log records correlation

103 views
Skip to first unread message

Володимир Перловський

unread,
Jan 20, 2025, 7:39:48 AM1/20/25
to Repo and Gerrit Discussion
Hello Community,

    Our current Gerrit setup is including HAProxy as Frontend (FE) and
as a Backend (BE) we are using Gerrit server accordingly.
   Very often we were faced with the need to match the client session on the FE with the session on BE in logs from both.
    Since we are using multiple FE's and BE's instances, often, such task
becomes non-trivial.
    The logs (FE to BE) correlation by timestamp is also does not always give a result.
As far as I know, you can add a unique session identifier to the HAProxy logs.
    The question is can this identifier be transferred to Gerrit and then added
to the entry in the Gerrit log?
Perhaps you know other possibilities to solve this task?


Best Regards,
Volodymyr

Володимир Перловський

unread,
Jan 31, 2025, 7:46:38 AM1/31/25
to Repo and Gerrit Discussion
Hello Saša,
   This it is a must-have feature.
Let me clarify, this feature allows you to write 
TRACE_ID
which identifies each client session and also do correlation between log entries 
on FE and BE using TRACE_ID?
And it also means that we can write TRACE_ID to HAProxy log? 

Thank you!

Kind Regards,
Volodymyr   


пн, 20 січ. 2025 р. о 14:39 Володимир Перловський <volodymyr....@gmail.com> пише:
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/83acc496-2bb7-487d-97e2-a6c7efc5e421n%40googlegroups.com.


--
Best regards
Perlovskyi Volodymyr

Saša Živkov

unread,
Jan 31, 2025, 4:19:09 PM1/31/25
to Володимир Перловський, Repo and Gerrit Discussion
On Fri, Jan 31, 2025 at 1:46 PM Володимир Перловський <volodymyr....@gmail.com> wrote:
Hello Saša,
   This it is a must-have feature.
Let me clarify, this feature allows you to write 
TRACE_ID
which identifies each client session and also do correlation between log entries 
on FE and BE using TRACE_ID?
And it also means that we can write TRACE_ID to HAProxy log? 

I don't really know how haproxy logging works but here is how it could work:
* the TRACE_ID is usually generated on the Gerrit server side. This means that haproxy cannot read it from the request
* the TRACE_ID is sent back to the client usually in the X-Gerrit-Trace response header. Maybe haproxy can read it from that response header and include in the log?

Volodymyr Perlovskyi

unread,
Feb 14, 2025, 10:22:33 AM2/14/25
to Saša Živkov, Repo and Gerrit Discussion
Hello Saša,

I have to check this:
* the TRACE_ID is sent back to the client usually in the X-Gerrit-Trace response header. Maybe haproxy can read it from that response header and include it in the log?

One more thing. Maybe you are aware how to make correlation based on timestamp from between BE and FE logs.
I mean what algorithm is used for this correlation?


Best Regards,
Volodymyr

Reply all
Reply to author
Forward
0 new messages