I’m moving the discussion from the GitHub issue back into the forum, because I think this still requires some more abstract deliberation.
I wonder whether such a feature should be part of Parse Server, because a request begins from a recipient perspective as soon as it reaches your infrastructure public gateway, and that’s way before Parse Server. The request may even never reach Parse Server, but the client still gets a response. That means that a request ID that is assigned by Parse Server will always leave you with an incomplete trace.
The usual approach is to assign a request ID early in your infrastructure, ideally already at the gateway. If you want to start even earlier, you can add a UUID on the client side and send it as part of the request, so you have it even at the client side and the user can tell you the request ID for you to troubleshoot. You could look into the Idempotency feature of Parse Server, which makes the client SDK send a UUID with a request, maybe you can repurpose that for logging. I don’t think assigning a request UUID beginning at Parse Server has a practical application in a professional production environment.
For example, you can add a AWS ALB trace ID, which adds a request header to a request beginning at the ALB. This trace ID will be available as header in Cloud Code requests and it should be possible to output that to the logger, or even append it to a ParseObject. I think @xeoshow’s question can be simplified as how to log a request http header in the Parse Server logs, which I think is easily solvable and I think actually already done by default.
If the request UUID should be sent from the client with every request, a PR in the SDK could be a solution that allows to add custom header with every request, possibly as a callback option during SDK initialisation.
A more professional approach is to use a trace tool like NewRelic or netdata which gives a 360° view, including the client, the server and any infrastructure component in between, combined with respective resource and performance data.