Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ function setTrace(state: TTraceTimeline, { uiFind, trace }: TTraceUiFindValue) {

return Object.assign(
{ ...newInitialState(), spanNameColumnWidth, traceID },
uiFind ? calculateFocusedFindRowStates(uiFind, spans) : null
uiFind ? calculateFocusedFindRowStates(uiFind, spans, false) : null
);
}

Expand Down
23 changes: 12 additions & 11 deletions packages/jaeger-ui/src/utils/filter-spans.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@ export default function filterSpans(textFilter: string, spans: Span[] | TNil) {
// values with keys that include text in any one of the excludeKeys will be ignored
const excludeKeys: string[] = [];

// split textFilter by whitespace, remove empty strings, and extract includeFilters and excludeKeys
textFilter
.split(/\s+/)
.filter(Boolean)
.forEach(w => {
if (w[0] === '-') {
excludeKeys.push(w.substr(1).toLowerCase());
} else {
includeFilters.push(w.toLowerCase());
}
});
// split textFilter by whitespace, but not that in double quotes, remove empty strings, and extract includeFilters and excludeKeys
const regex = /"[^"]+"|[^\s]+/g;
const match = textFilter.match(regex);
const results = match ? match.map(e => e.replace(/"(.*)"/, '$1')) : [];

results.filter(Boolean).forEach(w => {
if (w[0] === '-') {
excludeKeys.push(w.substr(1).toLowerCase());
} else {
includeFilters.push(w.toLowerCase());
}
});

const isTextInFilters = (filters: Array<string>, text: string) =>
filters.some(filter => text.toLowerCase().includes(filter));
Expand Down