Skip to content

Commit 25d8f42

Browse files
opensearch-trigger-bot[bot]github-actions[bot]Adam Tackett
authored
Trace Groups Optimization - Remove duplicate filters (#2368) (#2373)
* trace group opt, remove duplicate filter calls * add back validation for traces and services, keep it removed for dashboard content * remove spacing * fix bug for filter applied from trace group --------- (cherry picked from commit b84c5db) Signed-off-by: Adam Tackett <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Adam Tackett <[email protected]>
1 parent 9d31665 commit 25d8f42

File tree

3 files changed

+7
-100
lines changed

3 files changed

+7
-100
lines changed

public/components/trace_analytics/components/dashboard/__tests__/__snapshots__/dashboard.test.tsx.snap

+6-90
Original file line numberDiff line numberDiff line change
@@ -222,21 +222,7 @@ exports[`Dashboard component renders dashboard 1`] = `
222222
}
223223
query=""
224224
setEndTime={[MockFunction]}
225-
setFilters={
226-
[MockFunction] {
227-
"calls": Array [
228-
Array [
229-
Array [],
230-
],
231-
],
232-
"results": Array [
233-
Object {
234-
"type": "return",
235-
"value": undefined,
236-
},
237-
],
238-
}
239-
}
225+
setFilters={[MockFunction]}
240226
setQuery={[MockFunction]}
241227
setStartTime={[MockFunction]}
242228
startTime="now-5m"
@@ -617,21 +603,7 @@ exports[`Dashboard component renders dashboard 1`] = `
617603
}
618604
query=""
619605
setEndTime={[MockFunction]}
620-
setFilters={
621-
[MockFunction] {
622-
"calls": Array [
623-
Array [
624-
Array [],
625-
],
626-
],
627-
"results": Array [
628-
Object {
629-
"type": "return",
630-
"value": undefined,
631-
},
632-
],
633-
}
634-
}
606+
setFilters={[MockFunction]}
635607
setQuery={[MockFunction]}
636608
setStartTime={[MockFunction]}
637609
startTime="now-5m"
@@ -2870,21 +2842,7 @@ exports[`Dashboard component renders empty dashboard 1`] = `
28702842
}
28712843
query=""
28722844
setEndTime={[MockFunction]}
2873-
setFilters={
2874-
[MockFunction] {
2875-
"calls": Array [
2876-
Array [
2877-
Array [],
2878-
],
2879-
],
2880-
"results": Array [
2881-
Object {
2882-
"type": "return",
2883-
"value": undefined,
2884-
},
2885-
],
2886-
}
2887-
}
2845+
setFilters={[MockFunction]}
28882846
setQuery={[MockFunction]}
28892847
setStartTime={[MockFunction]}
28902848
startTime="now-5m"
@@ -3264,21 +3222,7 @@ exports[`Dashboard component renders empty dashboard 1`] = `
32643222
}
32653223
query=""
32663224
setEndTime={[MockFunction]}
3267-
setFilters={
3268-
[MockFunction] {
3269-
"calls": Array [
3270-
Array [
3271-
Array [],
3272-
],
3273-
],
3274-
"results": Array [
3275-
Object {
3276-
"type": "return",
3277-
"value": undefined,
3278-
},
3279-
],
3280-
}
3281-
}
3225+
setFilters={[MockFunction]}
32823226
setQuery={[MockFunction]}
32833227
setStartTime={[MockFunction]}
32843228
startTime="now-5m"
@@ -5517,21 +5461,7 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = `
55175461
}
55185462
query=""
55195463
setEndTime={[MockFunction]}
5520-
setFilters={
5521-
[MockFunction] {
5522-
"calls": Array [
5523-
Array [
5524-
Array [],
5525-
],
5526-
],
5527-
"results": Array [
5528-
Object {
5529-
"type": "return",
5530-
"value": undefined,
5531-
},
5532-
],
5533-
}
5534-
}
5464+
setFilters={[MockFunction]}
55355465
setQuery={[MockFunction]}
55365466
setStartTime={[MockFunction]}
55375467
startTime="now-5m"
@@ -5913,21 +5843,7 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = `
59135843
}
59145844
query=""
59155845
setEndTime={[MockFunction]}
5916-
setFilters={
5917-
[MockFunction] {
5918-
"calls": Array [
5919-
Array [
5920-
Array [],
5921-
],
5922-
],
5923-
"results": Array [
5924-
Object {
5925-
"type": "return",
5926-
"value": undefined,
5927-
},
5928-
],
5929-
}
5930-
}
5846+
setFilters={[MockFunction]}
59315847
setQuery={[MockFunction]}
59325848
setStartTime={[MockFunction]}
59335849
startTime="now-5m"

public/components/trace_analytics/components/dashboard/dashboard_content.tsx

-9
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {
1717
handleJaegerDashboardRequest,
1818
handleJaegerErrorDashboardRequest,
1919
} from '../../requests/dashboard_request_handler';
20-
import { getValidFilterFields } from '../common/filters/filter_helpers';
2120
import { FilterType } from '../common/filters/filters';
2221
import {
2322
MissingConfigurationMessage,
@@ -54,7 +53,6 @@ export function DashboardContent(props: DashboardProps) {
5453
jaegerIndicesExist,
5554
toasts,
5655
dataSourceMDSId,
57-
attributesFilterFields,
5856
} = props;
5957
const [tableItems, setTableItems] = useState([]);
6058
const [jaegerTableItems, setJaegerTableItems] = useState([]);
@@ -89,13 +87,6 @@ export function DashboardContent(props: DashboardProps) {
8987
chrome.setBreadcrumbs([parentBreadcrumb, ...childBreadcrumbs]);
9088
}
9189

92-
const validFilters = getValidFilterFields(mode, page, attributesFilterFields);
93-
setFilters([
94-
...filters.map((filter) => ({
95-
...filter,
96-
locked: validFilters.indexOf(filter.field) === -1,
97-
})),
98-
]);
9990
setRedirect(false);
10091
}, []);
10192

public/components/trace_analytics/components/dashboard/dashboard_table.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ export function DashboardTable(props: {
335335
inverted: false,
336336
disabled: false,
337337
});
338-
if (props.page !== 'app') {
338+
if (!['app', 'traces'].includes(props.page)) {
339339
props.setRedirect(true);
340340
location.assign('#/traces');
341341
}

0 commit comments

Comments
 (0)