Skip to content
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

TraceQL: Sorting traces when searching from Grafana #2659

Open
actionbronson opened this issue Jul 14, 2023 · 8 comments
Open

TraceQL: Sorting traces when searching from Grafana #2659

actionbronson opened this issue Jul 14, 2023 · 8 comments
Labels
enhancement New feature or request keepalive Label to exempt Issues / PRs from stale workflow traceql

Comments

@actionbronson
Copy link

actionbronson commented Jul 14, 2023

Is your feature request related to a problem? Please describe.
When searching tempo from Grafana, I'd like to be able to sort the returned traces by duration

Describe the solution you'd like
A proposed sorting mechanism, e.g. duration or count.

Describe alternatives you've considered
None

Additional context
I'm unsure if this is a Grafana problem at the presentation layer or a Tempo problem.

@joe-elliott
Copy link
Member

Howdy, thanks for the request.

I'm unsure if this is a Grafana problem at the presentation layer or a Tempo problem

I suppose it depends on what the real need is here. Currently Tempo's search results are non deterministic. If you choose a 24 hour window it will return the first N results that happen to match the query.

If you want to be able to explicitly retrieve the first N results in the specified time range in time order then we would need to make changes to deterministically search the Tempo backend.

If you want to just have a sortable table in Grafana with the results you are getting back then this would be a frontend/Grafana feature request.

WDYT?

@actionbronson
Copy link
Author

actionbronson commented Jul 17, 2023 via email

@joe-elliott
Copy link
Member

So this would be difficult to do generically, but not impossible. For a given time range we would always have to do a completely exhaustive search and then pass all results up to the query frontend to do the sorting and return the requested number of traces.

Specifically start time would be a deterministic version of the search that always returned the N most recent traces which we have considered in the past. This would be a bit easier b/c we could use the block time ranges to not perform a completely exhaustive search.

I'm not opposed to this feature, and will tag it so it stays on our radar, but I do think this is a back burner item.

@joe-elliott joe-elliott added enhancement New feature or request keepalive Label to exempt Issues / PRs from stale workflow traceql labels Jul 18, 2023
@github-actions
Copy link
Contributor

This issue has been automatically marked as stale because it has not had any activity in the past 60 days.
The next time this stale check runs, the stale label will be removed if there is new activity. The issue will be closed after 15 days if there is no new activity.
Please apply keepalive label to exempt this Issue.

@github-actions github-actions bot added stale Used for stale issues / PRs and removed stale Used for stale issues / PRs labels Oct 12, 2023
@swar8080
Copy link

+1 for the ability to sort by duration

We have a dashboard to explore latency issues for a specific span, so it'd be nice to display the longest duration traces in the dashboard's time range

@ADavis11
Copy link

We have a dashboard to explore latency issues for a specific span, so it'd be nice to display the longest duration traces in the dashboard's time range

We have the same thing in our env and would love an option to get the longest durations.

@peterdk
Copy link

peterdk commented Jun 30, 2024

Same issue here, I notice that my overview of the last hour Tempo traces in Grafana doesn't display latest results, but apparently random results from the selected timeframe (1 hour). I would prefer a order by time desc or similar solution in the TraceQL query.

@Chaofan1014
Copy link

Chaofan1014 commented Dec 9, 2024

I am currently facing the same issue. It would be great if TraceQL supported sorting by duration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request keepalive Label to exempt Issues / PRs from stale workflow traceql
Projects
None yet
Development

No branches or pull requests

6 participants