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.
This commit is contained in:
Gianluca Zuccarelli 2023-01-10 12:35:50 +00:00 committed by Sanne Raymaekers
parent 382db4245a
commit 25faf5ab60
2 changed files with 0 additions and 20 deletions

View file

@ -3,11 +3,8 @@ package v2
import (
"fmt"
"net/http"
"strings"
"github.com/labstack/echo/v4"
"github.com/osbuild/osbuild-composer/internal/prometheus"
)
const (
@ -302,13 +299,6 @@ func (s *Server) HTTPErrorHandler(echoError error, c echo.Context) {
return
}
internalError := he.Code >= http.StatusInternalServerError && he.Code <= http.StatusNetworkAuthenticationRequired
if internalError {
if strings.HasSuffix(c.Path(), "/compose") {
prometheus.ComposeFailures.Inc()
}
}
err, ok := he.Message.(detailsError)
if !ok {
// No service code was set, so Echo threw this error

View file

@ -14,16 +14,6 @@ var (
})
)
var (
// update this to count all 500s
ComposeFailures = promauto.NewCounter(prometheus.CounterOpts{
Name: "total_failed_compose_requests",
Namespace: Namespace,
Subsystem: ComposerSubsystem,
Help: "total number of failed compose requests",
})
)
var (
ComposeRequests = promauto.NewCounter(prometheus.CounterOpts{
Name: "total_compose_requests",