Add response time unit in json logs
Describe the bug Right now json logs dont have the unit for the response time, latency etc but the prettyprinted logs in terminal do have, JSON logs should also have the unit to make it pretty clear for debugging purpose.
Moreover an extension to this would be keeping consistent unit across, but this needs to be thought throughly as gofr has different units, it would be for a reason.
Can you define the scope that needs to be edited, I don't clearly understand but i want to contribute here again, sorry
What purpose does this serve given we already have metrics ?
@0xEbrahim we need to first decide if we want to do this as its in triage phase right now.
@gizmo-rt
- Parity between json and terminal logs
- Metrics bucket are capped at 30 seconds, so any response time above that comes in 30s only.
take
Parity between logs is fine, though if it is solely due to metrics bucket cap then we should explore making https://github.com/gofr-dev/gofr/blob/4e9dd129983c5e5c0a6d093b863c42730a300a62/pkg/gofr/container/container.go#L262 configurable for users
Parity between logs is fine
we dont have unit of time in json logs but we have them in terminal pretty printed logs
Hi @aryanmehrotra! I’ve opened a PR to add human-readable response time units to the JSON logs while keeping the existing numeric field for backward compatibility. This improves parity between JSON logs and the pretty-printed terminal logs, and aligns with the discussion in the related issue. Whenever you get a moment, could you please review it?