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

Expression browser metric autocomplete misses certain search terms #2380

Closed
juliusv opened this Issue Jan 31, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@juliusv
Copy link
Member

juliusv commented Jan 31, 2017

Metric name fragments that are not a metric prefix (but contained somewhere in a metric name) and contain an underscore are not shown by the fuzzy-matching autocompleter in the expression browser.

For example, enter disk on http://demo.robustperception.io:9090/ to see that there are metrics node_disk_bytes_read, etc. Then enter disk_ to see that all those suggestions disappear.

This is likely related to 50f8e35. /cc @lightpriest

@lightpriest

This comment has been minimized.

Copy link
Contributor

lightpriest commented Jan 31, 2017

Yes, it's probably because of this change. The fuzzy matching breaks words by space. To perform the lookup, I remove the underscore from the metric name before looking up, and add it back after.

I wonder what will be the solution here. What would you expect the behavior to be? It might be treated as a space, or it might be treated as an underscore.

If treated as a space, then typing an underscore is meaningless, but the user was actually trying to do something - reduce the suggested options?
If treated as an underscore, maybe the code should fallback to the regular string matching? This will reduce the suggestion list, but in some cases might generate a different set of results.

@juliusv

This comment has been minimized.

Copy link
Member Author

juliusv commented Jan 31, 2017

@lightpriest Hmm, not sure yet! Do you know why it does work if the search term is a metric prefix (like node_boot -> node_boot_time), but not if it's in the middle somewhere (boot_time)?

@lightpriest

This comment has been minimized.

Copy link
Contributor

lightpriest commented Feb 5, 2017

@juliusv #2396 includes a fix for this issue. It also includes a change to the library itself to provide better results.

I tried replacing the fuzzy search lib with atom's one (https://github.com/atom/fuzzaldrin), but it's targeted at path subjects, giving higher scores to the last path element, treats slash specially, etc.

beorn7 added a commit that referenced this issue Mar 2, 2017

Fix autocomplete misses certain queries
For some of the queries, the fuzzy lookup was not filtering properly.
The problem is due to the "replace" beind made on the query itself. It
accidently removes only the first underscore. This patch changes it so
that it removes all of the whitespaces, letting the fuzzy algorithm do
its magic, also fixing this problem.

Originally, the underscore were replaced by a space for this specific
reason, to let the user type a space and have the lookup treat it as the
word break.

Fixes #2380

@brian-brazil brian-brazil added kind/bug and removed kind/bug labels Jul 14, 2017

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 23, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.