mirror of
https://github.com/willnorris/imageproxy.git
synced 2024-12-16 21:56:43 -05:00
8484518c93
Fixes #121
33 lines
995 B
Go
33 lines
995 B
Go
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)
|
|
}
|