grafana / loki

Like Prometheus, but for logs.
https://grafana.com/loki
GNU Affero General Public License v3.0
23.96k stars 3.46k forks source link

fix: show 200 status code for successful queries #14175

Closed trevorwhitney closed 2 months ago

trevorwhitney commented 2 months ago

What this PR does / why we need it:

This change in #10956 broke the status code reporting in the metrics.go line from our queriers. In the case where error was nil, it produces a 500. Previously, when error was nil, it produced a 200.

This PR fixes that behavior, reporting a 200 status unless there is a problem.

trevorwhitney commented 2 months ago

@ashwanthgoli I like yours better, closing in favor of https://github.com/grafana/loki/pull/12102

trevorwhitney commented 2 months ago

nevermind, we still need it in engine.go

trevorwhitney commented 2 months ago

nevermind again, I can't read