Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
43f55a5
[APM] Optimize service overview queries
dgieselaar Jun 22, 2020
da21e45
Merge branch 'master' of github.com:elastic/kibana into optimize-serv…
dgieselaar Jun 27, 2020
f774b47
Review feedback
dgieselaar Jun 27, 2020
068c170
Use correct indices/filters for service overview metrics
dgieselaar Jun 27, 2020
2b1f4c3
[APM] Optimize traces overview
dgieselaar Jun 29, 2020
e7ac578
Separate queries into separate file
dgieselaar Jun 29, 2020
bfac5c2
Support union types for aggregations
dgieselaar Jun 29, 2020
43bec06
Merge branch 'master' of github.com:elastic/kibana into optimize-trac…
dgieselaar Jun 29, 2020
0546489
Merge branch 'master' of github.com:elastic/kibana into optimize-serv…
dgieselaar Jun 29, 2020
03e40a7
Merge branch 'master' of github.com:elastic/kibana into optimize-serv…
dgieselaar Jun 30, 2020
fcf18b2
Merge branch 'master' of github.com:elastic/kibana into optimize-trac…
dgieselaar Jun 30, 2020
ca17e1e
[APM] Don't fetch dynamic index pattern in setupRequest
dgieselaar Jun 30, 2020
0970198
Merge branch 'remove-dynamic-index-pattern' into apm-events
dgieselaar Jun 30, 2020
4b201c2
Merge branch 'master' into remove-dynamic-index-pattern
elasticmachine Jun 30, 2020
5e14e42
use join utility function to merge requests
dgieselaar Jun 30, 2020
b180c1b
Merge branch 'master' of github.com:elastic/kibana into optimize-serv…
dgieselaar Jun 30, 2020
fd73424
Merge branch 'master' of github.com:elastic/kibana into optimize-trac…
dgieselaar Jun 30, 2020
e9ee799
Merge branch 'master' of github.com:elastic/kibana into remove-dynami…
dgieselaar Jun 30, 2020
1affcdf
Merge branch 'remove-dynamic-index-pattern' of github.com:dgieselaar/…
dgieselaar Jun 30, 2020
54cfa13
Correct path for UI_SETTINGS import
dgieselaar Jun 30, 2020
129aeab
Merge branch 'optimize-services-overview' into apm-events
dgieselaar Jun 30, 2020
67a177a
Merge branch 'optimize-traces-overview' into apm-events
dgieselaar Jun 30, 2020
3343936
Merge branch 'remove-dynamic-index-pattern' into apm-events
dgieselaar Jun 30, 2020
7a689ba
Merge branch 'master' of github.com:elastic/kibana into apm-events
dgieselaar Jun 30, 2020
83326f2
Query transaction indices in getEnvironments()
dgieselaar Jul 1, 2020
40e28f9
Merge branch 'optimize-services-overview' into apm-events
dgieselaar Jul 1, 2020
e9f6448
Merge branch 'master' of github.com:elastic/kibana into apm-events
dgieselaar Jul 1, 2020
7af5b9f
[APM] Introduce apm.types
dgieselaar Jul 1, 2020
1c1d526
Merge branch 'master' of github.com:elastic/kibana into optimize-serv…
dgieselaar Jul 1, 2020
f80ff38
Merge branch 'master' of github.com:elastic/kibana into optimize-trac…
dgieselaar Jul 1, 2020
a645758
Set size of terms agg on error rate aggregation
dgieselaar Jul 2, 2020
f5d2b0b
Merge branch 'optimize-services-overview' into apm-events
dgieselaar Jul 2, 2020
3227847
Merge branch 'master' of github.com:elastic/kibana into apm-events
dgieselaar Jul 2, 2020
602b659
Merge branch 'master' of github.com:elastic/kibana into apm-events
dgieselaar Jul 2, 2020
fd9bfd1
Use separate clients for apm events and other uses
dgieselaar Jul 3, 2020
0395763
Merge branch 'master' of github.com:elastic/kibana into optimize-trac…
dgieselaar Jul 3, 2020
dff5fdc
Separate function for calculating relative impact
dgieselaar Jul 3, 2020
5db9fe2
Merge branch 'optimize-traces-overview' into apm-events
dgieselaar Jul 3, 2020
30d8fef
use UIProcessorEvent type in IURLParams type
dgieselaar Jul 3, 2020
00a0a75
Remove unused import
dgieselaar Jul 3, 2020
aa5de09
Use cloneDeep in apmEventClient.search
dgieselaar Jul 5, 2020
c50a08a
Merge branch 'master' of github.com:elastic/kibana into apm-events
dgieselaar Jul 5, 2020
5126db9
Merge branch 'master' of github.com:elastic/kibana into optimize-trac…
dgieselaar Jul 5, 2020
804df26
Merge branch 'master' into optimize-traces-overview
elasticmachine Jul 6, 2020
620c784
Merge branch 'optimize-traces-overview' into apm-events
dgieselaar Jul 6, 2020
1b65979
Merge branch 'optimize-traces-overview' into apm-events
dgieselaar Jul 6, 2020
6bf8dbb
Merge branch 'master' into optimize-traces-overview
elasticmachine Jul 6, 2020
0bee339
Merge branch 'master' into optimize-traces-overview
elasticmachine Jul 8, 2020
381304f
Merge branch 'master' of github.com:elastic/kibana into optimize-trac…
dgieselaar Jul 9, 2020
a13cfc6
Merge branch 'master' of github.com:elastic/kibana into optimize-trac…
dgieselaar Jul 27, 2020
9fb2d12
Update traces functional test
dgieselaar Jul 27, 2020
ccf9654
Update API tests
dgieselaar Jul 27, 2020
b040a40
Update responses for functional tests
dgieselaar Jul 27, 2020
861cf63
Merge branch 'optimize-traces-overview' of github.com:dgieselaar/kiba…
dgieselaar Jul 27, 2020
72eb667
Merge branch 'master' of github.com:elastic/kibana into optimize-trac…
dgieselaar Jul 28, 2020
a86551b
Review feedback
dgieselaar Jul 28, 2020
acd8a10
Merge branch 'optimize-traces-overview' into apm-events
dgieselaar Jul 28, 2020
3ed5ad6
Merge branch 'master' of github.com:elastic/kibana into apm-events
dgieselaar Jul 28, 2020
600cf6e
Merge branch 'master' into apm-events
elasticmachine Jul 29, 2020
edbdf8b
Merge remote-tracking branch 'upstream/master' into apm-events
dgieselaar Jul 30, 2020
d1a37e8
Merge branch 'master' of github.com:elastic/kibana into apm-events
dgieselaar Jul 31, 2020
50ef730
Review feedback
dgieselaar Jul 31, 2020
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
14 changes: 14 additions & 0 deletions x-pack/plugins/apm/common/processor_event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,18 @@ export enum ProcessorEvent {
transaction = 'transaction',
error = 'error',
metric = 'metric',
span = 'span',
onboarding = 'onboarding',
sourcemap = 'sourcemap',
}
/**
* Processor events that are searchable in the UI via the query bar.
*
* Some client-sideroutes will define 1 or more processor events that
* will be used to fetch the dynamic index pattern for the query bar.
*/

export type UIProcessorEvent =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we put a JSDoc comment on here explaining what this means and what it's used for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

| ProcessorEvent.transaction
| ProcessorEvent.error
| ProcessorEvent.metric;
16 changes: 16 additions & 0 deletions x-pack/plugins/apm/common/projections.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

export enum Projection {
services = 'services',
transactionGroups = 'transactionGroups',
traces = 'traces',
transactions = 'transactions',
metrics = 'metrics',
errorGroups = 'errorGroups',
serviceNodes = 'serviceNodes',
rumOverview = 'rumOverview',
}
64 changes: 0 additions & 64 deletions x-pack/plugins/apm/common/projections/services.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
import { i18n } from '@kbn/i18n';
import React, { useMemo } from 'react';
import { useTrackPageview } from '../../../../../observability/public';
import { PROJECTION } from '../../../../common/projections/typings';
import { Projection } from '../../../../common/projections';
import { useFetcher } from '../../../hooks/useFetcher';
import { useUrlParams } from '../../../hooks/useUrlParams';
import { callApmApi } from '../../../services/rest/createCallApmApi';
Expand Down Expand Up @@ -79,7 +79,7 @@ function ErrorGroupOverview() {
params: {
serviceName,
},
projection: PROJECTION.ERROR_GROUPS,
projection: Projection.errorGroups,
};

return config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from '@elastic/eui';
import { useTrackPageview } from '../../../../../observability/public';
import { LocalUIFilters } from '../../shared/LocalUIFilters';
import { PROJECTION } from '../../../../common/projections/typings';
import { Projection } from '../../../../common/projections';
import { RumDashboard } from './RumDashboard';
import { ServiceNameFilter } from '../../shared/LocalUIFilters/ServiceNameFilter';
import { useUrlParams } from '../../../hooks/useUrlParams';
Expand All @@ -28,7 +28,7 @@ export function RumOverview() {
const localUIFiltersConfig = useMemo(() => {
const config: React.ComponentProps<typeof LocalUIFilters> = {
filterNames: ['transactionUrl', 'location', 'device', 'os', 'browser'],
projection: PROJECTION.RUM_OVERVIEW,
projection: Projection.rumOverview,
};

return config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { useServiceMetricCharts } from '../../../hooks/useServiceMetricCharts';
import { MetricsChart } from '../../shared/charts/MetricsChart';
import { useUrlParams } from '../../../hooks/useUrlParams';
import { ChartsSyncContextProvider } from '../../../context/ChartsSyncContext';
import { PROJECTION } from '../../../../common/projections/typings';
import { Projection } from '../../../../common/projections';
import { LocalUIFilters } from '../../shared/LocalUIFilters';

interface ServiceMetricsProps {
Expand All @@ -36,7 +36,7 @@ export function ServiceMetrics({ agentName }: ServiceMetricsProps) {
serviceName,
serviceNodeName,
},
projection: PROJECTION.METRICS,
projection: Projection.metrics,
showCount: false,
}),
[serviceName, serviceNodeName]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { i18n } from '@kbn/i18n';
import styled from 'styled-components';
import { UNIDENTIFIED_SERVICE_NODES_LABEL } from '../../../../common/i18n';
import { SERVICE_NODE_NAME_MISSING } from '../../../../common/service_nodes';
import { PROJECTION } from '../../../../common/projections/typings';
import { Projection } from '../../../../common/projections';
import { LocalUIFilters } from '../../shared/LocalUIFilters';
import { useUrlParams } from '../../../hooks/useUrlParams';
import { ManagedTable, ITableColumn } from '../../shared/ManagedTable';
Expand Down Expand Up @@ -46,7 +46,7 @@ function ServiceNodeOverview() {
params: {
serviceName,
},
projection: PROJECTION.SERVICE_NODES,
projection: Projection.serviceNodes,
}),
[serviceName]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { NoServicesMessage } from './NoServicesMessage';
import { ServiceList } from './ServiceList';
import { useUrlParams } from '../../../hooks/useUrlParams';
import { useTrackPageview } from '../../../../../observability/public';
import { PROJECTION } from '../../../../common/projections/typings';
import { Projection } from '../../../../common/projections';
import { LocalUIFilters } from '../../shared/LocalUIFilters';
import { useApmPluginContext } from '../../../hooks/useApmPluginContext';

Expand Down Expand Up @@ -88,7 +88,7 @@ export function ServiceOverview() {
const localFiltersConfig: React.ComponentProps<typeof LocalUIFilters> = useMemo(
() => ({
filterNames: ['host', 'agentName'],
projection: PROJECTION.SERVICES,
projection: Projection.services,
}),
[]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { TraceList } from './TraceList';
import { useUrlParams } from '../../../hooks/useUrlParams';
import { useTrackPageview } from '../../../../../observability/public';
import { LocalUIFilters } from '../../shared/LocalUIFilters';
import { PROJECTION } from '../../../../common/projections/typings';
import { Projection } from '../../../../common/projections';
import { APIReturnType } from '../../../services/rest/createCallApmApi';

type TracesAPIResponse = APIReturnType<'/api/apm/traces'>;
Expand Down Expand Up @@ -48,7 +48,7 @@ export function TraceOverview() {
const localUIFiltersConfig = useMemo(() => {
const config: React.ComponentProps<typeof LocalUIFilters> = {
filterNames: ['transactionResult', 'host', 'containerId', 'podName'],
projection: PROJECTION.TRACES,
projection: Projection.traces,
};

return config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { FETCH_STATUS } from '../../../hooks/useFetcher';
import { TransactionBreakdown } from '../../shared/TransactionBreakdown';
import { ChartsSyncContextProvider } from '../../../context/ChartsSyncContext';
import { useTrackPageview } from '../../../../../observability/public';
import { PROJECTION } from '../../../../common/projections/typings';
import { Projection } from '../../../../common/projections';
import { LocalUIFilters } from '../../shared/LocalUIFilters';
import { HeightRetainer } from '../../shared/HeightRetainer';
import { ErroneousTransactionsRateChart } from '../../shared/charts/ErroneousTransactionsRateChart';
Expand All @@ -52,7 +52,7 @@ export function TransactionDetails() {
const localUIFiltersConfig = useMemo(() => {
const config: React.ComponentProps<typeof LocalUIFilters> = {
filterNames: ['transactionResult', 'serviceVersion'],
projection: PROJECTION.TRANSACTIONS,
projection: Projection.transactions,
params: {
transactionName,
transactionType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import { ChartsSyncContextProvider } from '../../../context/ChartsSyncContext';
import { useTrackPageview } from '../../../../../observability/public';
import { fromQuery, toQuery } from '../../shared/Links/url_helpers';
import { LocalUIFilters } from '../../shared/LocalUIFilters';
import { PROJECTION } from '../../../../common/projections/typings';
import { Projection } from '../../../../common/projections';
import { useUrlParams } from '../../../hooks/useUrlParams';
import { useServiceTransactionTypes } from '../../../hooks/useServiceTransactionTypes';
import { TransactionTypeFilter } from '../../shared/LocalUIFilters/TransactionTypeFilter';
Expand Down Expand Up @@ -103,7 +103,7 @@ export function TransactionOverview() {
serviceName,
transactionType,
},
projection: PROJECTION.TRANSACTION_GROUPS,
projection: Projection.transactionGroups,
}),
[serviceName, transactionType]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { uniqueId, startsWith } from 'lodash';
import styled from 'styled-components';
import { i18n } from '@kbn/i18n';
import { fromQuery, toQuery } from '../Links/url_helpers';
// @ts-ignore
// @ts-expect-error
import { Typeahead } from './Typeahead';
import { getBoolFilter } from './get_bool_filter';
import { useLocation } from '../../../hooks/useLocation';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import styled from 'styled-components';
import { LocalUIFilterName } from '../../../../server/lib/ui_filters/local_ui_filters/config';
import { Filter } from './Filter';
import { useLocalUIFilters } from '../../../hooks/useLocalUIFilters';
import { PROJECTION } from '../../../../common/projections/typings';
import { Projection } from '../../../../common/projections';

interface Props {
projection: PROJECTION;
projection: Projection;
filterNames: LocalUIFilterName[];
params?: Record<string, string | number | boolean | undefined>;
showCount?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { EuiTitle } from '@elastic/eui';
import React from 'react';
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { GenericMetricsChart } from '../../../../../server/lib/metrics/transform_metrics_chart';
// @ts-ignore
// @ts-expect-error
import CustomPlot from '../CustomPlot';
import {
asDecimal,
Expand Down
7 changes: 5 additions & 2 deletions x-pack/plugins/apm/public/context/UrlParamsContext/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
import { compact, pickBy } from 'lodash';
import datemath from '@elastic/datemath';
import { IUrlParams } from './types';
import { ProcessorEvent } from '../../../common/processor_event';
import {
ProcessorEvent,
UIProcessorEvent,
} from '../../../common/processor_event';

interface PathParams {
processorEvent?: ProcessorEvent;
processorEvent?: UIProcessorEvent;
serviceName?: string;
errorGroupId?: string;
serviceNodeName?: string;
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/public/context/UrlParamsContext/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { LocalUIFilterName } from '../../../server/lib/ui_filters/local_ui_filters/config';
import { ProcessorEvent } from '../../../common/processor_event';
import { UIProcessorEvent } from '../../../common/processor_event';

export type IUrlParams = {
detailTab?: string;
Expand All @@ -32,6 +32,6 @@ export type IUrlParams = {
pageSize?: number;
serviceNodeName?: string;
searchTerm?: string;
processorEvent?: ProcessorEvent;
processorEvent?: UIProcessorEvent;
traceIdLink?: string;
} & Partial<Record<LocalUIFilterName, string>>;
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/public/hooks/useDynamicIndexPattern.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*/

import { useFetcher } from './useFetcher';
import { ProcessorEvent } from '../../common/processor_event';
import { UIProcessorEvent } from '../../common/processor_event';

export function useDynamicIndexPattern(
processorEvent: ProcessorEvent | undefined
processorEvent: UIProcessorEvent | undefined
) {
const { data, status } = useFetcher(
(callApmApi) => {
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/public/hooks/useLocalUIFilters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import { history } from '../utils/history';
import { toQuery, fromQuery } from '../components/shared/Links/url_helpers';
import { removeUndefinedProps } from '../context/UrlParamsContext/helpers';
import { PROJECTION } from '../../common/projections/typings';
import { Projection } from '../../common/projections';
import { pickKeys } from '../../common/utils/pick_keys';
import { useCallApi } from './useCallApi';

Expand All @@ -35,7 +35,7 @@ export function useLocalUIFilters({
filterNames,
params,
}: {
projection: PROJECTION;
projection: Projection;
filterNames: LocalUIFilterName[];
params?: Record<string, string | number | boolean | undefined>;
}) {
Expand Down
5 changes: 2 additions & 3 deletions x-pack/plugins/apm/public/utils/testHelpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,9 @@ export function expectTextsInDocument(output: any, texts: string[]) {
}

interface MockSetup {
dynamicIndexPattern: any;
start: number;
end: number;
client: any;
apmEventClient: any;
internalClient: any;
config: APMConfig;
uiFiltersES: ESFilter[];
Expand Down Expand Up @@ -148,7 +147,7 @@ export async function inspectSearchParams(
const mockSetup = {
start: 1528113600000,
end: 1528977600000,
client: { search: spy } as any,
apmEventClient: { search: spy } as any,
internalClient: { search: spy } as any,
config: new Proxy({}, { get: () => 'myIndex' }) as APMConfig,
uiFiltersES: [{ term: { 'my.custom.ui.filter': 'foo-bar' } }],
Expand Down
Loading