mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-16 18:55:56 +08:00
fix: remove the top 10 limit on key operations table (#2824)
Co-authored-by: Vishal Sharma <makeavish786@gmail.com>
This commit is contained in:
parent
a3c917cca0
commit
a52c104562
@ -1870,14 +1870,18 @@ func (r *ClickHouseReader) GetTopOperations(ctx context.Context, queryParams *mo
|
||||
if errStatus != nil {
|
||||
return nil, errStatus
|
||||
}
|
||||
query += " GROUP BY name ORDER BY p99 DESC LIMIT 10"
|
||||
query += " GROUP BY name ORDER BY p99 DESC"
|
||||
if queryParams.Limit > 0 {
|
||||
query += " LIMIT @limit"
|
||||
args = append(args, clickhouse.Named("limit", queryParams.Limit))
|
||||
}
|
||||
err := r.db.Select(ctx, &topOperationsItems, query, args...)
|
||||
|
||||
zap.S().Debug(query)
|
||||
|
||||
if err != nil {
|
||||
zap.S().Error("Error in processing sql query: ", err)
|
||||
return nil, &model.ApiError{Typ: model.ErrorExec, Err: fmt.Errorf("Error in processing sql query")}
|
||||
return nil, &model.ApiError{Typ: model.ErrorExec, Err: fmt.Errorf("error in processing sql query")}
|
||||
}
|
||||
|
||||
if topOperationsItems == nil {
|
||||
|
@ -160,6 +160,7 @@ type GetTopOperationsParams struct {
|
||||
Start *time.Time
|
||||
End *time.Time
|
||||
Tags []TagQueryParam `json:"tags"`
|
||||
Limit int `json:"limit"`
|
||||
}
|
||||
|
||||
type GetUsageParams struct {
|
||||
|
Loading…
x
Reference in New Issue
Block a user