datatrails: persist search terms and use them to reduce retrieved metric names #87884
+389
−192
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.
What is this feature?
Creates a metric search terms variable.
This variable is stored as a URL parameter, and sent to the prometheus request for metric names.
A limit is added to the prometheus request to prevent an excessive response of metric names, which could lead to a time out. The user is encouraged to add adhoc filters or additional search terms to reduce the number of results returned.
Why do we need this feature?
Three features:
Limitations:
match[]
parameter excludes "lookahead". Instead, we construct a list of expressions out of the search terms, and requestsn
of those terms to be present in the metric name (where n is the number of search terms). This will result in false positiives, such as "go hello" matching "go_gone" since "go" appears twice. The same javascript regular expression is used as before, which would filter out "go_gone" since it lacks "hello". Unfortunately, the limit will include these false positives.Special notes for your reviewer:
Please check that: