Skip to content

Commit c66ea65

Browse files
[APM] Use apmEventClient for querying APM event indices (#73449)
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
1 parent dbb603f commit c66ea65

File tree

110 files changed

+1346
-1576
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+1346
-1576
lines changed

x-pack/plugins/apm/common/processor_event.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,18 @@ export enum ProcessorEvent {
88
transaction = 'transaction',
99
error = 'error',
1010
metric = 'metric',
11+
span = 'span',
12+
onboarding = 'onboarding',
13+
sourcemap = 'sourcemap',
1114
}
15+
/**
16+
* Processor events that are searchable in the UI via the query bar.
17+
*
18+
* Some client-sideroutes will define 1 or more processor events that
19+
* will be used to fetch the dynamic index pattern for the query bar.
20+
*/
21+
22+
export type UIProcessorEvent =
23+
| ProcessorEvent.transaction
24+
| ProcessorEvent.error
25+
| ProcessorEvent.metric;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
export enum Projection {
8+
services = 'services',
9+
transactionGroups = 'transactionGroups',
10+
traces = 'traces',
11+
transactions = 'transactions',
12+
metrics = 'metrics',
13+
errorGroups = 'errorGroups',
14+
serviceNodes = 'serviceNodes',
15+
rumOverview = 'rumOverview',
16+
}

x-pack/plugins/apm/common/projections/services.ts

Lines changed: 0 additions & 64 deletions
This file was deleted.

x-pack/plugins/apm/public/components/app/ErrorGroupOverview/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import { i18n } from '@kbn/i18n';
1515
import React, { useMemo } from 'react';
1616
import { useTrackPageview } from '../../../../../observability/public';
17-
import { PROJECTION } from '../../../../common/projections/typings';
17+
import { Projection } from '../../../../common/projections';
1818
import { useFetcher } from '../../../hooks/useFetcher';
1919
import { useUrlParams } from '../../../hooks/useUrlParams';
2020
import { callApmApi } from '../../../services/rest/createCallApmApi';
@@ -79,7 +79,7 @@ function ErrorGroupOverview() {
7979
params: {
8080
serviceName,
8181
},
82-
projection: PROJECTION.ERROR_GROUPS,
82+
projection: Projection.errorGroups,
8383
};
8484

8585
return config;

x-pack/plugins/apm/public/components/app/RumDashboard/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from '@elastic/eui';
1414
import { useTrackPageview } from '../../../../../observability/public';
1515
import { LocalUIFilters } from '../../shared/LocalUIFilters';
16-
import { PROJECTION } from '../../../../common/projections/typings';
16+
import { Projection } from '../../../../common/projections';
1717
import { RumDashboard } from './RumDashboard';
1818
import { ServiceNameFilter } from '../../shared/LocalUIFilters/ServiceNameFilter';
1919
import { useUrlParams } from '../../../hooks/useUrlParams';
@@ -28,7 +28,7 @@ export function RumOverview() {
2828
const localUIFiltersConfig = useMemo(() => {
2929
const config: React.ComponentProps<typeof LocalUIFilters> = {
3030
filterNames: ['transactionUrl', 'location', 'device', 'os', 'browser'],
31-
projection: PROJECTION.RUM_OVERVIEW,
31+
projection: Projection.rumOverview,
3232
};
3333

3434
return config;

x-pack/plugins/apm/public/components/app/ServiceMetrics/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { useServiceMetricCharts } from '../../../hooks/useServiceMetricCharts';
1616
import { MetricsChart } from '../../shared/charts/MetricsChart';
1717
import { useUrlParams } from '../../../hooks/useUrlParams';
1818
import { ChartsSyncContextProvider } from '../../../context/ChartsSyncContext';
19-
import { PROJECTION } from '../../../../common/projections/typings';
19+
import { Projection } from '../../../../common/projections';
2020
import { LocalUIFilters } from '../../shared/LocalUIFilters';
2121

2222
interface ServiceMetricsProps {
@@ -36,7 +36,7 @@ export function ServiceMetrics({ agentName }: ServiceMetricsProps) {
3636
serviceName,
3737
serviceNodeName,
3838
},
39-
projection: PROJECTION.METRICS,
39+
projection: Projection.metrics,
4040
showCount: false,
4141
}),
4242
[serviceName, serviceNodeName]

x-pack/plugins/apm/public/components/app/ServiceNodeOverview/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { i18n } from '@kbn/i18n';
1515
import styled from 'styled-components';
1616
import { UNIDENTIFIED_SERVICE_NODES_LABEL } from '../../../../common/i18n';
1717
import { SERVICE_NODE_NAME_MISSING } from '../../../../common/service_nodes';
18-
import { PROJECTION } from '../../../../common/projections/typings';
18+
import { Projection } from '../../../../common/projections';
1919
import { LocalUIFilters } from '../../shared/LocalUIFilters';
2020
import { useUrlParams } from '../../../hooks/useUrlParams';
2121
import { ManagedTable, ITableColumn } from '../../shared/ManagedTable';
@@ -46,7 +46,7 @@ function ServiceNodeOverview() {
4646
params: {
4747
serviceName,
4848
},
49-
projection: PROJECTION.SERVICE_NODES,
49+
projection: Projection.serviceNodes,
5050
}),
5151
[serviceName]
5252
);

x-pack/plugins/apm/public/components/app/ServiceOverview/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { NoServicesMessage } from './NoServicesMessage';
1515
import { ServiceList } from './ServiceList';
1616
import { useUrlParams } from '../../../hooks/useUrlParams';
1717
import { useTrackPageview } from '../../../../../observability/public';
18-
import { PROJECTION } from '../../../../common/projections/typings';
18+
import { Projection } from '../../../../common/projections';
1919
import { LocalUIFilters } from '../../shared/LocalUIFilters';
2020
import { useApmPluginContext } from '../../../hooks/useApmPluginContext';
2121

@@ -88,7 +88,7 @@ export function ServiceOverview() {
8888
const localFiltersConfig: React.ComponentProps<typeof LocalUIFilters> = useMemo(
8989
() => ({
9090
filterNames: ['host', 'agentName'],
91-
projection: PROJECTION.SERVICES,
91+
projection: Projection.services,
9292
}),
9393
[]
9494
);

x-pack/plugins/apm/public/components/app/TraceOverview/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { TraceList } from './TraceList';
1111
import { useUrlParams } from '../../../hooks/useUrlParams';
1212
import { useTrackPageview } from '../../../../../observability/public';
1313
import { LocalUIFilters } from '../../shared/LocalUIFilters';
14-
import { PROJECTION } from '../../../../common/projections/typings';
14+
import { Projection } from '../../../../common/projections';
1515
import { APIReturnType } from '../../../services/rest/createCallApmApi';
1616

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

5454
return config;

x-pack/plugins/apm/public/components/app/TransactionDetails/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { FETCH_STATUS } from '../../../hooks/useFetcher';
2727
import { TransactionBreakdown } from '../../shared/TransactionBreakdown';
2828
import { ChartsSyncContextProvider } from '../../../context/ChartsSyncContext';
2929
import { useTrackPageview } from '../../../../../observability/public';
30-
import { PROJECTION } from '../../../../common/projections/typings';
30+
import { Projection } from '../../../../common/projections';
3131
import { LocalUIFilters } from '../../shared/LocalUIFilters';
3232
import { HeightRetainer } from '../../shared/HeightRetainer';
3333
import { ErroneousTransactionsRateChart } from '../../shared/charts/ErroneousTransactionsRateChart';
@@ -52,7 +52,7 @@ export function TransactionDetails() {
5252
const localUIFiltersConfig = useMemo(() => {
5353
const config: React.ComponentProps<typeof LocalUIFilters> = {
5454
filterNames: ['transactionResult', 'serviceVersion'],
55-
projection: PROJECTION.TRANSACTIONS,
55+
projection: Projection.transactions,
5656
params: {
5757
transactionName,
5858
transactionType,

0 commit comments

Comments
 (0)