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

Trace Groups Optimization - Remove duplicate filters #2368

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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 @@ -222,21 +222,7 @@ exports[`Dashboard component renders dashboard 1`] = `
}
query=""
setEndTime={[MockFunction]}
setFilters={
[MockFunction] {
"calls": Array [
Array [
Array [],
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
}
}
setFilters={[MockFunction]}
setQuery={[MockFunction]}
setStartTime={[MockFunction]}
startTime="now-5m"
Expand Down Expand Up @@ -617,21 +603,7 @@ exports[`Dashboard component renders dashboard 1`] = `
}
query=""
setEndTime={[MockFunction]}
setFilters={
[MockFunction] {
"calls": Array [
Array [
Array [],
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
}
}
setFilters={[MockFunction]}
setQuery={[MockFunction]}
setStartTime={[MockFunction]}
startTime="now-5m"
Expand Down Expand Up @@ -2870,21 +2842,7 @@ exports[`Dashboard component renders empty dashboard 1`] = `
}
query=""
setEndTime={[MockFunction]}
setFilters={
[MockFunction] {
"calls": Array [
Array [
Array [],
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
}
}
setFilters={[MockFunction]}
setQuery={[MockFunction]}
setStartTime={[MockFunction]}
startTime="now-5m"
Expand Down Expand Up @@ -3264,21 +3222,7 @@ exports[`Dashboard component renders empty dashboard 1`] = `
}
query=""
setEndTime={[MockFunction]}
setFilters={
[MockFunction] {
"calls": Array [
Array [
Array [],
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
}
}
setFilters={[MockFunction]}
setQuery={[MockFunction]}
setStartTime={[MockFunction]}
startTime="now-5m"
Expand Down Expand Up @@ -5517,21 +5461,7 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = `
}
query=""
setEndTime={[MockFunction]}
setFilters={
[MockFunction] {
"calls": Array [
Array [
Array [],
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
}
}
setFilters={[MockFunction]}
setQuery={[MockFunction]}
setStartTime={[MockFunction]}
startTime="now-5m"
Expand Down Expand Up @@ -5913,21 +5843,7 @@ exports[`Dashboard component renders empty jaeger dashboard 1`] = `
}
query=""
setEndTime={[MockFunction]}
setFilters={
[MockFunction] {
"calls": Array [
Array [
Array [],
],
],
"results": Array [
Object {
"type": "return",
"value": undefined,
},
],
}
}
setFilters={[MockFunction]}
setQuery={[MockFunction]}
setStartTime={[MockFunction]}
startTime="now-5m"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
handleJaegerDashboardRequest,
handleJaegerErrorDashboardRequest,
} from '../../requests/dashboard_request_handler';
import { getValidFilterFields } from '../common/filters/filter_helpers';
import { FilterType } from '../common/filters/filters';
import {
MissingConfigurationMessage,
Expand Down Expand Up @@ -53,7 +52,6 @@
jaegerIndicesExist,
toasts,
dataSourceMDSId,
attributesFilterFields,
} = props;
const [tableItems, setTableItems] = useState([]);
const [jaegerTableItems, setJaegerTableItems] = useState([]);
Expand Down Expand Up @@ -87,13 +85,6 @@
chrome.setBreadcrumbs([parentBreadcrumb, ...childBreadcrumbs]);
}

const validFilters = getValidFilterFields(mode, page, attributesFilterFields);
setFilters([
...filters.map((filter) => ({
...filter,
locked: validFilters.indexOf(filter.field) === -1,
})),
]);
setRedirect(false);
}, []);

Expand Down Expand Up @@ -193,7 +184,7 @@
// service map should not be filtered by service name (https://github.com/opensearch-project/observability/issues/442)
const serviceMapDSL = cloneDeep(DSL);
serviceMapDSL.query.bool.must = serviceMapDSL.query.bool.must.filter(
(must: any) => must?.term?.serviceName == null

Check warning on line 187 in public/components/trace_analytics/components/dashboard/dashboard_content.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
);
}

Expand Down Expand Up @@ -245,8 +236,8 @@
for (let i = 0; i < filters.length; i++) {
if (filters[i].custom) {
const newFilter = JSON.parse(JSON.stringify(filters[i]));
newFilter.custom.query.bool.should.forEach((should: any) =>

Check warning on line 239 in public/components/trace_analytics/components/dashboard/dashboard_content.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
should.bool.must.forEach((must: any) => {

Check warning on line 240 in public/components/trace_analytics/components/dashboard/dashboard_content.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
const range = must?.range?.['traceGroupFields.durationInNanos'];
if (range) {
const duration = range.lt || range.lte || range.gt || range.gte;
Expand Down
Loading