miekg / caddy-prometheus

Prometheus metrics middleware for caddy
Apache License 2.0
65 stars 26 forks source link

Need access the response size #1

Closed miekg closed 8 years ago

miekg commented 8 years ago

I have no idea how to get the response size so we can export this.

captncraig commented 8 years ago

caddy has a ResponseRecorder type that can capture the status code and response size. https://github.com/mholt/caddy/blob/master/middleware/recorder.go#L17

Would be nice to capture raw throughput at the tcp layer rather than http, but bodies is what a middleware can do on its own.

miekg commented 8 years ago

oh, nice. That looks to be real easy to use, would also fix #5 (I think)

Thanks!