Update audit log flow to use new headers with unit (#16797)

This commit is contained in:
Nitish Tiwari
2023-03-14 11:20:19 +05:30
committed by GitHub
parent c2f9cc5824
commit 50dbd2cacc
3 changed files with 23 additions and 7 deletions

View File

@@ -137,10 +137,12 @@ func AuditLog(ctx context.Context, w http.ResponseWriter, r *http.Request, reqCl
entry.API.OutputBytes = outputBytes
entry.API.HeaderBytes = headerBytes
entry.API.TimeToResponse = strconv.FormatInt(timeToResponse.Nanoseconds(), 10) + "ns"
entry.API.TimeToResponseInNS = strconv.FormatInt(timeToResponse.Nanoseconds(), 10)
entry.Tags = reqInfo.GetTagsMap()
// ttfb will be recorded only for GET requests, Ignore such cases where ttfb will be empty.
if timeToFirstByte != 0 {
entry.API.TimeToFirstByte = strconv.FormatInt(timeToFirstByte.Nanoseconds(), 10) + "ns"
entry.API.TimeToFirstByteInNS = strconv.FormatInt(timeToFirstByte.Nanoseconds(), 10)
}
} else {
auditEntry := GetAuditEntry(ctx)