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

Remove kuery from uiFilters #91932

Merged
merged 23 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from 22 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 @@ -67,9 +67,8 @@ type ErrorGroupDetailsProps = RouteComponentProps<{

export function ErrorGroupDetails({ location, match }: ErrorGroupDetailsProps) {
const { serviceName, groupId } = match.params;
const { urlParams, uiFilters } = useUrlParams();
const { environment, start, end } = urlParams;

const { urlParams } = useUrlParams();
const { environment, kuery, start, end } = urlParams;
const { data: errorGroupData } = useFetcher(
(callApmApi) => {
if (start && end) {
Expand All @@ -82,15 +81,15 @@ export function ErrorGroupDetails({ location, match }: ErrorGroupDetailsProps) {
},
query: {
environment,
kuery,
start,
end,
uiFilters: JSON.stringify(uiFilters),
},
},
});
}
},
[environment, serviceName, start, end, groupId, uiFilters]
[environment, kuery, serviceName, start, end, groupId]
);

const { errorDistributionData } = useErrorGroupDistributionFetcher({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@ export function ErrorCorrelations({ onClose }: Props) {
] = useState<SignificantTerm | null>(null);

const { serviceName } = useParams<{ serviceName?: string }>();
const { urlParams, uiFilters } = useUrlParams();
const { urlParams } = useUrlParams();
const {
environment,
kuery,
transactionName,
transactionType,
start,
Expand All @@ -72,12 +73,12 @@ export function ErrorCorrelations({ onClose }: Props) {
params: {
query: {
environment,
kuery,
serviceName,
transactionName,
transactionType,
start,
end,
uiFilters: JSON.stringify(uiFilters),
fieldNames: fieldNames.join(','),
},
},
Expand All @@ -86,12 +87,12 @@ export function ErrorCorrelations({ onClose }: Props) {
},
[
environment,
kuery,
serviceName,
start,
end,
transactionName,
transactionType,
uiFilters,
fieldNames,
]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ export function LatencyCorrelations({ onClose }: Props) {
] = useState<SignificantTerm | null>(null);

const { serviceName } = useParams<{ serviceName?: string }>();
const { urlParams, uiFilters } = useUrlParams();
const { urlParams } = useUrlParams();
const {
environment,
kuery,
transactionName,
transactionType,
start,
Expand All @@ -77,12 +78,12 @@ export function LatencyCorrelations({ onClose }: Props) {
params: {
query: {
environment,
kuery,
serviceName,
transactionName,
transactionType,
start,
end,
uiFilters: JSON.stringify(uiFilters),
durationPercentile: durationPercentile.toString(10),
fieldNames: fieldNames.join(','),
},
Expand All @@ -92,12 +93,12 @@ export function LatencyCorrelations({ onClose }: Props) {
},
[
environment,
kuery,
serviceName,
start,
end,
transactionName,
transactionType,
uiFilters,
durationPercentile,
fieldNames,
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ interface ErrorGroupOverviewProps {
}

export function ErrorGroupOverview({ serviceName }: ErrorGroupOverviewProps) {
const { urlParams, uiFilters } = useUrlParams();
const { environment, start, end, sortField, sortDirection } = urlParams;
const {
urlParams: { environment, kuery, start, end, sortField, sortDirection },
} = useUrlParams();
const { errorDistributionData } = useErrorGroupDistributionFetcher({
serviceName,
groupId: undefined,
Expand All @@ -47,17 +48,17 @@ export function ErrorGroupOverview({ serviceName }: ErrorGroupOverviewProps) {
},
query: {
environment,
kuery,
start,
end,
sortField,
sortDirection: normalizedSortDirection,
uiFilters: JSON.stringify(uiFilters),
},
},
});
}
},
[environment, serviceName, start, end, sortField, sortDirection, uiFilters]
[environment, kuery, serviceName, start, end, sortField, sortDirection]
);

useTrackPageview({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ const initialData = {
let hasDisplayedToast = false;

function useServicesFetcher() {
const { urlParams, uiFilters } = useUrlParams();
const {
urlParams: { environment, kuery, start, end },
} = useUrlParams();
const { core } = useApmPluginContext();
const upgradeAssistantHref = useUpgradeAssistantHref();
const { environment, start, end } = urlParams;

const { data = initialData, status } = useFetcher(
(callApmApi) => {
if (start && end) {
Expand All @@ -48,15 +50,15 @@ function useServicesFetcher() {
params: {
query: {
environment,
kuery,
start,
end,
uiFilters: JSON.stringify(uiFilters),
},
},
});
}
},
[environment, start, end, uiFilters]
[environment, kuery, start, end]
);

useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ type ServiceNodeMetricsProps = RouteComponentProps<{
}>;

export function ServiceNodeMetrics({ match }: ServiceNodeMetricsProps) {
const { urlParams, uiFilters } = useUrlParams();
const {
urlParams: { kuery, start, end },
} = useUrlParams();
const { serviceName, serviceNodeName } = match.params;
const { agentName } = useApmServiceContext();
const { data } = useServiceMetricChartsFetcher({ serviceNodeName });
const { start, end } = urlParams;

const { data: { host, containerId } = INITIAL_DATA, status } = useFetcher(
(callApmApi) => {
Expand All @@ -72,15 +73,15 @@ export function ServiceNodeMetrics({ match }: ServiceNodeMetricsProps) {
params: {
path: { serviceName, serviceNodeName },
query: {
kuery,
start,
end,
uiFilters: JSON.stringify(uiFilters),
},
},
});
}
},
[serviceName, serviceNodeName, start, end, uiFilters]
[kuery, serviceName, serviceNodeName, start, end]
);

const isLoading = status === FETCH_STATUS.LOADING;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ interface ServiceNodeOverviewProps {
}

function ServiceNodeOverview({ serviceName }: ServiceNodeOverviewProps) {
const { uiFilters, urlParams } = useUrlParams();
const { start, end } = urlParams;
const {
urlParams: { kuery, start, end },
} = useUrlParams();

const { data: items = [] } = useFetcher(
(callApmApi) => {
Expand All @@ -50,14 +51,14 @@ function ServiceNodeOverview({ serviceName }: ServiceNodeOverviewProps) {
serviceName,
},
query: {
kuery,
start,
end,
uiFilters: JSON.stringify(uiFilters),
},
},
});
},
[serviceName, start, end, uiFilters]
[kuery, serviceName, start, end]
);

const columns: Array<ITableColumn<typeof items[0]>> = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ const INITIAL_STATE = {

export function ServiceOverviewErrorsTable({ serviceName }: Props) {
const {
urlParams: { environment, start, end },
uiFilters,
urlParams: { environment, kuery, start, end },
} = useUrlParams();
const { transactionType } = useApmServiceContext();
const [tableOptions, setTableOptions] = useState<{
Expand Down Expand Up @@ -72,9 +71,9 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) {
path: { serviceName },
query: {
environment,
kuery,
start,
end,
uiFilters: JSON.stringify(uiFilters),
transactionType,
},
},
Expand All @@ -85,7 +84,7 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) {
};
});
},
[environment, start, end, serviceName, uiFilters, transactionType]
[environment, kuery, start, end, serviceName, transactionType]
);

const { requestId, items } = data;
Expand Down Expand Up @@ -116,9 +115,10 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) {
params: {
path: { serviceName },
query: {
environment,
kuery,
start,
end,
uiFilters: JSON.stringify(uiFilters),
numBuckets: 20,
transactionType,
groupIds,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ export function ServiceOverviewInstancesChartAndTable({
const { transactionType } = useApmServiceContext();

const {
urlParams: { environment, latencyAggregationType, start, end },
uiFilters,
urlParams: { environment, kuery, latencyAggregationType, start, end },
} = useUrlParams();

const { data = [], status } = useFetcher(
Expand All @@ -44,24 +43,24 @@ export function ServiceOverviewInstancesChartAndTable({
},
query: {
environment,
kuery,
latencyAggregationType,
start,
end,
transactionType,
uiFilters: JSON.stringify(uiFilters),
numBuckets: 20,
},
},
});
},
[
environment,
kuery,
latencyAggregationType,
start,
end,
serviceName,
transactionType,
uiFilters,
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ export function ServiceOverviewThroughputChart({
}) {
const theme = useTheme();
const { serviceName } = useParams<{ serviceName?: string }>();
const { urlParams, uiFilters } = useUrlParams();
const {
urlParams: { environment, kuery, start, end },
} = useUrlParams();
const { transactionType } = useApmServiceContext();
const { environment, start, end } = urlParams;

const { data = INITIAL_STATE, status } = useFetcher(
(callApmApi) => {
Expand All @@ -43,16 +44,16 @@ export function ServiceOverviewThroughputChart({
},
query: {
environment,
kuery,
start,
end,
transactionType,
uiFilters: JSON.stringify(uiFilters),
},
},
});
}
},
[environment, serviceName, start, end, uiFilters, transactionType]
[environment, kuery, serviceName, start, end, transactionType]
);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ export function ServiceOverviewTransactionsTable({ serviceName }: Props) {

const { transactionType } = useApmServiceContext();
const {
uiFilters,
urlParams: { environment, start, end, latencyAggregationType },
urlParams: { environment, kuery, start, end, latencyAggregationType },
} = useUrlParams();

const { data = INITIAL_STATE, status } = useFetcher(
Expand All @@ -73,9 +72,9 @@ export function ServiceOverviewTransactionsTable({ serviceName }: Props) {
path: { serviceName },
query: {
environment,
kuery,
start,
end,
uiFilters: JSON.stringify(uiFilters),
transactionType,
latencyAggregationType,
},
Expand All @@ -89,10 +88,10 @@ export function ServiceOverviewTransactionsTable({ serviceName }: Props) {
},
[
environment,
kuery,
serviceName,
start,
end,
uiFilters,
transactionType,
latencyAggregationType,
]
Expand Down Expand Up @@ -128,9 +127,9 @@ export function ServiceOverviewTransactionsTable({ serviceName }: Props) {
path: { serviceName },
query: {
environment,
kuery,
start,
end,
uiFilters: JSON.stringify(uiFilters),
numBuckets: 20,
transactionType,
latencyAggregationType,
Expand Down
Loading