Skip to content

Commit

Permalink
improve code ownership
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 committed Sep 24, 2020
1 parent 28fcebc commit ec2e075
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 26 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
/x-pack/plugins/apm/public/components/app/RumDashboard @elastic/uptime
/x-pack/plugins/apm/server/lib/rum_client @elastic/uptime
/x-pack/plugins/apm/server/routes/rum_client.ts @elastic/uptime
/x-pack/plugins/apm/server/routes/create_ux_api.ts @elastic/uptime
/x-pack/plugins/apm/server/projections/rum_page_load_transactions.ts @elastic/uptime

# Beats
Expand Down
30 changes: 4 additions & 26 deletions x-pack/plugins/apm/server/routes/create_apm_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import {
transactionsLocalFiltersRoute,
serviceNodesLocalFiltersRoute,
uiFiltersEnvironmentsRoute,
rumOverviewLocalFiltersRoute,
} from './ui_filters';
import { createApi } from './create_api';
import { serviceMapRoute, serviceMapServiceNodeRoute } from './service_map';
Expand All @@ -69,18 +68,6 @@ import {
listCustomLinksRoute,
customLinkTransactionRoute,
} from './settings/custom_link';
import {
rumClientMetricsRoute,
rumPageViewsTrendRoute,
rumPageLoadDistributionRoute,
rumPageLoadDistBreakdownRoute,
rumServicesRoute,
rumVisitorsBreakdownRoute,
rumWebCoreVitals,
rumJSErrors,
rumUrlSearch,
rumLongTaskMetrics,
} from './rum_client';
import {
observabilityOverviewHasDataRoute,
observabilityOverviewRoute,
Expand All @@ -90,6 +77,7 @@ import {
createAnomalyDetectionJobsRoute,
anomalyDetectionEnvironmentsRoute,
} from './settings/anomaly_detection';
import { createUXAPIRoutes } from './create_ux_api';

const createApmApi = () => {
const api = createApi()
Expand Down Expand Up @@ -166,19 +154,6 @@ const createApmApi = () => {
.add(listCustomLinksRoute)
.add(customLinkTransactionRoute)

// Rum Overview
.add(rumOverviewLocalFiltersRoute)
.add(rumPageViewsTrendRoute)
.add(rumPageLoadDistributionRoute)
.add(rumPageLoadDistBreakdownRoute)
.add(rumClientMetricsRoute)
.add(rumServicesRoute)
.add(rumVisitorsBreakdownRoute)
.add(rumWebCoreVitals)
.add(rumJSErrors)
.add(rumUrlSearch)
.add(rumLongTaskMetrics)

// Observability dashboard
.add(observabilityOverviewHasDataRoute)
.add(observabilityOverviewRoute)
Expand All @@ -188,6 +163,9 @@ const createApmApi = () => {
.add(createAnomalyDetectionJobsRoute)
.add(anomalyDetectionEnvironmentsRoute);

// User Experience app api routes
createUXAPIRoutes(api);

return api;
};

Expand Down
43 changes: 43 additions & 0 deletions x-pack/plugins/apm/server/routes/create_ux_api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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.
*/

/*
* 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.
*/

import { rumOverviewLocalFiltersRoute } from './ui_filters';

import { ServerAPI } from './typings';
import {
rumClientMetricsRoute,
rumJSErrors,
rumLongTaskMetrics,
rumPageLoadDistBreakdownRoute,
rumPageLoadDistributionRoute,
rumPageViewsTrendRoute,
rumServicesRoute,
rumUrlSearch,
rumVisitorsBreakdownRoute,
rumWebCoreVitals,
} from './rum_client';

export const createUXAPIRoutes = (api: ServerAPI<{}>) => {
api
// Rum Overview
.add(rumOverviewLocalFiltersRoute)
.add(rumPageViewsTrendRoute)
.add(rumPageLoadDistributionRoute)
.add(rumPageLoadDistBreakdownRoute)
.add(rumClientMetricsRoute)
.add(rumServicesRoute)
.add(rumVisitorsBreakdownRoute)
.add(rumWebCoreVitals)
.add(rumJSErrors)
.add(rumUrlSearch)
.add(rumLongTaskMetrics);
};

0 comments on commit ec2e075

Please sign in to comment.