Skip to content
Snippets Groups Projects
Commit ccfb11b3 authored by Jacob Vosmaer (GitLab)'s avatar Jacob Vosmaer (GitLab)
Browse files

Group metric update calls

parent b37097c9
No related branches found
No related tags found
1 merge request!163Prometheus metrics for senddata and git archive cache
Pipeline #
Loading
Loading
@@ -88,10 +88,10 @@ func (s *sendDataResponseWriter) tryInject() bool {
for _, injecter := range s.injecters {
if injecter.Match(header) {
s.hijacked = true
sendDataResponses.WithLabelValues(injecter.Name()).Inc()
helper.DisableResponseBuffering(s.rw)
crw := helper.NewCountingResponseWriter(s.rw)
injecter.Inject(crw, s.req, header)
sendDataResponses.WithLabelValues(injecter.Name()).Inc()
sendDataResponseBytes.WithLabelValues(injecter.Name()).Add(float64(crw.Count()))
return true
}
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment