Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: show 200 status code for successful queries #14175

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions cmd/loki/loki-local-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ common:
kvstore:
store: inmemory

ingester_rf1:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this appears to have been removed from the code, but was not removed from the config? I got an error on main when trying to use this config.

enabled: false

query_range:
results_cache:
cache:
Expand Down
6 changes: 5 additions & 1 deletion pkg/logql/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"errors"
"flag"
"fmt"
"net/http"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -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)
Expand Down
Loading