diff --git a/cmd/loki/loki-local-config.yaml b/cmd/loki/loki-local-config.yaml index 38efa3f6bf6e7..c593b14a252c0 100644 --- a/cmd/loki/loki-local-config.yaml +++ b/cmd/loki/loki-local-config.yaml @@ -18,9 +18,6 @@ common: kvstore: store: inmemory -ingester_rf1: - enabled: false - query_range: results_cache: cache: diff --git a/pkg/logql/engine.go b/pkg/logql/engine.go index 23c3073fb7284..8e29a0e042948 100644 --- a/pkg/logql/engine.go +++ b/pkg/logql/engine.go @@ -5,6 +5,7 @@ import ( "errors" "flag" "fmt" + "net/http" "sort" "strconv" "strings" @@ -264,7 +265,10 @@ func (q *query) Exec(ctx context.Context) (logqlmodel.Result, error) { statResult := statsCtx.Result(time.Since(start), queueTime, q.resultLength(data)) sp.LogKV(statResult.KVList()...) - status, _ := server.ClientHTTPStatusAndError(err) + status := http.StatusOK + if err != nil { + status, _ = server.ClientHTTPStatusAndError(err) + } if q.record { RecordRangeAndInstantQueryMetrics(ctx, q.logger, q.params, strconv.Itoa(status), statResult, data)