I work on developing datasource plugin, the point of interest is that I need to manage a lot of data, so it’s reasonable to sorting on server side or data source, not in table.
Is there a way to implement server-side sorting? Or apply sorting through transformations?
Thank you in advance!
Hi @ytsikhanava you can do both. If you are developing your datasource in go, you can do the sorting on the dataframes you return or you can use the transformations to sort it.
Thank you for response, about transformations it’s clear.
I would like to clarify one part about server-side sorting. Is there able to trigger running query from standard grafana?
Like I have my datasource and use it in Grafana table panel. I click table header to sort column. And when this click is done, it doesn’t call client-side sorting, but make a /query call for datasource with this sorting and than render data from this response.
Is it possible? Or should I develop my own table to have this behavior?
I didn’t understand this part of your question.
I have my datasource and use it in Grafana table panel. I click table header to sort column. And when this click is done, it doesn’t call client-side sorting, but m
Not that I am aware. This is handled by grafana iteslf.
I didn’t understand this part of your question
Sorry, there were missed a word. Here I mean if I could trigger running query not by clicking “Run query” button or wait until it’s done in five seconds but by push some panels to do this on action applied for them.
As in example about I’m wondering if it’s possible to make standard grafana table panel makes a request to run query with sorting on server side than sort everything on client.
Or there is no posibility to configure grafana table panel in this way and to achieve this behavior I should develop new component?
Datasource plugins can’t influence how panels behave, only the data they contain. You’ll need a custom panel for this.
I still don’t understand your use case correctly. Maybe you can explain it once more?
I have Grafana table panel that is connected to my custom data source and I click on column header for sorting.
Current Grafana table sorts on client. I would like it to not do sort itself but prepare sort information and send /query request with current request + sorting.
So don’t ask panel to sort, but make a /query request with data
I see. Then that is not possible. Sorting is made in the browser in most panels. You’d require a special panel that instead of sorting directly sends the request to the datasource.