Skip to content

Commit

Permalink
Use error code
Browse files Browse the repository at this point in the history
  • Loading branch information
rxdn committed Oct 19, 2024
1 parent 26b47db commit adb2ea3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bot/metrics/prometheus/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package prometheus
import (
"context"
"encoding/json"
"fmt"
"github.com/rxdn/gdl/rest/request"
"net/http"
"strconv"
Expand Down Expand Up @@ -35,6 +36,6 @@ func PostRequestHook(res *http.Response, body []byte) {
return
}

DiscordApiErrors.WithLabelValues(strconv.Itoa(res.StatusCode), apiError.Message).Inc()
DiscordApiErrors.WithLabelValues(strconv.Itoa(res.StatusCode), fmt.Sprintf("%s", apiError.Code)).Inc()
}
}

0 comments on commit adb2ea3

Please sign in to comment.