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:
parent
851a3437ff
commit
bed786372f
@ -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
|
||||
|
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user