Commit ccfb11b3 authored by Jacob Vosmaer's avatar Jacob Vosmaer

Group metric update calls

parent b37097c9
...@@ -88,10 +88,10 @@ func (s *sendDataResponseWriter) tryInject() bool { ...@@ -88,10 +88,10 @@ func (s *sendDataResponseWriter) tryInject() bool {
for _, injecter := range s.injecters { for _, injecter := range s.injecters {
if injecter.Match(header) { if injecter.Match(header) {
s.hijacked = true s.hijacked = true
sendDataResponses.WithLabelValues(injecter.Name()).Inc()
helper.DisableResponseBuffering(s.rw) helper.DisableResponseBuffering(s.rw)
crw := helper.NewCountingResponseWriter(s.rw) crw := helper.NewCountingResponseWriter(s.rw)
injecter.Inject(crw, s.req, header) injecter.Inject(crw, s.req, header)
sendDataResponses.WithLabelValues(injecter.Name()).Inc()
sendDataResponseBytes.WithLabelValues(injecter.Name()).Add(float64(crw.Count())) sendDataResponseBytes.WithLabelValues(injecter.Name()).Add(float64(crw.Count()))
return true return true
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment