lmnr-ai / lmnr

Laminar - open-source all-in-one platform for engineering AI products. Crate data flywheel for you AI app. Traces, Evals, Datasets, Labels. YC S24.
https://www.lmnr.ai
Apache License 2.0
1.19k stars 60 forks source link

Add "presets" to Datatable component #101

Open skull8888888 opened 1 month ago

skull8888888 commented 1 month ago

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.

lucky29-git commented 1 month ago

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

dinmukhamedm commented 1 month ago

@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

lucky29-git commented 1 month ago

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

sarthakvijayvargiya commented 2 weeks ago

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

lucky29-git commented 2 weeks ago

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