Compare commits

...

2 Commits

Author SHA1 Message Date
Srikanth Chekuri
cd5df748d8 chore: less spam 2025-03-19 08:11:46 +05:30
Srikanth Chekuri
9e6e550723 chore: change log level to reduce noise 2025-03-19 07:45:54 +05:30
6 changed files with 14 additions and 12 deletions

View File

@@ -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
}

View File

@@ -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 ""
}
}

View File

@@ -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
}

View File

@@ -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 ""
}
}

View File

@@ -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
}

View File

@@ -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 ""
}
}