1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-01-23 11:14:48 +02:00

Fix requests_total counter in prometheus

This commit is contained in:
DarthSim 2021-11-12 23:46:19 +06:00
parent 851a3437ff
commit bed786372f
2 changed files with 6 additions and 6 deletions

View File

@ -15,6 +15,7 @@
### Fix
- Fix Client Hints behavior. `Width` is physical size, so we should divide it by `DPR` value.
- Fix scale-on-load in some rare cases.
- Fix `requests_total` counter in Prometheus.
## [3.0.0.beta1] - 2021-10-01
### Added

View File

@ -119,6 +119,11 @@ func StartServer(cancel context.CancelFunc) error {
}
func StartRequest() context.CancelFunc {
if !enabled {
return func() {}
}
requestsTotal.Inc()
return startDuration(requestDuration)
}
@ -147,12 +152,6 @@ func IncrementErrorsTotal(t string) {
}
}
func IncrementRequestsTotal() {
if enabled {
requestsTotal.Inc()
}
}
func ObserveBufferSize(t string, size int) {
if enabled {
bufferSize.With(prometheus.Labels{"type": t}).Observe(float64(size))