Skip to content

Commit

Permalink
sort CH summary in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tsukanov-as committed Dec 26, 2023
1 parent ad42f38 commit aad3e13
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions helper/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"net"
"net/http"
"net/url"
"sort"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -325,6 +326,9 @@ func reader(ctx context.Context, dsn string, query string, postBody io.Reader, e
read_bytes, _ = strconv.ParseInt(v, 10, 64)
}
}
sort.Slice(fields, func(i int, j int) bool {
return fields[i].Key < fields[j].Key
})
logger = logger.With(fields...)
} else {
logger.Warn("query", zap.Error(err), zap.String("clickhouse-summary", summaryHeader))
Expand Down

0 comments on commit aad3e13

Please sign in to comment.