Skip to content

Commit

Permalink
fix(supermicro): ignore when pre-actions fail and continue with expor…
Browse files Browse the repository at this point in the history
…ting metrics

Note: Some vendors do have invalid JSON responses for that endpoints used, we don't want to handle these at the moment since we are relaying on external libraries for this.
  • Loading branch information
BirknerAlex committed Jun 6, 2024
1 parent 2be5468 commit 6941428
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/metric/handler.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package metric

import (
"fmt"
"log"
"net/http"

Expand Down Expand Up @@ -32,10 +31,7 @@ func Handle(ctx *gin.Context) {
// Execute pre actions
for _, action := range config.GetConfig().PreActions {
if err = actions.Execute(action, client); err != nil {
ctx.JSON(http.StatusInternalServerError,
gin.H{"error": fmt.Errorf("error executing pre action %q: %w", action, err).Error()})

return
log.Printf("error executing pre action %q: %v", action, err)
}
}

Expand Down

0 comments on commit 6941428

Please sign in to comment.