Skip to content

Commit

Permalink
internal/prometheus: remove compose fail metrics
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
kingsleyzissou authored and croissanne committed Jan 12, 2023
1 parent 382db42 commit 25faf5a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
10 changes: 0 additions & 10 deletions internal/cloudapi/v2/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ package v2
import (
"fmt"
"net/http"
"strings"

"github.com/labstack/echo/v4"

"github.com/osbuild/osbuild-composer/internal/prometheus"
)

const (
Expand Down Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions internal/prometheus/http_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 25faf5a

Please sign in to comment.