Skip to content

Commit

Permalink
query-frontend: Handling logging for code 3xx (#3181)
Browse files Browse the repository at this point in the history
* added info level logging for code [300-400)

Signed-off-by: aribalam <arib.alam.iitkgp@gmail.com>

* changed to debug level for responses between [200, 500)

Signed-off-by: aribalam <arib.alam.iitkgp@gmail.com>

* updated changelog

Signed-off-by: aribalam <arib.alam.iitkgp@gmail.com>

* changed changelog title

Signed-off-by: aribalam <arib.alam.iitkgp@gmail.com>
  • Loading branch information
aribalam authored Sep 18, 2020
1 parent 727a351 commit 5f5b15e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re

### Added

- [#3181](https://github.com/thanos-io/thanos/pull/3181) Logging: Add debug level logging for responses between 300-399
- [#3133](https://github.com/thanos-io/thanos/pull/3133) Query: Allow passing a `storeMatch[]` to Labels APIs. Also time range metadata based store filtering is supported on Labels APIs.
- [#3154](https://github.com/thanos-io/thanos/pull/3154) Query Frontend: Add metric `thanos_memcached_getmulti_gate_queries_max`.
- [#3146](https://github.com/thanos-io/thanos/pull/3146) Sidecar: Add `thanos_sidecar_prometheus_store_received_frames` histogram metric.
Expand Down
5 changes: 1 addition & 4 deletions pkg/logging/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,7 @@ type options struct {

// DefaultCodeToLevel is the helper mapper that maps HTTP Response codes to log levels.
func DefaultCodeToLevel(logger log.Logger, code int) log.Logger {
if code >= 200 && code < 300 {
return level.Debug(logger)
}
if code >= 400 && code < 500 {
if code >= 200 && code < 500 {
return level.Debug(logger)
}
return level.Error(logger)
Expand Down

0 comments on commit 5f5b15e

Please sign in to comment.