-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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
Added string thresholds for singlestat and table panel #5638
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rds. Also made render() function do the string to regex conversion.
Table thresholds will be added shortly |
…d strings. Added unit tests.
…upport for table string thresholds, will add unit tests
Is this PR abandoned? Would love to see this feature. |
closing this, think it complicates the code to much and is confusing number thresholds with text -> color mappings. Something that if implemented needs it's own concept, feel it makes the code too hacky to use the thresholds for this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/panel/singlestat
area/panel/table
pr/external
This PR is from external contributor
type/feature-request
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related issue/feature request: #3601
This will allow you to input regex for threshold values in both the singlestat and table panels.
The regex works like this: Enter regex, seperated by commas for more regex. Make sure the regex starts with a forward slash, so it can determine between a number and regex. Anything that does not match a regex, will be mapped to the first color, this is similar to how the thresholds with numbers work, where anything <= the first number is mapped to the first color.
The getColorForValue function seems redundant to be in both the table panel and singlestat, I am considering moving it to somewhere common, like /public/app/core/utils/kbn.js . However, this would break the current tests for singlestat, requiring that they be moved to kbn_specs. The file singlestat_panel_specs.ts would then be useless and have to be removed, not sure how that works with a pull request.