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:
parent
382db4245a
commit
25faf5ab60
2 changed files with 0 additions and 20 deletions
|
|
@ -3,11 +3,8 @@ package v2
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4"
|
||||||
|
|
||||||
"github.com/osbuild/osbuild-composer/internal/prometheus"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -302,13 +299,6 @@ func (s *Server) HTTPErrorHandler(echoError error, c echo.Context) {
|
||||||
return
|
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)
|
err, ok := he.Message.(detailsError)
|
||||||
if !ok {
|
if !ok {
|
||||||
// No service code was set, so Echo threw this error
|
// No service code was set, so Echo threw this error
|
||||||
|
|
|
||||||
|
|
@ -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 (
|
var (
|
||||||
ComposeRequests = promauto.NewCounter(prometheus.CounterOpts{
|
ComposeRequests = promauto.NewCounter(prometheus.CounterOpts{
|
||||||
Name: "total_compose_requests",
|
Name: "total_compose_requests",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue