Remove kuery from uiFilters (#91932)
* Make kuery a standalone query parameter instead of part of uiFilters * Move getEsFilters helper to RUM * Move query utils from "common" to "server" (it uses esKuery from the data plugin, which is exported from server, not common.) * Move uiFiltersRt to RUM routes References #84526.
This commit is contained in:
parent
4f8cd8399b
commit
57dfb811d6
|
@ -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) {
|
||||
|
@ -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({
|
||||
|
|
|
@ -49,9 +49,10 @@ export function ErrorCorrelations({ onClose }: Props) {
|
|||
] = useState<SelectedSignificantTerm | null>(null);
|
||||
|
||||
const { serviceName } = useParams<{ serviceName?: string }>();
|
||||
const { urlParams, uiFilters } = useUrlParams();
|
||||
const { urlParams } = useUrlParams();
|
||||
const {
|
||||
environment,
|
||||
kuery,
|
||||
transactionName,
|
||||
transactionType,
|
||||
start,
|
||||
|
@ -71,12 +72,12 @@ export function ErrorCorrelations({ onClose }: Props) {
|
|||
params: {
|
||||
query: {
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
transactionName,
|
||||
transactionType,
|
||||
start,
|
||||
end,
|
||||
uiFilters: JSON.stringify(uiFilters),
|
||||
fieldNames: fieldNames.join(','),
|
||||
},
|
||||
},
|
||||
|
@ -85,12 +86,12 @@ export function ErrorCorrelations({ onClose }: Props) {
|
|||
},
|
||||
[
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
start,
|
||||
end,
|
||||
transactionName,
|
||||
transactionType,
|
||||
uiFilters,
|
||||
fieldNames,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -47,9 +47,10 @@ export function LatencyCorrelations({ onClose }: Props) {
|
|||
] = useState<SelectedSignificantTerm | null>(null);
|
||||
|
||||
const { serviceName } = useParams<{ serviceName?: string }>();
|
||||
const { urlParams, uiFilters } = useUrlParams();
|
||||
const { urlParams } = useUrlParams();
|
||||
const {
|
||||
environment,
|
||||
kuery,
|
||||
transactionName,
|
||||
transactionType,
|
||||
start,
|
||||
|
@ -76,12 +77,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(','),
|
||||
},
|
||||
|
@ -91,12 +92,12 @@ export function LatencyCorrelations({ onClose }: Props) {
|
|||
},
|
||||
[
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
start,
|
||||
end,
|
||||
transactionName,
|
||||
transactionType,
|
||||
uiFilters,
|
||||
durationPercentile,
|
||||
fieldNames,
|
||||
]
|
||||
|
|
|
@ -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,
|
||||
|
@ -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({
|
||||
|
|
|
@ -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) {
|
||||
|
@ -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(() => {
|
||||
|
|
|
@ -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) => {
|
||||
|
@ -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;
|
||||
|
|
|
@ -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) => {
|
||||
|
@ -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]>> = [
|
||||
|
|
|
@ -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<{
|
||||
|
@ -72,9 +71,9 @@ export function ServiceOverviewErrorsTable({ serviceName }: Props) {
|
|||
path: { serviceName },
|
||||
query: {
|
||||
environment,
|
||||
kuery,
|
||||
start,
|
||||
end,
|
||||
uiFilters: JSON.stringify(uiFilters),
|
||||
transactionType,
|
||||
},
|
||||
},
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
|
|
@ -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(
|
||||
|
@ -44,11 +43,11 @@ export function ServiceOverviewInstancesChartAndTable({
|
|||
},
|
||||
query: {
|
||||
environment,
|
||||
kuery,
|
||||
latencyAggregationType,
|
||||
start,
|
||||
end,
|
||||
transactionType,
|
||||
uiFilters: JSON.stringify(uiFilters),
|
||||
numBuckets: 20,
|
||||
},
|
||||
},
|
||||
|
@ -56,12 +55,12 @@ export function ServiceOverviewInstancesChartAndTable({
|
|||
},
|
||||
[
|
||||
environment,
|
||||
kuery,
|
||||
latencyAggregationType,
|
||||
start,
|
||||
end,
|
||||
serviceName,
|
||||
transactionType,
|
||||
uiFilters,
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -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) => {
|
||||
|
@ -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 (
|
||||
|
|
|
@ -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(
|
||||
|
@ -73,9 +72,9 @@ export function ServiceOverviewTransactionsTable({ serviceName }: Props) {
|
|||
path: { serviceName },
|
||||
query: {
|
||||
environment,
|
||||
kuery,
|
||||
start,
|
||||
end,
|
||||
uiFilters: JSON.stringify(uiFilters),
|
||||
transactionType,
|
||||
latencyAggregationType,
|
||||
},
|
||||
|
@ -89,10 +88,10 @@ export function ServiceOverviewTransactionsTable({ serviceName }: Props) {
|
|||
},
|
||||
[
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
start,
|
||||
end,
|
||||
uiFilters,
|
||||
transactionType,
|
||||
latencyAggregationType,
|
||||
]
|
||||
|
@ -128,9 +127,9 @@ export function ServiceOverviewTransactionsTable({ serviceName }: Props) {
|
|||
path: { serviceName },
|
||||
query: {
|
||||
environment,
|
||||
kuery,
|
||||
start,
|
||||
end,
|
||||
uiFilters: JSON.stringify(uiFilters),
|
||||
numBuckets: 20,
|
||||
transactionType,
|
||||
latencyAggregationType,
|
||||
|
|
|
@ -33,8 +33,7 @@ export function ServiceProfiling({
|
|||
environment,
|
||||
}: ServiceProfilingProps) {
|
||||
const {
|
||||
urlParams: { start, end },
|
||||
uiFilters,
|
||||
urlParams: { kuery, start, end },
|
||||
} = useUrlParams();
|
||||
|
||||
const { data = [] } = useFetcher(
|
||||
|
@ -48,15 +47,15 @@ export function ServiceProfiling({
|
|||
params: {
|
||||
path: { serviceName },
|
||||
query: {
|
||||
kuery,
|
||||
start,
|
||||
end,
|
||||
environment,
|
||||
uiFilters: JSON.stringify(uiFilters),
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
[start, end, serviceName, environment, uiFilters]
|
||||
[kuery, start, end, serviceName, environment]
|
||||
);
|
||||
|
||||
const [valueType, setValueType] = useState<ProfilingValueType | undefined>();
|
||||
|
@ -125,7 +124,7 @@ export function ServiceProfiling({
|
|||
valueType={valueType}
|
||||
start={start}
|
||||
end={end}
|
||||
uiFilters={uiFilters}
|
||||
kuery={kuery}
|
||||
/>
|
||||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
|
|
|
@ -42,7 +42,6 @@ import {
|
|||
asDynamicBytes,
|
||||
asInteger,
|
||||
} from '../../../../common/utils/formatters';
|
||||
import { UIFilters } from '../../../../typings/ui_filters';
|
||||
import { useFetcher } from '../../../hooks/use_fetcher';
|
||||
import { useTheme } from '../../../hooks/use_theme';
|
||||
import { px, unit } from '../../../style/variables';
|
||||
|
@ -124,17 +123,17 @@ function CustomTooltip({
|
|||
export function ServiceProfilingFlamegraph({
|
||||
serviceName,
|
||||
environment,
|
||||
kuery,
|
||||
valueType,
|
||||
start,
|
||||
end,
|
||||
uiFilters,
|
||||
}: {
|
||||
serviceName: string;
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
valueType?: ProfilingValueType;
|
||||
start?: string;
|
||||
end?: string;
|
||||
uiFilters: UIFilters;
|
||||
}) {
|
||||
const theme = useTheme();
|
||||
|
||||
|
@ -154,16 +153,16 @@ export function ServiceProfilingFlamegraph({
|
|||
serviceName,
|
||||
},
|
||||
query: {
|
||||
kuery,
|
||||
start,
|
||||
end,
|
||||
environment,
|
||||
valueType,
|
||||
uiFilters: JSON.stringify(uiFilters),
|
||||
},
|
||||
},
|
||||
});
|
||||
},
|
||||
[start, end, environment, serviceName, valueType, uiFilters]
|
||||
[kuery, start, end, environment, serviceName, valueType]
|
||||
);
|
||||
|
||||
const points = useMemo(() => {
|
||||
|
|
|
@ -22,8 +22,9 @@ const DEFAULT_RESPONSE: TracesAPIResponse = {
|
|||
};
|
||||
|
||||
export function TraceOverview() {
|
||||
const { urlParams, uiFilters } = useUrlParams();
|
||||
const { environment, start, end } = urlParams;
|
||||
const {
|
||||
urlParams: { environment, kuery, start, end },
|
||||
} = useUrlParams();
|
||||
const { status, data = DEFAULT_RESPONSE } = useFetcher(
|
||||
(callApmApi) => {
|
||||
if (start && end) {
|
||||
|
@ -32,15 +33,15 @@ export function TraceOverview() {
|
|||
params: {
|
||||
query: {
|
||||
environment,
|
||||
kuery,
|
||||
start,
|
||||
end,
|
||||
uiFilters: JSON.stringify(uiFilters),
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
[environment, start, end, uiFilters]
|
||||
[environment, kuery, start, end]
|
||||
);
|
||||
|
||||
useTrackPageview({ app: 'apm', path: 'traces_overview' });
|
||||
|
|
|
@ -19,9 +19,10 @@ const DEFAULT_RESPONSE: Partial<TransactionsAPIResponse> = {
|
|||
};
|
||||
|
||||
export function useTransactionListFetcher() {
|
||||
const { urlParams, uiFilters } = useUrlParams();
|
||||
const {
|
||||
urlParams: { environment, kuery, transactionType, start, end },
|
||||
} = useUrlParams();
|
||||
const { serviceName } = useParams<{ serviceName?: string }>();
|
||||
const { environment, transactionType, start, end } = urlParams;
|
||||
const { data = DEFAULT_RESPONSE, error, status } = useFetcher(
|
||||
(callApmApi) => {
|
||||
if (serviceName && start && end && transactionType) {
|
||||
|
@ -31,16 +32,16 @@ export function useTransactionListFetcher() {
|
|||
path: { serviceName },
|
||||
query: {
|
||||
environment,
|
||||
kuery,
|
||||
start,
|
||||
end,
|
||||
transactionType,
|
||||
uiFilters: JSON.stringify(uiFilters),
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
[environment, serviceName, start, end, transactionType, uiFilters]
|
||||
[environment, kuery, serviceName, start, end, transactionType]
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
@ -12,10 +12,7 @@ import { createMemoryHistory } from 'history';
|
|||
import React, { ReactNode } from 'react';
|
||||
import { Router } from 'react-router-dom';
|
||||
import { MockApmPluginContextWrapper } from '../../../context/apm_plugin/mock_apm_plugin_context';
|
||||
import {
|
||||
UrlParamsContext,
|
||||
useUiFilters,
|
||||
} from '../../../context/url_params_context/url_params_context';
|
||||
import { UrlParamsContext } from '../../../context/url_params_context/url_params_context';
|
||||
import { IUrlParams } from '../../../context/url_params_context/types';
|
||||
import { DatePicker } from './';
|
||||
|
||||
|
@ -35,7 +32,7 @@ function MockUrlParamsProvider({
|
|||
rangeId: 0,
|
||||
refreshTimeRange: mockRefreshTimeRange,
|
||||
urlParams,
|
||||
uiFilters: useUiFilters(urlParams),
|
||||
uiFilters: {},
|
||||
}}
|
||||
children={children}
|
||||
/>
|
||||
|
|
|
@ -12,8 +12,9 @@ import { useApmServiceContext } from '../../../../context/apm_service/use_apm_se
|
|||
|
||||
export function useTransactionBreakdown() {
|
||||
const { serviceName } = useParams<{ serviceName?: string }>();
|
||||
const { urlParams, uiFilters } = useUrlParams();
|
||||
const { environment, start, end, transactionName } = urlParams;
|
||||
const {
|
||||
urlParams: { environment, kuery, start, end, transactionName },
|
||||
} = useUrlParams();
|
||||
const { transactionType } = useApmServiceContext();
|
||||
|
||||
const { data = { timeseries: undefined }, error, status } = useFetcher(
|
||||
|
@ -26,11 +27,11 @@ export function useTransactionBreakdown() {
|
|||
path: { serviceName },
|
||||
query: {
|
||||
environment,
|
||||
kuery,
|
||||
start,
|
||||
end,
|
||||
transactionName,
|
||||
transactionType,
|
||||
uiFilters: JSON.stringify(uiFilters),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@ -38,12 +39,12 @@ export function useTransactionBreakdown() {
|
|||
},
|
||||
[
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
start,
|
||||
end,
|
||||
transactionType,
|
||||
transactionName,
|
||||
uiFilters,
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -31,9 +31,10 @@ export function TransactionErrorRateChart({
|
|||
}: Props) {
|
||||
const theme = useTheme();
|
||||
const { serviceName } = useParams<{ serviceName?: string }>();
|
||||
const { urlParams, uiFilters } = useUrlParams();
|
||||
const {
|
||||
urlParams: { environment, kuery, start, end, transactionName },
|
||||
} = useUrlParams();
|
||||
const { transactionType } = useApmServiceContext();
|
||||
const { environment, start, end, transactionName } = urlParams;
|
||||
|
||||
const { data, status } = useFetcher(
|
||||
(callApmApi) => {
|
||||
|
@ -47,11 +48,11 @@ export function TransactionErrorRateChart({
|
|||
},
|
||||
query: {
|
||||
environment,
|
||||
kuery,
|
||||
start,
|
||||
end,
|
||||
transactionType,
|
||||
transactionName,
|
||||
uiFilters: JSON.stringify(uiFilters),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@ -59,10 +60,10 @@ export function TransactionErrorRateChart({
|
|||
},
|
||||
[
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
start,
|
||||
end,
|
||||
uiFilters,
|
||||
transactionType,
|
||||
transactionName,
|
||||
]
|
||||
|
|
|
@ -23,8 +23,9 @@ export function AnnotationsContextProvider({
|
|||
children: React.ReactNode;
|
||||
}) {
|
||||
const { serviceName } = useParams<{ serviceName?: string }>();
|
||||
const { urlParams } = useUrlParams();
|
||||
const { environment, start, end } = urlParams;
|
||||
const {
|
||||
urlParams: { environment, start, end },
|
||||
} = useUrlParams();
|
||||
|
||||
const { data = INITIAL_STATE } = useFetcher(
|
||||
(callApmApi) => {
|
||||
|
@ -36,15 +37,15 @@ export function AnnotationsContextProvider({
|
|||
serviceName,
|
||||
},
|
||||
query: {
|
||||
environment,
|
||||
start,
|
||||
end,
|
||||
environment,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
[start, end, environment, serviceName]
|
||||
[environment, start, end, serviceName]
|
||||
);
|
||||
|
||||
return <AnnotationsContext.Provider value={data} children={children} />;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React from 'react';
|
||||
import { IUrlParams } from './types';
|
||||
import { UrlParamsContext, useUiFilters } from './url_params_context';
|
||||
import { UrlParamsContext } from './url_params_context';
|
||||
|
||||
const defaultUrlParams = {
|
||||
page: 0,
|
||||
|
@ -35,7 +35,7 @@ export function MockUrlParamsContextProvider({
|
|||
rangeId: 0,
|
||||
refreshTimeRange,
|
||||
urlParams,
|
||||
uiFilters: useUiFilters(urlParams),
|
||||
uiFilters: {},
|
||||
}}
|
||||
children={children}
|
||||
/>
|
||||
|
|
|
@ -30,16 +30,12 @@ export interface TimeRange {
|
|||
}
|
||||
|
||||
function useUiFilters(params: IUrlParams): UIFilters {
|
||||
const { kuery, environment, ...urlParams } = params;
|
||||
const localUiFilters = mapValues(
|
||||
pickKeys(urlParams, ...localUIFilterNames),
|
||||
pickKeys(params, ...localUIFilterNames),
|
||||
(val) => (val ? val.split(',') : [])
|
||||
) as Partial<Record<LocalUIFilterName, string[]>>;
|
||||
|
||||
return useDeepObjectIdentity({
|
||||
kuery,
|
||||
...localUiFilters,
|
||||
});
|
||||
return useDeepObjectIdentity(localUiFilters);
|
||||
}
|
||||
|
||||
const defaultRefresh = (_time: TimeRange) => {};
|
||||
|
|
|
@ -15,8 +15,9 @@ export function useErrorGroupDistributionFetcher({
|
|||
serviceName: string;
|
||||
groupId: string | undefined;
|
||||
}) {
|
||||
const { urlParams, uiFilters } = useUrlParams();
|
||||
const { environment, start, end } = urlParams;
|
||||
const {
|
||||
urlParams: { environment, kuery, start, end },
|
||||
} = useUrlParams();
|
||||
const { data } = useFetcher(
|
||||
(callApmApi) => {
|
||||
if (start && end) {
|
||||
|
@ -26,16 +27,16 @@ export function useErrorGroupDistributionFetcher({
|
|||
path: { serviceName },
|
||||
query: {
|
||||
environment,
|
||||
kuery,
|
||||
start,
|
||||
end,
|
||||
groupId,
|
||||
uiFilters: JSON.stringify(uiFilters),
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
[environment, serviceName, start, end, groupId, uiFilters]
|
||||
[environment, kuery, serviceName, start, end, groupId]
|
||||
);
|
||||
|
||||
return { errorDistributionData: data };
|
||||
|
|
|
@ -21,10 +21,12 @@ export function useServiceMetricChartsFetcher({
|
|||
}: {
|
||||
serviceNodeName: string | undefined;
|
||||
}) {
|
||||
const { urlParams, uiFilters } = useUrlParams();
|
||||
const {
|
||||
urlParams: { environment, kuery, start, end },
|
||||
} = useUrlParams();
|
||||
const { agentName } = useApmServiceContext();
|
||||
const { serviceName } = useParams<{ serviceName?: string }>();
|
||||
const { environment, start, end } = urlParams;
|
||||
|
||||
const { data = INITIAL_DATA, error, status } = useFetcher(
|
||||
(callApmApi) => {
|
||||
if (serviceName && start && end && agentName) {
|
||||
|
@ -34,25 +36,17 @@ export function useServiceMetricChartsFetcher({
|
|||
path: { serviceName },
|
||||
query: {
|
||||
environment,
|
||||
kuery,
|
||||
serviceNodeName,
|
||||
start,
|
||||
end,
|
||||
agentName,
|
||||
uiFilters: JSON.stringify(uiFilters),
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
[
|
||||
environment,
|
||||
serviceName,
|
||||
start,
|
||||
end,
|
||||
agentName,
|
||||
serviceNodeName,
|
||||
uiFilters,
|
||||
]
|
||||
[environment, kuery, serviceName, start, end, agentName, serviceNodeName]
|
||||
);
|
||||
|
||||
return {
|
||||
|
|
|
@ -23,16 +23,18 @@ const INITIAL_DATA = {
|
|||
|
||||
export function useTransactionDistributionFetcher() {
|
||||
const { serviceName } = useParams<{ serviceName?: string }>();
|
||||
const { urlParams, uiFilters } = useUrlParams();
|
||||
const {
|
||||
environment,
|
||||
start,
|
||||
end,
|
||||
transactionType,
|
||||
transactionId,
|
||||
traceId,
|
||||
transactionName,
|
||||
} = urlParams;
|
||||
urlParams: {
|
||||
environment,
|
||||
kuery,
|
||||
start,
|
||||
end,
|
||||
transactionType,
|
||||
transactionId,
|
||||
traceId,
|
||||
transactionName,
|
||||
},
|
||||
} = useUrlParams();
|
||||
|
||||
const history = useHistory();
|
||||
const { data = INITIAL_DATA, status, error } = useFetcher(
|
||||
|
@ -47,13 +49,13 @@ export function useTransactionDistributionFetcher() {
|
|||
},
|
||||
query: {
|
||||
environment,
|
||||
kuery,
|
||||
start,
|
||||
end,
|
||||
transactionType,
|
||||
transactionName,
|
||||
transactionId,
|
||||
traceId,
|
||||
uiFilters: JSON.stringify(uiFilters),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@ -96,12 +98,12 @@ export function useTransactionDistributionFetcher() {
|
|||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
start,
|
||||
end,
|
||||
transactionType,
|
||||
transactionName,
|
||||
uiFilters,
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -20,12 +20,12 @@ export function useTransactionLatencyChartsFetcher() {
|
|||
const {
|
||||
urlParams: {
|
||||
environment,
|
||||
kuery,
|
||||
start,
|
||||
end,
|
||||
transactionName,
|
||||
latencyAggregationType,
|
||||
},
|
||||
uiFilters,
|
||||
} = useUrlParams();
|
||||
|
||||
const { data, error, status } = useFetcher(
|
||||
|
@ -44,11 +44,11 @@ export function useTransactionLatencyChartsFetcher() {
|
|||
path: { serviceName },
|
||||
query: {
|
||||
environment,
|
||||
kuery,
|
||||
start,
|
||||
end,
|
||||
transactionType,
|
||||
transactionName,
|
||||
uiFilters: JSON.stringify(uiFilters),
|
||||
latencyAggregationType,
|
||||
},
|
||||
},
|
||||
|
@ -57,12 +57,12 @@ export function useTransactionLatencyChartsFetcher() {
|
|||
},
|
||||
[
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
start,
|
||||
end,
|
||||
transactionName,
|
||||
transactionType,
|
||||
uiFilters,
|
||||
latencyAggregationType,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -18,8 +18,7 @@ export function useTransactionThroughputChartsFetcher() {
|
|||
const { transactionType } = useApmServiceContext();
|
||||
const theme = useTheme();
|
||||
const {
|
||||
urlParams: { environment, start, end, transactionName },
|
||||
uiFilters,
|
||||
urlParams: { environment, kuery, start, end, transactionName },
|
||||
} = useUrlParams();
|
||||
|
||||
const { data, error, status } = useFetcher(
|
||||
|
@ -32,11 +31,11 @@ export function useTransactionThroughputChartsFetcher() {
|
|||
path: { serviceName },
|
||||
query: {
|
||||
environment,
|
||||
kuery,
|
||||
start,
|
||||
end,
|
||||
transactionType,
|
||||
transactionName,
|
||||
uiFilters: JSON.stringify(uiFilters),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@ -44,12 +43,12 @@ export function useTransactionThroughputChartsFetcher() {
|
|||
},
|
||||
[
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
start,
|
||||
end,
|
||||
transactionName,
|
||||
transactionType,
|
||||
uiFilters,
|
||||
]
|
||||
);
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ import React from 'react';
|
|||
import { MemoryRouter } from 'react-router-dom';
|
||||
import { EuiThemeProvider } from '../../../../../src/plugins/kibana_react/common';
|
||||
import {
|
||||
ESFilter,
|
||||
ESSearchRequest,
|
||||
ESSearchResponse,
|
||||
} from '../../../../typings/elasticsearch';
|
||||
|
@ -121,7 +120,6 @@ interface MockSetup {
|
|||
internalClient: any;
|
||||
config: APMConfig;
|
||||
uiFilters: UIFilters;
|
||||
esFilter: ESFilter[];
|
||||
indices: {
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
'apm_oss.sourcemapIndices': string;
|
||||
|
@ -183,7 +181,6 @@ export async function inspectSearchParams(
|
|||
}
|
||||
) as APMConfig,
|
||||
uiFilters: {},
|
||||
esFilter: [],
|
||||
indices: {
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
'apm_oss.sourcemapIndices': 'myIndex',
|
||||
|
|
|
@ -13,7 +13,7 @@ import {
|
|||
TRANSACTION_TYPE,
|
||||
} from '../../../../common/elasticsearch_fieldnames';
|
||||
import { ProcessorEvent } from '../../../../common/processor_event';
|
||||
import { environmentQuery, rangeQuery } from '../../../../common/utils/queries';
|
||||
import { environmentQuery, rangeQuery } from '../../../../server/utils/queries';
|
||||
import { AlertParams } from '../../../routes/alerts/chart_preview';
|
||||
import { withApmSpan } from '../../../utils/with_apm_span';
|
||||
import { getBucketSize } from '../../helpers/get_bucket_size';
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
import { SERVICE_NAME } from '../../../../common/elasticsearch_fieldnames';
|
||||
import { ProcessorEvent } from '../../../../common/processor_event';
|
||||
import { AlertParams } from '../../../routes/alerts/chart_preview';
|
||||
import { environmentQuery, rangeQuery } from '../../../../common/utils/queries';
|
||||
import { environmentQuery, rangeQuery } from '../../../../server/utils/queries';
|
||||
import { withApmSpan } from '../../../utils/with_apm_span';
|
||||
import { getBucketSize } from '../../helpers/get_bucket_size';
|
||||
import { Setup, SetupTimeRange } from '../../helpers/setup_request';
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
} from '../../../../common/elasticsearch_fieldnames';
|
||||
import { ProcessorEvent } from '../../../../common/processor_event';
|
||||
import { AlertParams } from '../../../routes/alerts/chart_preview';
|
||||
import { environmentQuery, rangeQuery } from '../../../../common/utils/queries';
|
||||
import { environmentQuery, rangeQuery } from '../../../../server/utils/queries';
|
||||
import { getBucketSize } from '../../helpers/get_bucket_size';
|
||||
import { Setup, SetupTimeRange } from '../../helpers/setup_request';
|
||||
import {
|
||||
|
|
|
@ -27,7 +27,7 @@ import {
|
|||
SERVICE_NAME,
|
||||
} from '../../../common/elasticsearch_fieldnames';
|
||||
import { ProcessorEvent } from '../../../common/processor_event';
|
||||
import { environmentQuery } from '../../../common/utils/queries';
|
||||
import { environmentQuery } from '../../../server/utils/queries';
|
||||
import { getApmIndices } from '../settings/apm_indices/get_apm_indices';
|
||||
import { apmActionVariables } from './action_variables';
|
||||
import { alertingEsClient } from './alerting_es_client';
|
||||
|
|
|
@ -20,7 +20,7 @@ import {
|
|||
} from '../../../common/elasticsearch_fieldnames';
|
||||
import { ProcessorEvent } from '../../../common/processor_event';
|
||||
import { getDurationFormatter } from '../../../common/utils/formatters';
|
||||
import { environmentQuery } from '../../../common/utils/queries';
|
||||
import { environmentQuery } from '../../../server/utils/queries';
|
||||
import { getApmIndices } from '../settings/apm_indices/get_apm_indices';
|
||||
import { apmActionVariables } from './action_variables';
|
||||
import { alertingEsClient } from './alerting_es_client';
|
||||
|
|
|
@ -22,7 +22,7 @@ import {
|
|||
import { EventOutcome } from '../../../common/event_outcome';
|
||||
import { ProcessorEvent } from '../../../common/processor_event';
|
||||
import { asDecimalOrInteger } from '../../../common/utils/formatters';
|
||||
import { environmentQuery } from '../../../common/utils/queries';
|
||||
import { environmentQuery } from '../../../server/utils/queries';
|
||||
import { getApmIndices } from '../settings/apm_indices/get_apm_indices';
|
||||
import { apmActionVariables } from './action_variables';
|
||||
import { alertingEsClient } from './alerting_es_client';
|
||||
|
|
|
@ -11,7 +11,7 @@ import { snakeCase } from 'lodash';
|
|||
import Boom from '@hapi/boom';
|
||||
import { ML_ERRORS } from '../../../common/anomaly_detection';
|
||||
import { ProcessorEvent } from '../../../common/processor_event';
|
||||
import { environmentQuery } from '../../../common/utils/queries';
|
||||
import { environmentQuery } from '../../../server/utils/queries';
|
||||
import { Setup } from '../helpers/setup_request';
|
||||
import {
|
||||
TRANSACTION_DURATION,
|
||||
|
|
|
@ -13,7 +13,11 @@ import {
|
|||
} from '../process_significant_term_aggs';
|
||||
import { AggregationOptionsByType } from '../../../../../../typings/elasticsearch/aggregations';
|
||||
import { ESFilter } from '../../../../../../typings/elasticsearch';
|
||||
import { environmentQuery, rangeQuery } from '../../../../common/utils/queries';
|
||||
import {
|
||||
environmentQuery,
|
||||
rangeQuery,
|
||||
kqlQuery,
|
||||
} from '../../../../server/utils/queries';
|
||||
import {
|
||||
EVENT_OUTCOME,
|
||||
SERVICE_NAME,
|
||||
|
@ -32,6 +36,7 @@ import { withApmSpan } from '../../../utils/with_apm_span';
|
|||
|
||||
export async function getCorrelationsForFailedTransactions({
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
transactionType,
|
||||
transactionName,
|
||||
|
@ -39,6 +44,7 @@ export async function getCorrelationsForFailedTransactions({
|
|||
setup,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
serviceName: string | undefined;
|
||||
transactionType: string | undefined;
|
||||
transactionName: string | undefined;
|
||||
|
@ -46,13 +52,13 @@ export async function getCorrelationsForFailedTransactions({
|
|||
setup: Setup & SetupTimeRange;
|
||||
}) {
|
||||
return withApmSpan('get_correlations_for_failed_transactions', async () => {
|
||||
const { start, end, esFilter, apmEventClient } = setup;
|
||||
const { start, end, apmEventClient } = setup;
|
||||
|
||||
const backgroundFilters: ESFilter[] = [
|
||||
{ term: { [PROCESSOR_EVENT]: ProcessorEvent.transaction } },
|
||||
...rangeQuery(start, end),
|
||||
...environmentQuery(environment),
|
||||
...esFilter,
|
||||
...kqlQuery(kuery),
|
||||
];
|
||||
|
||||
if (serviceName) {
|
||||
|
|
|
@ -7,7 +7,11 @@
|
|||
|
||||
import { AggregationOptionsByType } from '../../../../../../typings/elasticsearch/aggregations';
|
||||
import { ESFilter } from '../../../../../../typings/elasticsearch';
|
||||
import { environmentQuery, rangeQuery } from '../../../../common/utils/queries';
|
||||
import {
|
||||
environmentQuery,
|
||||
rangeQuery,
|
||||
kqlQuery,
|
||||
} from '../../../../server/utils/queries';
|
||||
import {
|
||||
SERVICE_NAME,
|
||||
TRANSACTION_DURATION,
|
||||
|
@ -24,6 +28,7 @@ import { withApmSpan } from '../../../utils/with_apm_span';
|
|||
|
||||
export async function getCorrelationsForSlowTransactions({
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
transactionType,
|
||||
transactionName,
|
||||
|
@ -32,6 +37,7 @@ export async function getCorrelationsForSlowTransactions({
|
|||
setup,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
serviceName: string | undefined;
|
||||
transactionType: string | undefined;
|
||||
transactionName: string | undefined;
|
||||
|
@ -40,13 +46,13 @@ export async function getCorrelationsForSlowTransactions({
|
|||
setup: Setup & SetupTimeRange;
|
||||
}) {
|
||||
return withApmSpan('get_correlations_for_slow_transactions', async () => {
|
||||
const { start, end, esFilter, apmEventClient } = setup;
|
||||
const { start, end, apmEventClient } = setup;
|
||||
|
||||
const backgroundFilters: ESFilter[] = [
|
||||
{ term: { [PROCESSOR_EVENT]: ProcessorEvent.transaction } },
|
||||
...rangeQuery(start, end),
|
||||
...environmentQuery(environment),
|
||||
...esFilter,
|
||||
...kqlQuery(kuery),
|
||||
];
|
||||
|
||||
if (serviceName) {
|
||||
|
|
|
@ -11,7 +11,7 @@ import {
|
|||
} from '../../../common/elasticsearch_fieldnames';
|
||||
import { ENVIRONMENT_NOT_DEFINED } from '../../../common/environment_filter_values';
|
||||
import { ProcessorEvent } from '../../../common/processor_event';
|
||||
import { rangeQuery } from '../../../common/utils/queries';
|
||||
import { rangeQuery } from '../../../server/utils/queries';
|
||||
import { withApmSpan } from '../../utils/with_apm_span';
|
||||
import { getProcessorEventForAggregatedTransactions } from '../helpers/aggregated_transactions';
|
||||
import { Setup, SetupTimeRange } from '../helpers/setup_request';
|
||||
|
|
|
@ -30,11 +30,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
"should": Array [
|
||||
Object {
|
||||
|
@ -117,11 +112,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -192,11 +182,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
|
@ -38,11 +38,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -89,11 +84,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"error.grouping_key": "foo",
|
||||
|
|
|
@ -44,7 +44,6 @@ describe('get buckets', () => {
|
|||
}
|
||||
) as APMConfig,
|
||||
uiFilters: {},
|
||||
esFilter: [],
|
||||
indices: {
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
'apm_oss.sourcemapIndices': 'apm-*',
|
||||
|
|
|
@ -11,30 +11,36 @@ import {
|
|||
SERVICE_NAME,
|
||||
} from '../../../../common/elasticsearch_fieldnames';
|
||||
import { ProcessorEvent } from '../../../../common/processor_event';
|
||||
import { environmentQuery, rangeQuery } from '../../../../common/utils/queries';
|
||||
import {
|
||||
environmentQuery,
|
||||
rangeQuery,
|
||||
kqlQuery,
|
||||
} from '../../../../server/utils/queries';
|
||||
import { withApmSpan } from '../../../utils/with_apm_span';
|
||||
import { Setup, SetupTimeRange } from '../../helpers/setup_request';
|
||||
|
||||
export async function getBuckets({
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
groupId,
|
||||
bucketSize,
|
||||
setup,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
serviceName: string;
|
||||
groupId?: string;
|
||||
bucketSize: number;
|
||||
setup: Setup & SetupTimeRange;
|
||||
}) {
|
||||
return withApmSpan('get_error_distribution_buckets', async () => {
|
||||
const { start, end, esFilter, apmEventClient } = setup;
|
||||
const { start, end, apmEventClient } = setup;
|
||||
const filter: ESFilter[] = [
|
||||
{ term: { [SERVICE_NAME]: serviceName } },
|
||||
...rangeQuery(start, end),
|
||||
...environmentQuery(environment),
|
||||
...esFilter,
|
||||
...kqlQuery(kuery),
|
||||
];
|
||||
|
||||
if (groupId) {
|
||||
|
|
|
@ -15,11 +15,13 @@ function getBucketSize({ start, end }: SetupTimeRange) {
|
|||
|
||||
export async function getErrorDistribution({
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
groupId,
|
||||
setup,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
serviceName: string;
|
||||
groupId?: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
|
@ -27,6 +29,7 @@ export async function getErrorDistribution({
|
|||
const bucketSize = getBucketSize({ start: setup.start, end: setup.end });
|
||||
const { buckets, noHits } = await getBuckets({
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
groupId,
|
||||
bucketSize,
|
||||
|
|
|
@ -11,24 +11,30 @@ import {
|
|||
TRANSACTION_SAMPLED,
|
||||
} from '../../../common/elasticsearch_fieldnames';
|
||||
import { ProcessorEvent } from '../../../common/processor_event';
|
||||
import { environmentQuery, rangeQuery } from '../../../common/utils/queries';
|
||||
import {
|
||||
environmentQuery,
|
||||
rangeQuery,
|
||||
kqlQuery,
|
||||
} from '../../../server/utils/queries';
|
||||
import { withApmSpan } from '../../utils/with_apm_span';
|
||||
import { Setup, SetupTimeRange } from '../helpers/setup_request';
|
||||
import { getTransaction } from '../transactions/get_transaction';
|
||||
|
||||
export function getErrorGroupSample({
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
groupId,
|
||||
setup,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
serviceName: string;
|
||||
groupId: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
}) {
|
||||
return withApmSpan('get_error_group_sample', async () => {
|
||||
const { start, end, esFilter, apmEventClient } = setup;
|
||||
const { start, end, apmEventClient } = setup;
|
||||
|
||||
const params = {
|
||||
apm: {
|
||||
|
@ -43,7 +49,7 @@ export function getErrorGroupSample({
|
|||
{ term: { [ERROR_GROUP_ID]: groupId } },
|
||||
...rangeQuery(start, end),
|
||||
...environmentQuery(environment),
|
||||
...esFilter,
|
||||
...kqlQuery(kuery),
|
||||
],
|
||||
should: [{ term: { [TRANSACTION_SAMPLED]: true } }],
|
||||
},
|
||||
|
|
|
@ -22,12 +22,14 @@ import { Setup, SetupTimeRange } from '../helpers/setup_request';
|
|||
|
||||
export function getErrorGroups({
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
sortField,
|
||||
sortDirection = 'desc',
|
||||
setup,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
serviceName: string;
|
||||
sortField?: string;
|
||||
sortDirection?: 'asc' | 'desc';
|
||||
|
@ -41,6 +43,7 @@ export function getErrorGroups({
|
|||
|
||||
const projection = getErrorGroupsProjection({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { SearchAggregatedTransactionSetting } from '../../../../common/aggregated_transactions';
|
||||
import { rangeQuery } from '../../../../common/utils/queries';
|
||||
import { rangeQuery } from '../../../../server/utils/queries';
|
||||
import { ProcessorEvent } from '../../../../common/processor_event';
|
||||
import {
|
||||
TRANSACTION_DURATION,
|
||||
|
|
|
@ -10,14 +10,12 @@ import { isActivePlatinumLicense } from '../../../common/license_check';
|
|||
import { APMConfig } from '../..';
|
||||
import { KibanaRequest } from '../../../../../../src/core/server';
|
||||
import { UI_SETTINGS } from '../../../../../../src/plugins/data/common';
|
||||
import { ESFilter } from '../../../../../typings/elasticsearch';
|
||||
import { UIFilters } from '../../../typings/ui_filters';
|
||||
import { APMRequestHandlerContext } from '../../routes/typings';
|
||||
import {
|
||||
ApmIndicesConfig,
|
||||
getApmIndices,
|
||||
} from '../settings/apm_indices/get_apm_indices';
|
||||
import { getEsFilter } from './convert_ui_filters/get_es_filter';
|
||||
import {
|
||||
APMEventClient,
|
||||
createApmEventClient,
|
||||
|
@ -38,7 +36,6 @@ export interface Setup {
|
|||
config: APMConfig;
|
||||
indices: ApmIndicesConfig;
|
||||
uiFilters: UIFilters;
|
||||
esFilter: ESFilter[];
|
||||
}
|
||||
|
||||
export interface SetupTimeRange {
|
||||
|
@ -110,7 +107,6 @@ export async function setupRequest<TParams extends SetupRequestParams>(
|
|||
: undefined,
|
||||
config,
|
||||
uiFilters,
|
||||
esFilter: getEsFilter(uiFilters),
|
||||
};
|
||||
|
||||
return {
|
||||
|
|
|
@ -85,11 +85,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -173,11 +168,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"agent.name": "java",
|
||||
|
@ -336,11 +326,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"exists": Object {
|
||||
"field": "system.process.cgroup.memory.mem.usage.bytes",
|
||||
|
@ -429,11 +414,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"agent.name": "java",
|
||||
|
@ -512,11 +492,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"agent.name": "java",
|
||||
|
@ -621,11 +596,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -715,11 +685,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"agent.name": "java",
|
||||
|
@ -884,11 +849,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"exists": Object {
|
||||
"field": "system.process.cgroup.memory.mem.usage.bytes",
|
||||
|
@ -983,11 +943,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"agent.name": "java",
|
||||
|
@ -1072,11 +1027,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"agent.name": "java",
|
||||
|
@ -1170,11 +1120,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -1253,11 +1198,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"agent.name": "java",
|
||||
|
@ -1411,11 +1351,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"exists": Object {
|
||||
"field": "system.process.cgroup.memory.mem.usage.bytes",
|
||||
|
@ -1499,11 +1434,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"agent.name": "java",
|
||||
|
@ -1577,11 +1507,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"agent.name": "java",
|
||||
|
|
|
@ -11,16 +11,18 @@ import { getMemoryChartData } from './shared/memory';
|
|||
|
||||
export async function getDefaultMetricsCharts({
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
setup,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
serviceName: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
}) {
|
||||
const charts = await Promise.all([
|
||||
getCPUChartData({ environment, setup, serviceName }),
|
||||
getMemoryChartData({ environment, setup, serviceName }),
|
||||
getCPUChartData({ environment, kuery, setup, serviceName }),
|
||||
getMemoryChartData({ environment, kuery, setup, serviceName }),
|
||||
]);
|
||||
|
||||
return { charts };
|
||||
|
|
|
@ -23,6 +23,7 @@ import { getVizColorForIndex } from '../../../../../../common/viz_colors';
|
|||
|
||||
export async function fetchAndTransformGcMetrics({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
|
@ -30,6 +31,7 @@ export async function fetchAndTransformGcMetrics({
|
|||
fieldName,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
serviceName: string;
|
||||
serviceNodeName?: string;
|
||||
|
@ -42,6 +44,7 @@ export async function fetchAndTransformGcMetrics({
|
|||
|
||||
const projection = getMetricsProjection({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
|
|
|
@ -34,11 +34,13 @@ const chartBase: ChartBase = {
|
|||
|
||||
function getGcRateChart({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
serviceName: string;
|
||||
serviceNodeName?: string;
|
||||
|
@ -46,6 +48,7 @@ function getGcRateChart({
|
|||
return withApmSpan('get_gc_rate_charts', () =>
|
||||
fetchAndTransformGcMetrics({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
|
|
|
@ -34,11 +34,13 @@ const chartBase: ChartBase = {
|
|||
|
||||
function getGcTimeChart({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
serviceName: string;
|
||||
serviceNodeName?: string;
|
||||
|
@ -46,6 +48,7 @@ function getGcTimeChart({
|
|||
return withApmSpan('get_gc_time_charts', () =>
|
||||
fetchAndTransformGcMetrics({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
|
|
|
@ -54,11 +54,13 @@ const chartBase: ChartBase = {
|
|||
|
||||
export function getHeapMemoryChart({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
serviceName: string;
|
||||
serviceNodeName?: string;
|
||||
|
@ -66,6 +68,7 @@ export function getHeapMemoryChart({
|
|||
return withApmSpan('get_heap_memory_charts', () =>
|
||||
fetchAndTransformMetrics({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
|
|
|
@ -17,29 +17,34 @@ import { getGcTimeChart } from './gc/get_gc_time_chart';
|
|||
|
||||
export function getJavaMetricsCharts({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
serviceName: string;
|
||||
serviceNodeName?: string;
|
||||
}) {
|
||||
return withApmSpan('get_java_system_metric_charts', async () => {
|
||||
const options = {
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
};
|
||||
|
||||
const charts = await Promise.all([
|
||||
getCPUChartData({ environment, setup, serviceName, serviceNodeName }),
|
||||
getMemoryChartData({ environment, setup, serviceName, serviceNodeName }),
|
||||
getHeapMemoryChart({ environment, setup, serviceName, serviceNodeName }),
|
||||
getNonHeapMemoryChart({
|
||||
environment,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
}),
|
||||
getThreadCountChart({ environment, setup, serviceName, serviceNodeName }),
|
||||
getGcRateChart({ environment, setup, serviceName, serviceNodeName }),
|
||||
getGcTimeChart({ environment, setup, serviceName, serviceNodeName }),
|
||||
getCPUChartData(options),
|
||||
getMemoryChartData(options),
|
||||
getHeapMemoryChart(options),
|
||||
getNonHeapMemoryChart(options),
|
||||
getThreadCountChart(options),
|
||||
getGcRateChart(options),
|
||||
getGcTimeChart(options),
|
||||
]);
|
||||
|
||||
return { charts };
|
||||
|
|
|
@ -51,11 +51,13 @@ const chartBase: ChartBase = {
|
|||
|
||||
export async function getNonHeapMemoryChart({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
serviceName: string;
|
||||
serviceNodeName?: string;
|
||||
|
@ -63,6 +65,7 @@ export async function getNonHeapMemoryChart({
|
|||
return withApmSpan('get_non_heap_memory_charts', () =>
|
||||
fetchAndTransformMetrics({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
|
|
|
@ -43,11 +43,13 @@ const chartBase: ChartBase = {
|
|||
|
||||
export async function getThreadCountChart({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
serviceName: string;
|
||||
serviceNodeName?: string;
|
||||
|
@ -55,6 +57,7 @@ export async function getThreadCountChart({
|
|||
return withApmSpan('get_thread_count_charts', () =>
|
||||
fetchAndTransformMetrics({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
|
|
|
@ -55,11 +55,13 @@ const chartBase: ChartBase = {
|
|||
|
||||
export function getCPUChartData({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
serviceName: string;
|
||||
serviceNodeName?: string;
|
||||
|
@ -67,6 +69,7 @@ export function getCPUChartData({
|
|||
return withApmSpan('get_cpu_metric_charts', () =>
|
||||
fetchAndTransformMetrics({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
|
|
|
@ -72,11 +72,13 @@ export const percentCgroupMemoryUsedScript = {
|
|||
|
||||
export async function getMemoryChartData({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
serviceName: string;
|
||||
serviceNodeName?: string;
|
||||
|
@ -87,6 +89,7 @@ export async function getMemoryChartData({
|
|||
() =>
|
||||
fetchAndTransformMetrics({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
|
@ -105,6 +108,7 @@ export async function getMemoryChartData({
|
|||
return await withApmSpan('get_system_memory_metrics_charts', () =>
|
||||
fetchAndTransformMetrics({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
|
|
|
@ -49,6 +49,7 @@ interface Filter {
|
|||
|
||||
export async function fetchAndTransformMetrics<T extends MetricAggs>({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
|
@ -57,6 +58,7 @@ export async function fetchAndTransformMetrics<T extends MetricAggs>({
|
|||
additionalFilters = [],
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
serviceName: string;
|
||||
serviceNodeName?: string;
|
||||
|
@ -68,6 +70,7 @@ export async function fetchAndTransformMetrics<T extends MetricAggs>({
|
|||
|
||||
const projection = getMetricsProjection({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
|
|
|
@ -16,12 +16,14 @@ export interface MetricsChartsByAgentAPIResponse {
|
|||
|
||||
export async function getMetricsChartDataByAgent({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
agentName,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
serviceName: string;
|
||||
serviceNodeName?: string;
|
||||
|
@ -31,6 +33,7 @@ export async function getMetricsChartDataByAgent({
|
|||
case 'java': {
|
||||
return getJavaMetricsCharts({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
|
@ -38,7 +41,12 @@ export async function getMetricsChartDataByAgent({
|
|||
}
|
||||
|
||||
default: {
|
||||
return getDefaultMetricsCharts({ environment, setup, serviceName });
|
||||
return getDefaultMetricsCharts({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import { ProcessorEvent } from '../../../common/processor_event';
|
||||
import { rangeQuery } from '../../../common/utils/queries';
|
||||
import { rangeQuery } from '../../../server/utils/queries';
|
||||
import { SERVICE_NAME } from '../../../common/elasticsearch_fieldnames';
|
||||
import { Setup, SetupTimeRange } from '../helpers/setup_request';
|
||||
import { getProcessorEventForAggregatedTransactions } from '../helpers/aggregated_transactions';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { rangeQuery } from '../../../common/utils/queries';
|
||||
import { rangeQuery } from '../../../server/utils/queries';
|
||||
import { Coordinates } from '../../../../observability/typings/common';
|
||||
import { Setup, SetupTimeRange } from '../helpers/setup_request';
|
||||
import { getProcessorEventForAggregatedTransactions } from '../helpers/aggregated_transactions';
|
||||
|
|
|
@ -58,11 +58,6 @@ Object {
|
|||
"transaction.type": "page-load",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -158,11 +153,6 @@ Object {
|
|||
"service.language.name": "javascript",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -237,11 +227,6 @@ Object {
|
|||
"field": "transaction.marks.navigationTiming.fetchStart",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -507,11 +492,6 @@ Object {
|
|||
"field": "transaction.marks.navigationTiming.fetchStart",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -554,11 +534,6 @@ Object {
|
|||
"transaction.type": "page-load",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -676,11 +651,6 @@ Object {
|
|||
"field": "transaction.marks.navigationTiming.fetchStart",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -727,11 +697,6 @@ Object {
|
|||
"field": "transaction.marks.navigationTiming.fetchStart",
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
|
@ -11,7 +11,7 @@ import {
|
|||
TRANSACTION_TYPE,
|
||||
} from '../../../common/elasticsearch_fieldnames';
|
||||
import { ProcessorEvent } from '../../../common/processor_event';
|
||||
import { rangeQuery } from '../../../common/utils/queries';
|
||||
import { rangeQuery } from '../../../server/utils/queries';
|
||||
import { TRANSACTION_PAGE_LOAD } from '../../../common/transaction_types';
|
||||
|
||||
export async function hasRumData({ setup }: { setup: Setup & SetupTimeRange }) {
|
||||
|
|
|
@ -7,14 +7,10 @@
|
|||
|
||||
import { ESFilter } from '../../../../../../typings/elasticsearch';
|
||||
import { UIFilters } from '../../../../typings/ui_filters';
|
||||
import {
|
||||
localUIFilters,
|
||||
localUIFilterNames,
|
||||
} from '../../rum_client/ui_filters/local_ui_filters/config';
|
||||
import { esKuery } from '../../../../../../../src/plugins/data/server';
|
||||
import { localUIFilters, localUIFilterNames } from './local_ui_filters/config';
|
||||
|
||||
export function getEsFilter(uiFilters: UIFilters) {
|
||||
const { kuery, environment, ...localFilterValues } = uiFilters;
|
||||
const localFilterValues = uiFilters;
|
||||
const mappedFilters = localUIFilterNames
|
||||
.filter((name) => name in localFilterValues)
|
||||
.map((filterName) => {
|
||||
|
@ -27,16 +23,5 @@ export function getEsFilter(uiFilters: UIFilters) {
|
|||
};
|
||||
}) as ESFilter[];
|
||||
|
||||
const esFilters = [...getKueryUiFilterES(uiFilters.kuery), ...mappedFilters];
|
||||
|
||||
return esFilters;
|
||||
}
|
||||
|
||||
function getKueryUiFilterES(kuery?: string) {
|
||||
if (!kuery) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const ast = esKuery.fromKueryExpression(kuery);
|
||||
return [esKuery.toElasticsearchQuery(ast) as ESFilter];
|
||||
return mappedFilters;
|
||||
}
|
|
@ -44,11 +44,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
|
@ -9,7 +9,7 @@ import { omit } from 'lodash';
|
|||
import { mergeProjection } from '../../../../projections/util/merge_projection';
|
||||
import { Projection } from '../../../../projections/typings';
|
||||
import { UIFilters } from '../../../../../typings/ui_filters';
|
||||
import { getEsFilter } from '../../../helpers/convert_ui_filters/get_es_filter';
|
||||
import { getEsFilter } from '../get_es_filter';
|
||||
import { localUIFilters } from './config';
|
||||
import { LocalUIFilterName } from '../../../../../common/ui_filter';
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ describe('getLocalUIFilters', () => {
|
|||
let mock: SearchParamsMock;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.mock('../../../helpers/convert_ui_filters/get_es_filter', () => {
|
||||
jest.mock('../get_es_filter', () => {
|
||||
return [];
|
||||
});
|
||||
});
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { rangeQuery } from '../../../common/utils/queries';
|
||||
import { rangeQuery } from '../../../server/utils/queries';
|
||||
import { ProcessorEvent } from '../../../common/processor_event';
|
||||
import { TRACE_ID } from '../../../common/elasticsearch_fieldnames';
|
||||
import {
|
||||
|
|
|
@ -17,7 +17,7 @@ import {
|
|||
TRANSACTION_PAGE_LOAD,
|
||||
TRANSACTION_REQUEST,
|
||||
} from '../../../common/transaction_types';
|
||||
import { rangeQuery } from '../../../common/utils/queries';
|
||||
import { rangeQuery } from '../../../server/utils/queries';
|
||||
import { withApmSpan } from '../../utils/with_apm_span';
|
||||
import { getMlJobsWithAPMGroup } from '../anomaly_detection/get_ml_jobs_with_apm_group';
|
||||
import { Setup, SetupTimeRange } from '../helpers/setup_request';
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
} from '../../../common/elasticsearch_fieldnames';
|
||||
import { getServicesProjection } from '../../projections/services';
|
||||
import { mergeProjection } from '../../projections/util/merge_projection';
|
||||
import { environmentQuery } from '../../../common/utils/queries';
|
||||
import { environmentQuery } from '../../../server/utils/queries';
|
||||
import { withApmSpan } from '../../utils/with_apm_span';
|
||||
import { Setup, SetupTimeRange } from '../helpers/setup_request';
|
||||
import {
|
||||
|
@ -91,7 +91,7 @@ async function getServicesData(options: IEnvOptions) {
|
|||
const { environment, setup, searchAggregatedTransactions } = options;
|
||||
|
||||
const projection = getServicesProjection({
|
||||
setup: { ...setup, esFilter: [] },
|
||||
setup,
|
||||
searchAggregatedTransactions,
|
||||
});
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ describe('getServiceMapServiceNodeInfo', () => {
|
|||
hits: { total: { value: 0 } },
|
||||
}),
|
||||
},
|
||||
esFilter: [],
|
||||
indices: {},
|
||||
uiFilters: {},
|
||||
} as unknown) as Setup & SetupTimeRange;
|
||||
|
|
|
@ -19,7 +19,7 @@ import {
|
|||
TRANSACTION_PAGE_LOAD,
|
||||
TRANSACTION_REQUEST,
|
||||
} from '../../../common/transaction_types';
|
||||
import { environmentQuery, rangeQuery } from '../../../common/utils/queries';
|
||||
import { environmentQuery, rangeQuery } from '../../../server/utils/queries';
|
||||
import { withApmSpan } from '../../utils/with_apm_span';
|
||||
import {
|
||||
getDocumentTypeFilterForAggregatedTransactions,
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
} from '../../../common/elasticsearch_fieldnames';
|
||||
import { ProcessorEvent } from '../../../common/processor_event';
|
||||
import { SERVICE_MAP_TIMEOUT_ERROR } from '../../../common/service_map';
|
||||
import { environmentQuery, rangeQuery } from '../../../common/utils/queries';
|
||||
import { environmentQuery, rangeQuery } from '../../../server/utils/queries';
|
||||
import { withApmSpan } from '../../utils/with_apm_span';
|
||||
import { Setup, SetupTimeRange } from '../helpers/setup_request';
|
||||
|
||||
|
|
|
@ -49,11 +49,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -117,11 +112,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -186,11 +176,6 @@ Object {
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
|
@ -18,16 +18,18 @@ import { withApmSpan } from '../../utils/with_apm_span';
|
|||
import { Setup, SetupTimeRange } from '../helpers/setup_request';
|
||||
|
||||
const getServiceNodes = ({
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
}: {
|
||||
kuery?: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
serviceName: string;
|
||||
}) => {
|
||||
return withApmSpan('get_service_nodes', async () => {
|
||||
const { apmEventClient } = setup;
|
||||
|
||||
const projection = getServiceNodesProjection({ setup, serviceName });
|
||||
const projection = getServiceNodesProjection({ kuery, setup, serviceName });
|
||||
|
||||
const params = mergeProjection(projection, {
|
||||
body: {
|
||||
|
|
|
@ -191,11 +191,6 @@ Array [
|
|||
},
|
||||
},
|
||||
},
|
||||
Object {
|
||||
"term": Object {
|
||||
"service.environment": "test",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
SERVICE_NAME,
|
||||
SERVICE_VERSION,
|
||||
} from '../../../../common/elasticsearch_fieldnames';
|
||||
import { environmentQuery, rangeQuery } from '../../../../common/utils/queries';
|
||||
import { environmentQuery, rangeQuery } from '../../../../server/utils/queries';
|
||||
import { withApmSpan } from '../../../utils/with_apm_span';
|
||||
import {
|
||||
getDocumentTypeFilterForAggregatedTransactions,
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { ResponseError } from '@elastic/elasticsearch/lib/errors';
|
||||
import { ElasticsearchClient, Logger } from 'kibana/server';
|
||||
import { environmentQuery, rangeQuery } from '../../../../common/utils/queries';
|
||||
import { environmentQuery, rangeQuery } from '../../../../server/utils/queries';
|
||||
import {
|
||||
unwrapEsResponse,
|
||||
WrappedElasticsearchClientError,
|
||||
|
|
|
@ -10,7 +10,7 @@ import {
|
|||
AGENT_NAME,
|
||||
SERVICE_NAME,
|
||||
} from '../../../common/elasticsearch_fieldnames';
|
||||
import { rangeQuery } from '../../../common/utils/queries';
|
||||
import { rangeQuery } from '../../../server/utils/queries';
|
||||
import { Setup, SetupTimeRange } from '../helpers/setup_request';
|
||||
import { getProcessorEventForAggregatedTransactions } from '../helpers/aggregated_transactions';
|
||||
import { withApmSpan } from '../../utils/with_apm_span';
|
||||
|
|
|
@ -20,7 +20,7 @@ import {
|
|||
SPAN_TYPE,
|
||||
} from '../../../../common/elasticsearch_fieldnames';
|
||||
import { ProcessorEvent } from '../../../../common/processor_event';
|
||||
import { environmentQuery, rangeQuery } from '../../../../common/utils/queries';
|
||||
import { environmentQuery, rangeQuery } from '../../../../server/utils/queries';
|
||||
import { joinByKey } from '../../../../common/utils/join_by_key';
|
||||
import { Setup, SetupTimeRange } from '../../helpers/setup_request';
|
||||
import { withApmSpan } from '../../../utils/with_apm_span';
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
SPAN_DESTINATION_SERVICE_RESPONSE_TIME_SUM,
|
||||
} from '../../../../common/elasticsearch_fieldnames';
|
||||
import { ProcessorEvent } from '../../../../common/processor_event';
|
||||
import { environmentQuery, rangeQuery } from '../../../../common/utils/queries';
|
||||
import { environmentQuery, rangeQuery } from '../../../../server/utils/queries';
|
||||
import { getBucketSize } from '../../helpers/get_bucket_size';
|
||||
import { EventOutcome } from '../../../../common/event_outcome';
|
||||
import { Setup, SetupTimeRange } from '../../helpers/setup_request';
|
||||
|
|
|
@ -11,12 +11,17 @@ import {
|
|||
TRANSACTION_TYPE,
|
||||
} from '../../../../common/elasticsearch_fieldnames';
|
||||
import { ProcessorEvent } from '../../../../common/processor_event';
|
||||
import { environmentQuery, rangeQuery } from '../../../../common/utils/queries';
|
||||
import {
|
||||
environmentQuery,
|
||||
rangeQuery,
|
||||
kqlQuery,
|
||||
} from '../../../../server/utils/queries';
|
||||
import { withApmSpan } from '../../../utils/with_apm_span';
|
||||
import { getBucketSize } from '../../helpers/get_bucket_size';
|
||||
import { Setup, SetupTimeRange } from '../../helpers/setup_request';
|
||||
|
||||
export async function getServiceErrorGroupComparisonStatistics({
|
||||
kuery,
|
||||
serviceName,
|
||||
setup,
|
||||
numBuckets,
|
||||
|
@ -24,6 +29,7 @@ export async function getServiceErrorGroupComparisonStatistics({
|
|||
groupIds,
|
||||
environment,
|
||||
}: {
|
||||
kuery?: string;
|
||||
serviceName: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
numBuckets: number;
|
||||
|
@ -34,7 +40,7 @@ export async function getServiceErrorGroupComparisonStatistics({
|
|||
return withApmSpan(
|
||||
'get_service_error_group_comparison_statistics',
|
||||
async () => {
|
||||
const { apmEventClient, start, end, esFilter } = setup;
|
||||
const { apmEventClient, start, end } = setup;
|
||||
|
||||
const { intervalString } = getBucketSize({ start, end, numBuckets });
|
||||
|
||||
|
@ -52,7 +58,7 @@ export async function getServiceErrorGroupComparisonStatistics({
|
|||
{ term: { [TRANSACTION_TYPE]: transactionType } },
|
||||
...rangeQuery(start, end),
|
||||
...environmentQuery(environment),
|
||||
...esFilter,
|
||||
...kqlQuery(kuery),
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
|
@ -14,24 +14,30 @@ import {
|
|||
} from '../../../../common/elasticsearch_fieldnames';
|
||||
import { NOT_AVAILABLE_LABEL } from '../../../../common/i18n';
|
||||
import { ProcessorEvent } from '../../../../common/processor_event';
|
||||
import { environmentQuery, rangeQuery } from '../../../../common/utils/queries';
|
||||
import {
|
||||
environmentQuery,
|
||||
rangeQuery,
|
||||
kqlQuery,
|
||||
} from '../../../../server/utils/queries';
|
||||
import { withApmSpan } from '../../../utils/with_apm_span';
|
||||
import { getErrorName } from '../../helpers/get_error_name';
|
||||
import { Setup, SetupTimeRange } from '../../helpers/setup_request';
|
||||
|
||||
export function getServiceErrorGroupPrimaryStatistics({
|
||||
kuery,
|
||||
serviceName,
|
||||
setup,
|
||||
transactionType,
|
||||
environment,
|
||||
}: {
|
||||
kuery?: string;
|
||||
serviceName: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
transactionType: string;
|
||||
environment?: string;
|
||||
}) {
|
||||
return withApmSpan('get_service_error_group_primary_statistics', async () => {
|
||||
const { apmEventClient, start, end, esFilter } = setup;
|
||||
const { apmEventClient, start, end } = setup;
|
||||
|
||||
const response = await apmEventClient.search({
|
||||
apm: {
|
||||
|
@ -46,7 +52,7 @@ export function getServiceErrorGroupPrimaryStatistics({
|
|||
{ term: { [TRANSACTION_TYPE]: transactionType } },
|
||||
...rangeQuery(start, end),
|
||||
...environmentQuery(environment),
|
||||
...esFilter,
|
||||
...kqlQuery(kuery),
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
|
@ -9,7 +9,11 @@ import { ValuesType } from 'utility-types';
|
|||
import { orderBy } from 'lodash';
|
||||
import { NOT_AVAILABLE_LABEL } from '../../../../common/i18n';
|
||||
import { PromiseReturnType } from '../../../../../observability/typings/common';
|
||||
import { environmentQuery, rangeQuery } from '../../../../common/utils/queries';
|
||||
import {
|
||||
environmentQuery,
|
||||
rangeQuery,
|
||||
kqlQuery,
|
||||
} from '../../../../server/utils/queries';
|
||||
import { ProcessorEvent } from '../../../../common/processor_event';
|
||||
import {
|
||||
ERROR_EXC_MESSAGE,
|
||||
|
@ -29,6 +33,7 @@ export type ServiceErrorGroupItem = ValuesType<
|
|||
|
||||
export async function getServiceErrorGroups({
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
setup,
|
||||
size,
|
||||
|
@ -39,6 +44,7 @@ export async function getServiceErrorGroups({
|
|||
transactionType,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
serviceName: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
size: number;
|
||||
|
@ -49,7 +55,7 @@ export async function getServiceErrorGroups({
|
|||
transactionType: string;
|
||||
}) {
|
||||
return withApmSpan('get_service_error_groups', async () => {
|
||||
const { apmEventClient, start, end, esFilter } = setup;
|
||||
const { apmEventClient, start, end } = setup;
|
||||
|
||||
const { intervalString } = getBucketSize({ start, end, numBuckets });
|
||||
|
||||
|
@ -67,7 +73,7 @@ export async function getServiceErrorGroups({
|
|||
{ term: { [TRANSACTION_TYPE]: transactionType } },
|
||||
...rangeQuery(start, end),
|
||||
...environmentQuery(environment),
|
||||
...esFilter,
|
||||
...kqlQuery(kuery),
|
||||
],
|
||||
},
|
||||
},
|
||||
|
@ -150,7 +156,7 @@ export async function getServiceErrorGroups({
|
|||
{ term: { [TRANSACTION_TYPE]: transactionType } },
|
||||
...rangeQuery(start, end),
|
||||
...environmentQuery(environment),
|
||||
...esFilter,
|
||||
...kqlQuery(kuery),
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
|
@ -6,7 +6,11 @@
|
|||
*/
|
||||
|
||||
import { AggregationOptionsByType } from '../../../../../../typings/elasticsearch';
|
||||
import { environmentQuery, rangeQuery } from '../../../../common/utils/queries';
|
||||
import {
|
||||
environmentQuery,
|
||||
rangeQuery,
|
||||
kqlQuery,
|
||||
} from '../../../../server/utils/queries';
|
||||
import { SERVICE_NODE_NAME_MISSING } from '../../../../common/service_nodes';
|
||||
import {
|
||||
METRIC_CGROUP_MEMORY_USAGE_BYTES,
|
||||
|
@ -27,13 +31,14 @@ import { withApmSpan } from '../../../utils/with_apm_span';
|
|||
|
||||
export async function getServiceInstanceSystemMetricStats({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
size,
|
||||
numBuckets,
|
||||
}: ServiceInstanceParams) {
|
||||
return withApmSpan('get_service_instance_system_metric_stats', async () => {
|
||||
const { apmEventClient, start, end, esFilter } = setup;
|
||||
const { apmEventClient, start, end } = setup;
|
||||
|
||||
const { intervalString } = getBucketSize({ start, end, numBuckets });
|
||||
|
||||
|
@ -99,7 +104,7 @@ export async function getServiceInstanceSystemMetricStats({
|
|||
{ term: { [SERVICE_NAME]: serviceName } },
|
||||
...rangeQuery(start, end),
|
||||
...environmentQuery(environment),
|
||||
...esFilter,
|
||||
...kqlQuery(kuery),
|
||||
],
|
||||
should: [cgroupMemoryFilter, systemMemoryFilter, cpuUsageFilter],
|
||||
minimum_should_match: 1,
|
||||
|
|
|
@ -6,7 +6,11 @@
|
|||
*/
|
||||
|
||||
import { EventOutcome } from '../../../../common/event_outcome';
|
||||
import { environmentQuery, rangeQuery } from '../../../../common/utils/queries';
|
||||
import {
|
||||
environmentQuery,
|
||||
rangeQuery,
|
||||
kqlQuery,
|
||||
} from '../../../../server/utils/queries';
|
||||
import { SERVICE_NODE_NAME_MISSING } from '../../../../common/service_nodes';
|
||||
import {
|
||||
EVENT_OUTCOME,
|
||||
|
@ -29,6 +33,7 @@ import {
|
|||
|
||||
export async function getServiceInstanceTransactionStats({
|
||||
environment,
|
||||
kuery,
|
||||
latencyAggregationType,
|
||||
setup,
|
||||
transactionType,
|
||||
|
@ -38,7 +43,7 @@ export async function getServiceInstanceTransactionStats({
|
|||
numBuckets,
|
||||
}: ServiceInstanceParams) {
|
||||
return withApmSpan('get_service_instance_transaction_stats', async () => {
|
||||
const { apmEventClient, start, end, esFilter } = setup;
|
||||
const { apmEventClient, start, end } = setup;
|
||||
|
||||
const { intervalString, bucketSize } = getBucketSize({
|
||||
start,
|
||||
|
@ -78,7 +83,7 @@ export async function getServiceInstanceTransactionStats({
|
|||
{ term: { [TRANSACTION_TYPE]: transactionType } },
|
||||
...rangeQuery(start, end),
|
||||
...environmentQuery(environment),
|
||||
...esFilter,
|
||||
...kqlQuery(kuery),
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
|
@ -14,6 +14,7 @@ import { getServiceInstanceTransactionStats } from './get_service_instance_trans
|
|||
|
||||
export interface ServiceInstanceParams {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
latencyAggregationType: LatencyAggregationType;
|
||||
setup: Setup & SetupTimeRange;
|
||||
serviceName: string;
|
||||
|
|
|
@ -21,7 +21,7 @@ import {
|
|||
SERVICE_VERSION,
|
||||
} from '../../../common/elasticsearch_fieldnames';
|
||||
import { ContainerType } from '../../../common/service_metadata';
|
||||
import { rangeQuery } from '../../../common/utils/queries';
|
||||
import { rangeQuery } from '../../../server/utils/queries';
|
||||
import { TransactionRaw } from '../../../typings/es_schemas/raw/transaction_raw';
|
||||
import { getProcessorEventForAggregatedTransactions } from '../helpers/aggregated_transactions';
|
||||
import { Setup, SetupTimeRange } from '../helpers/setup_request';
|
||||
|
|
|
@ -16,7 +16,7 @@ import {
|
|||
HOST_OS_PLATFORM,
|
||||
} from '../../../common/elasticsearch_fieldnames';
|
||||
import { ContainerType } from '../../../common/service_metadata';
|
||||
import { rangeQuery } from '../../../common/utils/queries';
|
||||
import { rangeQuery } from '../../../server/utils/queries';
|
||||
import { TransactionRaw } from '../../../typings/es_schemas/raw/transaction_raw';
|
||||
import { getProcessorEventForAggregatedTransactions } from '../helpers/aggregated_transactions';
|
||||
import { Setup, SetupTimeRange } from '../helpers/setup_request';
|
||||
|
|
|
@ -16,10 +16,12 @@ import { getServiceNodesProjection } from '../../projections/service_nodes';
|
|||
import { withApmSpan } from '../../utils/with_apm_span';
|
||||
|
||||
export function getServiceNodeMetadata({
|
||||
kuery,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
setup,
|
||||
}: {
|
||||
kuery?: string;
|
||||
serviceName: string;
|
||||
serviceNodeName: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
|
@ -29,6 +31,7 @@ export function getServiceNodeMetadata({
|
|||
|
||||
const query = mergeProjection(
|
||||
getServiceNodesProjection({
|
||||
kuery,
|
||||
setup,
|
||||
serviceName,
|
||||
serviceNodeName,
|
||||
|
|
|
@ -14,7 +14,11 @@ import {
|
|||
} from '../../../common/elasticsearch_fieldnames';
|
||||
import { EventOutcome } from '../../../common/event_outcome';
|
||||
import { LatencyAggregationType } from '../../../common/latency_aggregation_types';
|
||||
import { environmentQuery, rangeQuery } from '../../../common/utils/queries';
|
||||
import {
|
||||
environmentQuery,
|
||||
rangeQuery,
|
||||
kqlQuery,
|
||||
} from '../../../server/utils/queries';
|
||||
import { Coordinate } from '../../../typings/timeseries';
|
||||
import { withApmSpan } from '../../utils/with_apm_span';
|
||||
import {
|
||||
|
@ -32,6 +36,7 @@ import { calculateTransactionErrorPercentage } from '../helpers/transaction_erro
|
|||
|
||||
export async function getServiceTransactionGroupComparisonStatistics({
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
transactionNames,
|
||||
setup,
|
||||
|
@ -41,6 +46,7 @@ export async function getServiceTransactionGroupComparisonStatistics({
|
|||
latencyAggregationType,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
serviceName: string;
|
||||
transactionNames: string[];
|
||||
setup: Setup & SetupTimeRange;
|
||||
|
@ -62,7 +68,7 @@ export async function getServiceTransactionGroupComparisonStatistics({
|
|||
return withApmSpan(
|
||||
'get_service_transaction_group_comparison_statistics',
|
||||
async () => {
|
||||
const { apmEventClient, start, end, esFilter } = setup;
|
||||
const { apmEventClient, start, end } = setup;
|
||||
const { intervalString } = getBucketSize({ start, end, numBuckets });
|
||||
|
||||
const field = getTransactionDurationFieldForAggregatedTransactions(
|
||||
|
@ -89,7 +95,7 @@ export async function getServiceTransactionGroupComparisonStatistics({
|
|||
),
|
||||
...rangeQuery(start, end),
|
||||
...environmentQuery(environment),
|
||||
...esFilter,
|
||||
...kqlQuery(kuery),
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
|
@ -13,7 +13,11 @@ import {
|
|||
} from '../../../common/elasticsearch_fieldnames';
|
||||
import { EventOutcome } from '../../../common/event_outcome';
|
||||
import { LatencyAggregationType } from '../../../common/latency_aggregation_types';
|
||||
import { environmentQuery, rangeQuery } from '../../../common/utils/queries';
|
||||
import {
|
||||
environmentQuery,
|
||||
rangeQuery,
|
||||
kqlQuery,
|
||||
} from '../../../server/utils/queries';
|
||||
import { withApmSpan } from '../../utils/with_apm_span';
|
||||
import {
|
||||
getDocumentTypeFilterForAggregatedTransactions,
|
||||
|
@ -37,6 +41,7 @@ export type ServiceOverviewTransactionGroupSortField =
|
|||
|
||||
export async function getServiceTransactionGroups({
|
||||
environment,
|
||||
kuery,
|
||||
serviceName,
|
||||
setup,
|
||||
searchAggregatedTransactions,
|
||||
|
@ -44,6 +49,7 @@ export async function getServiceTransactionGroups({
|
|||
latencyAggregationType,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
serviceName: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
searchAggregatedTransactions: boolean;
|
||||
|
@ -51,7 +57,7 @@ export async function getServiceTransactionGroups({
|
|||
latencyAggregationType: LatencyAggregationType;
|
||||
}) {
|
||||
return withApmSpan('get_service_transaction_groups', async () => {
|
||||
const { apmEventClient, start, end, esFilter } = setup;
|
||||
const { apmEventClient, start, end } = setup;
|
||||
|
||||
const field = getTransactionDurationFieldForAggregatedTransactions(
|
||||
searchAggregatedTransactions
|
||||
|
@ -77,7 +83,7 @@ export async function getServiceTransactionGroups({
|
|||
),
|
||||
...rangeQuery(start, end),
|
||||
...environmentQuery(environment),
|
||||
...esFilter,
|
||||
...kqlQuery(kuery),
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
|
@ -9,7 +9,7 @@ import {
|
|||
SERVICE_NAME,
|
||||
TRANSACTION_TYPE,
|
||||
} from '../../../common/elasticsearch_fieldnames';
|
||||
import { rangeQuery } from '../../../common/utils/queries';
|
||||
import { rangeQuery } from '../../../server/utils/queries';
|
||||
import { Setup, SetupTimeRange } from '../helpers/setup_request';
|
||||
import {
|
||||
getDocumentTypeFilterForAggregatedTransactions,
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { rangeQuery } from '../../../../common/utils/queries';
|
||||
import { rangeQuery } from '../../../../server/utils/queries';
|
||||
import { ProcessorEvent } from '../../../../common/processor_event';
|
||||
import { OBSERVER_VERSION_MAJOR } from '../../../../common/elasticsearch_fieldnames';
|
||||
import { Setup, SetupTimeRange } from '../../helpers/setup_request';
|
||||
|
|
|
@ -15,7 +15,11 @@ import {
|
|||
TRANSACTION_PAGE_LOAD,
|
||||
TRANSACTION_REQUEST,
|
||||
} from '../../../../common/transaction_types';
|
||||
import { environmentQuery, rangeQuery } from '../../../../common/utils/queries';
|
||||
import {
|
||||
environmentQuery,
|
||||
rangeQuery,
|
||||
kqlQuery,
|
||||
} from '../../../../server/utils/queries';
|
||||
import { AgentName } from '../../../../typings/es_schemas/ui/fields/agent';
|
||||
import {
|
||||
getDocumentTypeFilterForAggregatedTransactions,
|
||||
|
@ -33,6 +37,7 @@ import { withApmSpan } from '../../../utils/with_apm_span';
|
|||
|
||||
interface AggregationParams {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
setup: ServicesItemsSetup;
|
||||
searchAggregatedTransactions: boolean;
|
||||
}
|
||||
|
@ -41,11 +46,12 @@ const MAX_NUMBER_OF_SERVICES = 500;
|
|||
|
||||
export async function getServiceTransactionStats({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
searchAggregatedTransactions,
|
||||
}: AggregationParams) {
|
||||
return withApmSpan('get_service_transaction_stats', async () => {
|
||||
const { apmEventClient, start, end, esFilter } = setup;
|
||||
const { apmEventClient, start, end } = setup;
|
||||
|
||||
const outcomes = getOutcomeAggregation();
|
||||
|
||||
|
@ -78,7 +84,7 @@ export async function getServiceTransactionStats({
|
|||
),
|
||||
...rangeQuery(start, end),
|
||||
...environmentQuery(environment),
|
||||
...esFilter,
|
||||
...kqlQuery(kuery),
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
|
@ -17,11 +17,13 @@ export type ServicesItemsSetup = Setup & SetupTimeRange;
|
|||
|
||||
export async function getServicesItems({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
searchAggregatedTransactions,
|
||||
logger,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
setup: ServicesItemsSetup;
|
||||
searchAggregatedTransactions: boolean;
|
||||
logger: Logger;
|
||||
|
@ -29,7 +31,9 @@ export async function getServicesItems({
|
|||
return withApmSpan('get_services_items', async () => {
|
||||
const params = {
|
||||
environment,
|
||||
kuery,
|
||||
projection: getServicesProjection({
|
||||
kuery,
|
||||
setup,
|
||||
searchAggregatedTransactions,
|
||||
}),
|
||||
|
|
|
@ -15,11 +15,13 @@ import { hasHistoricalAgentData } from './has_historical_agent_data';
|
|||
|
||||
export async function getServices({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
searchAggregatedTransactions,
|
||||
logger,
|
||||
}: {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
searchAggregatedTransactions: boolean;
|
||||
logger: Logger;
|
||||
|
@ -28,6 +30,7 @@ export async function getServices({
|
|||
const [items, hasLegacyData] = await Promise.all([
|
||||
getServicesItems({
|
||||
environment,
|
||||
kuery,
|
||||
setup,
|
||||
searchAggregatedTransactions,
|
||||
logger,
|
||||
|
|
|
@ -10,7 +10,11 @@ import {
|
|||
SERVICE_NAME,
|
||||
TRANSACTION_TYPE,
|
||||
} from '../../../common/elasticsearch_fieldnames';
|
||||
import { environmentQuery, rangeQuery } from '../../../common/utils/queries';
|
||||
import {
|
||||
environmentQuery,
|
||||
rangeQuery,
|
||||
kqlQuery,
|
||||
} from '../../../server/utils/queries';
|
||||
import {
|
||||
getDocumentTypeFilterForAggregatedTransactions,
|
||||
getProcessorEventForAggregatedTransactions,
|
||||
|
@ -21,6 +25,7 @@ import { withApmSpan } from '../../utils/with_apm_span';
|
|||
|
||||
interface Options {
|
||||
environment?: string;
|
||||
kuery?: string;
|
||||
searchAggregatedTransactions: boolean;
|
||||
serviceName: string;
|
||||
setup: Setup;
|
||||
|
@ -31,6 +36,7 @@ interface Options {
|
|||
|
||||
function fetcher({
|
||||
environment,
|
||||
kuery,
|
||||
searchAggregatedTransactions,
|
||||
serviceName,
|
||||
setup,
|
||||
|
@ -38,7 +44,7 @@ function fetcher({
|
|||
start,
|
||||
end,
|
||||
}: Options) {
|
||||
const { esFilter, apmEventClient } = setup;
|
||||
const { apmEventClient } = setup;
|
||||
const { intervalString } = getBucketSize({ start, end });
|
||||
const filter: ESFilter[] = [
|
||||
{ term: { [SERVICE_NAME]: serviceName } },
|
||||
|
@ -48,7 +54,7 @@ function fetcher({
|
|||
),
|
||||
...rangeQuery(start, end),
|
||||
...environmentQuery(environment),
|
||||
...esFilter,
|
||||
...kqlQuery(kuery),
|
||||
];
|
||||
|
||||
const params = {
|
||||
|
|
|
@ -21,7 +21,11 @@ import {
|
|||
PROFILE_TOP_ID,
|
||||
SERVICE_NAME,
|
||||
} from '../../../../common/elasticsearch_fieldnames';
|
||||
import { rangeQuery, environmentQuery } from '../../../../common/utils/queries';
|
||||
import {
|
||||
rangeQuery,
|
||||
environmentQuery,
|
||||
kqlQuery,
|
||||
} from '../../../../server/utils/queries';
|
||||
import { APMEventClient } from '../../helpers/create_es_client/create_apm_event_client';
|
||||
import { Setup, SetupTimeRange } from '../../helpers/setup_request';
|
||||
import { withApmSpan } from '../../../utils/with_apm_span';
|
||||
|
@ -184,12 +188,14 @@ function getProfilesWithStacks({
|
|||
}
|
||||
|
||||
export async function getServiceProfilingStatistics({
|
||||
kuery,
|
||||
serviceName,
|
||||
setup,
|
||||
environment,
|
||||
valueType,
|
||||
logger,
|
||||
}: {
|
||||
kuery?: string;
|
||||
serviceName: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
environment?: string;
|
||||
|
@ -202,11 +208,11 @@ export async function getServiceProfilingStatistics({
|
|||
const valueTypeField = getValueTypeConfig(valueType).field;
|
||||
|
||||
const filter: ESFilter[] = [
|
||||
...rangeQuery(start, end),
|
||||
{ term: { [SERVICE_NAME]: serviceName } },
|
||||
...environmentQuery(environment),
|
||||
{ exists: { field: valueTypeField } },
|
||||
...setup.esFilter,
|
||||
...rangeQuery(start, end),
|
||||
...environmentQuery(environment),
|
||||
...kqlQuery(kuery),
|
||||
];
|
||||
|
||||
const [profileStats, profileStacks] = await Promise.all([
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
import { mapKeys, mapValues } from 'lodash';
|
||||
import { rangeQuery, environmentQuery } from '../../../../common/utils/queries';
|
||||
import { rangeQuery, environmentQuery } from '../../../../server/utils/queries';
|
||||
import { ProcessorEvent } from '../../../../common/processor_event';
|
||||
import {
|
||||
PROFILE_ID,
|
||||
|
@ -18,6 +18,7 @@ import {
|
|||
import { Setup, SetupTimeRange } from '../../helpers/setup_request';
|
||||
import { getBucketSize } from '../../helpers/get_bucket_size';
|
||||
import { withApmSpan } from '../../../utils/with_apm_span';
|
||||
import { kqlQuery } from '../../../utils/queries';
|
||||
|
||||
const configMap = mapValues(
|
||||
mapKeys(ProfilingValueType, (val, key) => val),
|
||||
|
@ -27,16 +28,18 @@ const configMap = mapValues(
|
|||
const allFields = Object.values(configMap).map((config) => config.field);
|
||||
|
||||
export async function getServiceProfilingTimeline({
|
||||
kuery,
|
||||
serviceName,
|
||||
environment,
|
||||
setup,
|
||||
}: {
|
||||
kuery?: string;
|
||||
serviceName: string;
|
||||
setup: Setup & SetupTimeRange;
|
||||
environment?: string;
|
||||
}) {
|
||||
return withApmSpan('get_service_profiling_timeline', async () => {
|
||||
const { apmEventClient, start, end, esFilter } = setup;
|
||||
const { apmEventClient, start, end } = setup;
|
||||
|
||||
const response = await apmEventClient.search({
|
||||
apm: {
|
||||
|
@ -50,7 +53,7 @@ export async function getServiceProfilingTimeline({
|
|||
{ term: { [SERVICE_NAME]: serviceName } },
|
||||
...rangeQuery(start, end),
|
||||
...environmentQuery(environment),
|
||||
...esFilter,
|
||||
...kqlQuery(kuery),
|
||||
],
|
||||
},
|
||||
},
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue