lmnr icon indicating copy to clipboard operation
lmnr copied to clipboard

Add "presets" to Datatable component

Open skull8888888 opened this issue 1 year ago • 9 comments

In Datatable component we have filters. It is really useful to save presets of this filters in the local storage so that they can be applied with one click. For instance in the traces, filter on the certain span paths can be quite handy preset.

skull8888888 avatar Oct 27 '24 20:10 skull8888888

Hey @skull8888888, can you provide more detail on it? I would love to work on this. @dinmukhamedm Can I work on this?

lucky29-git avatar Nov 01 '24 15:11 lucky29-git

@lucky29-git go for it!

So, to provide more context, currently the datatable filters (used in traces, sessions, and spans views) are stored as URL params under the key filter. It is a stringified array of json filters, where each has keys column, operator and value. We would like to add an ability for users to store a certain filter combination as a preset. Each preset must have a name. The presets must be saved in the localStorage and can be retrieved using something like a Select or a ComboBox component.

Example user flow:

  1. Go to spans view in the traces page
  2. Filter spans by path = my_agent.anthropic.chat and latency > 1.
  3. Click save as preset. In the appearing dialog/pop-up, name the preset something like anthropic slower than 1s.
  4. Go elsewhere in the platform
  5. Come back to the spans view
  6. Select anthropic slower than 1s from the available presets
  7. Laminar fills in the URL param filters with the saved value and shows the filtered data

To have some data for (2) you might need to observe some code and send it to localhost at grpc_port = 8001. Read more in our docs

dinmukhamedm avatar Nov 01 '24 18:11 dinmukhamedm

Thanks @dinmukhamedm I will onto it, will reach out to you if needed any help.

lucky29-git avatar Nov 01 '24 19:11 lucky29-git

hi @lucky29-git Are you working on this? If not Please let me know.

sarthakvijayvargiya avatar Nov 14 '24 17:11 sarthakvijayvargiya

Hi @sarthakvijayvargiya, I'll work on this Just needed some time I'm in the middle of my exams right now. Will let you know if needed any help

lucky29-git avatar Nov 14 '24 17:11 lucky29-git

Yeah sure, @devansh-m12

lucky29-git avatar Jan 16 '25 01:01 lucky29-git

Sorry, @devansh-m12 for the late response. Yes, go ahead, you can pick this up

dinmukhamedm avatar Jan 30 '25 14:01 dinmukhamedm