Skip to content

Commit

Permalink
chore: complete merge with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
hatamiarash7 committed Dec 27, 2024
1 parent 6d5bca1 commit 34bf1f9
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ func run() int {
logger := promslog.New(promslogConfig)
rh := &prober.ResultHistory{MaxResults: *historyLimit}

logLevelProberValue, _ := level.Parse(*logLevelProber)
logLevelProber := level.Allow(logLevelProberValue)

allowedLevel := &promslog.AllowedLevel{}
_ = allowedLevel.Set(*logLevelProber)

Check failure on line 83 in main.go

View workflow job for this annotation

GitHub Actions / lint

undefined: logLevelProber (typecheck)

Expand Down Expand Up @@ -188,7 +185,7 @@ func run() int {
sc.Lock()
conf := sc.C
sc.Unlock()
prober.Handler(w, r, conf, logger, rh, *timeoutOffset, nil, moduleUnknownCounter)
prober.Handler(w, r, conf, logger, rh, *timeoutOffset, nil, moduleUnknownCounter, allowedLevel)
})
http.HandleFunc(*routePrefix, func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html")
Expand Down Expand Up @@ -257,8 +254,8 @@ func run() int {
c, err := yaml.Marshal(sc.C)
sc.RUnlock()
if err != nil {
level.Warn(logger).Log("msg", "Error marshalling configuration", "err", err)
http.Error(w, err.Error(), 500)
logger.Warn("Error marshalling configuration", "err", err)
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
w.Header().Set("Content-Type", "text/plain")
Expand Down

0 comments on commit 34bf1f9

Please sign in to comment.