FormidableLabs / envy

Node.js Telemetry & Network Viewer
https://envy-webui.vercel.app
MIT License
107 stars 0 forks source link

[Proposal] Feature: Keyword search capability for systems #190

Closed kgpax closed 10 months ago

kgpax commented 10 months ago

What does this PR do

Allows systems to expose keywords for traces, so that the search feature of Envy can find traces by more than just the URL of the trace.

Resolves #187

New System<T> interface member:

New ability to inject a large volume of traces:

Screenshots

Using the search term to find CocktailDb API traces by cocktail name

How to test

Basic:

Custom viewer:

changeset-bot[bot] commented 10 months ago

🦋 Changeset detected

Latest commit: 6569a0138dbbea0dc2d33ea8eda31f0301b95ad6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages | Name | Type | | -------------- | ----- | | @envyjs/webui | Minor | | @envyjs/apollo | Minor | | @envyjs/core | Minor | | @envyjs/nextjs | Minor | | @envyjs/node | Minor | | @envyjs/web | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

carbonrobot commented 10 months ago

Should we consider a solution that is system-agnostic and uses the object keys (unfiltered or filtered) of incoming traces with a hash map or stringly based search? That could allow users to search on any value available without specifically updating the code.

The stringly based search (where you concat fields into a single string) is less performant and higher likely hood of false positives, but simpler to implement.

The hash map (where you map all incoming keys/value pairs into a map) is higher performance, but a little more difficult to implement.

We could also consider a tag-based search approach where you can type the specific property into the search host:localhost, the same way chrome network tools work, but that could be quite a bit more work.

kgpax commented 10 months ago

Should we consider a solution that is system-agnostic and uses the object keys (unfiltered or filtered) of incoming traces with a hash map or stringly based search? That could allow users to search on any value available without specifically updating the code.

The stringly based search (where you concat fields into a single string) is less performant and higher likely hood of false positives, but simpler to implement.

The hash map (where you map all incoming keys/value pairs into a map) is higher performance, but a little more difficult to implement.

We could also consider a tag-based search approach where you can type the specific property into the search host:localhost, the same way chrome network tools work, but that could be quite a bit more work.

We can. That's certainly an option. Some considerations:

The tag-based approach is a good idea, and one which can work alongside the "generic" search. E.g., host:localhost method:PATCH classic XXI could be a search term which looks for specifically localhost in the host data, PATCH in the method data, and classic XXI in the same way defined in this PR