-
Couldn't load subscription status.
- Fork 603
Open
Description
Currently, the hlog.AccessHandler middleware exposes the number of bytes written but does not surface the number of bytes read off of the request body.
As the introduction of a new field would break the AccessHandler API, I'd propose the creation of a new function that provides a struct to the callback function containing the number of read bytes as well as the existing datapoints. This will also enable future additions without breaking the interface.
package hlog
//...
type AccessHandlerNewData struct {
BytesRead int64
BytesWritten int
Status int
Duration time.Duration
Request *http.Request
}
func AccessHandlerNew(fn func(AccessHandlerNewData)) func(next http.Handler) http.Handler {}
//...Metadata
Metadata
Assignees
Labels
No labels