-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SLT-152] feat(opbot): descending traces timestamp support #3092
Changes from 3 commits
983dd48
a25e2b5
b6472d7
c64526f
15f48b2
b0337ac
3d6f64e
b39d3d8
dbdd179
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
"log" | ||
"math/big" | ||
"regexp" | ||
"sort" | ||
"strings" | ||
"sync" | ||
"time" | ||
|
@@ -50,7 +51,7 @@ | |
// TODO: add trace middleware. | ||
func (b *Bot) traceCommand() *slacker.CommandDefinition { | ||
return b.requiresSignoz(&slacker.CommandDefinition{ | ||
Command: "trace <tags>", | ||
Command: "trace <tags> <order>", | ||
Description: "find a transaction in signoz", | ||
Examples: []string{ | ||
"trace transaction_id:0x1234 serviceName:rfq", | ||
|
@@ -105,6 +106,12 @@ | |
} | ||
return | ||
} | ||
isDescending := ctx.Request().Param("order") == "desc" || ctx.Request().Param("order") == "d" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM! The code change to introduce the Consider adding test coverage. The static analysis tool indicates that this line is not covered by tests. Do you want me to generate test cases for this line or open a GitHub issue to track this task? ToolsGitHub Check: codecov/patch
|
||
if isDescending { | ||
sort.Slice(traceList, func(i, j int) bool { | ||
return traceList[i].Timestamp.After(traceList[j].Timestamp) | ||
}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM! The code changes to sort the Consider adding test coverage. The static analysis tool indicates that these lines are not covered by tests. Do you want me to generate test cases for these lines or open a GitHub issue to track this task? ToolsGitHub Check: codecov/patch
|
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM! The code changes to sort the Consider adding test coverage. The static analysis tool indicates that these lines are not covered by tests. Do you want me to generate test cases for these lines or open a GitHub issue to track this task? ToolsGitHub Check: codecov/patch
|
||
|
||
slackBlocks := []slack.Block{slack.NewHeaderBlock(slack.NewTextBlockObject(slack.PlainTextType, fmt.Sprintf("Traces for %s", tags), false, false))} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The code change to introduce the
<order>
parameter is approved.Consider adding test coverage.
The static analysis tool indicates that this line is not covered by tests.
Do you want me to generate test cases for this line or open a GitHub issue to track this task?
Tools
GitHub Check: codecov/patch