mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-05-18 00:05:14 +02:00
parent
2eb6dfcd05
commit
8484518c93
6 changed files with 114 additions and 7 deletions
33
metrics.go
Normal file
33
metrics.go
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
package imageproxy
|
||||
|
||||
import (
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
)
|
||||
|
||||
var (
|
||||
requestServedFromCacheCount = prometheus.NewCounter(
|
||||
prometheus.CounterOpts{
|
||||
Name: "requests_served_from_cache",
|
||||
Help: "Number of requests served from cache.",
|
||||
})
|
||||
imageTransformationSummary = prometheus.NewSummary(prometheus.SummaryOpts{
|
||||
Name: "image_transformation_seconds",
|
||||
Help: "Time taken for image transformations in seconds.",
|
||||
})
|
||||
remoteImageFetchErrors = prometheus.NewCounter(prometheus.CounterOpts{
|
||||
Name: "remote_image_fetch_errors",
|
||||
Help: "Total image fetch failures",
|
||||
})
|
||||
httpRequestsResponseTime = prometheus.NewSummary(prometheus.SummaryOpts{
|
||||
Namespace: "http",
|
||||
Name: "response_time_seconds",
|
||||
Help: "Request response times",
|
||||
})
|
||||
)
|
||||
|
||||
func init() {
|
||||
prometheus.MustRegister(imageTransformationSummary)
|
||||
prometheus.MustRegister(requestServedFromCacheCount)
|
||||
prometheus.MustRegister(remoteImageFetchErrors)
|
||||
prometheus.MustRegister(httpRequestsResponseTime)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue