debian-forge-composer/internal/prometheus/http_metrics.go
Gianluca Zuccarelli 25faf5ab60 internal/prometheus: remove compose fail metrics
We have switched how 5xx errors are being recorded
internally and we are now recording all failures
for all endpoints. As a result, a dedicated metric
only for compose failures is no longer required.
2023-01-12 12:55:01 +01:00

34 lines
956 B
Go

package prometheus
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
TotalRequests = promauto.NewCounter(prometheus.CounterOpts{
Name: "total_requests",
Namespace: Namespace,
Subsystem: ComposerSubsystem,
Help: "total number of http requests made to osbuild-composer",
})
)
var (
ComposeRequests = promauto.NewCounter(prometheus.CounterOpts{
Name: "total_compose_requests",
Namespace: Namespace,
Subsystem: ComposerSubsystem,
Help: "total number of compose requests made to osbuild-composer",
})
)
var (
httpDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
Name: "http_duration_seconds",
Namespace: Namespace,
Subsystem: ComposerSubsystem,
Help: "Duration of HTTP requests.",
Buckets: []float64{.025, .05, .075, .1, .2, .5, .75, 1, 1.5, 2, 3, 4, 5, 6, 8, 10, 12, 14, 16, 20},
}, []string{"path"})
)