Compare commits
2 Commits
main
...
log-level-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cd5df748d8 | ||
|
|
9e6e550723 |
@@ -1143,7 +1143,7 @@ func (r *ClickHouseReader) GetUsage(ctx context.Context, queryParams *model.GetU
|
||||
|
||||
func (r *ClickHouseReader) SearchTracesV2(ctx context.Context, params *model.SearchTracesParams,
|
||||
smartTraceAlgorithm func(payload []model.SearchSpanResponseItem, targetSpanId string,
|
||||
levelUp int, levelDown int, spanLimit int) ([]model.SearchSpansResult, error)) (*[]model.SearchSpansResult, error) {
|
||||
levelUp int, levelDown int, spanLimit int) ([]model.SearchSpansResult, error)) (*[]model.SearchSpansResult, error) {
|
||||
searchSpansResult := []model.SearchSpansResult{
|
||||
{
|
||||
Columns: []string{"__time", "SpanId", "TraceId", "ServiceName", "Name", "Kind", "DurationNano", "TagsKeys", "TagsValues", "References", "Events", "HasError", "StatusMessage", "StatusCodeString", "SpanKind"},
|
||||
@@ -1291,7 +1291,7 @@ func (r *ClickHouseReader) SearchTracesV2(ctx context.Context, params *model.Sea
|
||||
|
||||
func (r *ClickHouseReader) SearchTraces(ctx context.Context, params *model.SearchTracesParams,
|
||||
smartTraceAlgorithm func(payload []model.SearchSpanResponseItem, targetSpanId string,
|
||||
levelUp int, levelDown int, spanLimit int) ([]model.SearchSpansResult, error)) (*[]model.SearchSpansResult, error) {
|
||||
levelUp int, levelDown int, spanLimit int) ([]model.SearchSpansResult, error)) (*[]model.SearchSpansResult, error) {
|
||||
|
||||
if r.useTraceNewSchema {
|
||||
return r.SearchTracesV2(ctx, params, smartTraceAlgorithm)
|
||||
@@ -4721,7 +4721,9 @@ func getPersonalisedError(err error) error {
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
zap.L().Error("error while reading result", zap.Error(err))
|
||||
if !errors.Is(err, context.Canceled) {
|
||||
zap.L().Error("error while reading clickhouse query result", zap.Error(err))
|
||||
}
|
||||
if strings.Contains(err.Error(), "code: 307") {
|
||||
return chErrors.ErrResourceBytesLimitExceeded
|
||||
}
|
||||
|
||||
@@ -111,11 +111,11 @@ func FormattedValue(v interface{}) string {
|
||||
case int, float32, float64, bool:
|
||||
return strings.Join(strings.Fields(fmt.Sprint(x)), ",")
|
||||
default:
|
||||
zap.L().Error("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x[0])))
|
||||
zap.L().Debug("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x[0])))
|
||||
return ""
|
||||
}
|
||||
default:
|
||||
zap.L().Error("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x)))
|
||||
zap.L().Debug("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x)))
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -566,13 +566,13 @@ func Login(ctx context.Context, request *model.LoginRequest, jwt *authtypes.JWT)
|
||||
|
||||
user, err := authenticateLogin(ctx, request, jwt)
|
||||
if err != nil {
|
||||
zap.L().Error("Failed to authenticate login request", zap.Error(err))
|
||||
zap.L().Warn("Failed to authenticate login request", zap.Error(err))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
userjwt, err := GenerateJWTForUser(&user.User, jwt)
|
||||
if err != nil {
|
||||
zap.L().Error("Failed to generate JWT against login creds", zap.Error(err))
|
||||
zap.L().Warn("Failed to generate JWT against login creds", zap.Error(err))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
||||
@@ -129,11 +129,11 @@ func exprFormattedValue(v interface{}) string {
|
||||
case uint8, uint16, uint32, uint64, int, int8, int16, int32, int64, float32, float64, bool:
|
||||
return strings.Join(strings.Fields(fmt.Sprint(x)), ",")
|
||||
default:
|
||||
zap.L().Error("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x[0])))
|
||||
zap.L().Debug("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x[0])))
|
||||
return ""
|
||||
}
|
||||
default:
|
||||
zap.L().Error("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x)))
|
||||
zap.L().Debug("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x)))
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ func (q *queryCache) MergeWithCachedSeriesDataV2(cacheKey string, newData []Cach
|
||||
cachedData, _, _ := q.cache.Retrieve(cacheKey, true)
|
||||
var existingData []CachedSeriesData
|
||||
if err := json.Unmarshal(cachedData, &existingData); err != nil {
|
||||
zap.L().Error("error unmarshalling existing data", zap.Error(err))
|
||||
zap.L().Debug("error unmarshalling existing data", zap.Error(err))
|
||||
return newData
|
||||
}
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ func ClickHouseFormattedValue(v interface{}) string {
|
||||
case uint8, uint16, uint32, uint64, int, int8, int16, int32, int64, float32, float64, bool:
|
||||
return strings.Join(strings.Fields(fmt.Sprint(x)), ",")
|
||||
default:
|
||||
zap.L().Error("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x[0])))
|
||||
zap.L().Debug("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x[0])))
|
||||
return "[]"
|
||||
}
|
||||
case []string:
|
||||
@@ -226,7 +226,7 @@ func ClickHouseFormattedValue(v interface{}) string {
|
||||
str += "]"
|
||||
return str
|
||||
default:
|
||||
zap.L().Error("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x)))
|
||||
zap.L().Debug("invalid type for formatted value", zap.Any("type", reflect.TypeOf(x)))
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user