I want to track API Requests but not just the URL but also the size of the answer in eg bytes
Therefore, my first idea was to just spam into a db table all the requests like
Request | Size | Time
get_user | 1024 | ...
So, probably I need to like stringent every answer right? Is there any good way of doing that and also, where can I have this code to not put this into every API controller? Middleware?
Using "REQUEST_TIME" shows only the timestamp when the request started ... is there any way to calculate the full time of the request from start to finish or .. sadly the "CONTENT_LENGTH" is not giving me any results when using GET requests.