Skip to content

Commit

Permalink
fix: return partial results for multiple targets (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
burningalchemist authored Sep 20, 2023
1 parent 2f6e229 commit 5e5096e
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions cmd/sql_exporter/promhttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,13 @@ func ExporterHandlerFor(exporter sql_exporter.Exporter) http.Handler {
if err != nil {
if errors.Is(err, context.DeadlineExceeded) {
klog.Errorf("Timeout collecting metrics from target: %s", err)
http.Error(w, "Timeout collecting metrics from target, "+err.Error(), http.StatusInternalServerError)
return
}
if len(mfs) == 0 {
klog.Errorf("No metrics gathered: %s", err)
http.Error(w, "No metrics gathered, "+err.Error(), http.StatusInternalServerError)
return
}
klog.Errorf("Error gathering metrics: %s", err)
http.Error(w, "Error gathering metrics, "+err.Error(), http.StatusInternalServerError)
return
}

contentType := expfmt.Negotiate(req.Header)
Expand Down

0 comments on commit 5e5096e

Please sign in to comment.