Skip to content

Commit

Permalink
fix: update order by logic
Browse files Browse the repository at this point in the history
  • Loading branch information
nityanandagohain committed Nov 13, 2024
1 parent 097a54b commit 2698097
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/query-service/app/traces/v4/query_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func orderByAttributeKeyTags(panelType v3.PanelType, items []v3.OrderBy, tags []
if len(orderByArray) == 0 {
if panelType == v3.PanelTypeList {
orderByArray = append(orderByArray, constants.TIMESTAMP+" DESC")
} else if panelType == v3.PanelTypeGraph {
} else {
orderByArray = append(orderByArray, "value DESC")
}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/query-service/app/traces/v4/query_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ func Test_orderByAttributeKeyTags(t *testing.T) {
items: []v3.OrderBy{{ColumnName: "timestamp", Order: "DESC"}},
tags: []v3.AttributeKey{},
},
want: "",
want: "value DESC",
},
{
name: "add default order by ts for list panel",
Expand All @@ -376,7 +376,7 @@ func Test_orderByAttributeKeyTags(t *testing.T) {
items: []v3.OrderBy{},
tags: []v3.AttributeKey{},
},
want: "",
want: "value DESC",
},
}
for _, tt := range tests {
Expand Down

0 comments on commit 2698097

Please sign in to comment.