Skip to content

Commit

Permalink
Merge branch 'main' into split-types-from-code-on-kbn-ace
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Nov 18, 2021
2 parents 0ff19f3 + f7d7a34 commit 5a5bbb1
Show file tree
Hide file tree
Showing 275 changed files with 451 additions and 456 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/server/deprecations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { GetDeprecationsContext, DeprecationsDetails } from 'src/core/server';
import { i18n } from '@kbn/i18n';
import { isEmpty } from 'lodash';
import { CloudSetup } from '../../../cloud/server';
import { getCloudAgentPolicy } from '../lib/fleet/get_cloud_apm_package_policy';
import { getCloudAgentPolicy } from '../routes/fleet/get_cloud_apm_package_policy';
import { APMRouteHandlerResources } from '../';

export function getDeprecations({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
ESSearchRequest,
ESSearchResponse,
} from '../../../../../../../src/core/types/elasticsearch';
import { ApmIndicesConfig } from '../../settings/apm_indices/get_apm_indices';
import { ApmIndicesConfig } from '../../../routes/settings/apm_indices/get_apm_indices';
import { tasks } from './tasks';
import { APMDataTelemetry } from '../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { ApmIndicesConfig } from '../../settings/apm_indices/get_apm_indices';
import { ApmIndicesConfig } from '../../../routes/settings/apm_indices/get_apm_indices';
import { tasks } from './tasks';
import {
SERVICE_NAME,
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/server/lib/apm_telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
APM_TELEMETRY_SAVED_OBJECT_TYPE,
} from '../../../common/apm_saved_object_constants';
import { getInternalSavedObjectsClient } from '../helpers/get_internal_saved_objects_client';
import { getApmIndices } from '../settings/apm_indices/get_apm_indices';
import { getApmIndices } from '../../routes/settings/apm_indices/get_apm_indices';
import {
collectDataTelemetry,
CollectTelemetryParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { APMError } from '../../../../../typings/es_schemas/ui/apm_error';
import { Metric } from '../../../../../typings/es_schemas/ui/metric';
import { Span } from '../../../../../typings/es_schemas/ui/span';
import { Transaction } from '../../../../../typings/es_schemas/ui/transaction';
import { ApmIndicesConfig } from '../../../settings/apm_indices/get_apm_indices';
import { ApmIndicesConfig } from '../../../../routes/settings/apm_indices/get_apm_indices';
import {
callAsyncWithDebug,
getDebugBody,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { APMEventESSearchRequest } from '.';
import { ApmIndicesConfig } from '../../../settings/apm_indices/get_apm_indices';
import { ApmIndicesConfig } from '../../../../routes/settings/apm_indices/get_apm_indices';
import { unpackProcessorEvents } from './unpack_processor_events';

describe('unpackProcessorEvents', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
ESFilter,
} from '../../../../../../../../src/core/types/elasticsearch';
import { APMEventESSearchRequest, APMEventESTermsEnumRequest } from '.';
import { ApmIndicesConfig } from '../../../settings/apm_indices/get_apm_indices';
import { ApmIndicesConfig } from '../../../../routes/settings/apm_indices/get_apm_indices';

const processorEventIndexMap = {
[ProcessorEvent.transaction]: 'transaction',
Expand Down
6 changes: 3 additions & 3 deletions x-pack/plugins/apm/server/lib/helpers/setup_request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { APMConfig } from '../..';
import { APMRouteHandlerResources } from '../../routes/typings';
import { ProcessorEvent } from '../../../common/processor_event';
import { PROCESSOR_EVENT } from '../../../common/elasticsearch_fieldnames';
import { getApmIndices } from '../settings/apm_indices/get_apm_indices';
import { getApmIndices } from '../../routes/settings/apm_indices/get_apm_indices';
import { PromiseReturnType } from '../../../../observability/typings/common';

jest.mock('../settings/apm_indices/get_apm_indices', () => ({
jest.mock('../../routes/settings/apm_indices/get_apm_indices', () => ({
getApmIndices: async () =>
({
sourcemap: 'apm-*',
Expand All @@ -26,7 +26,7 @@ jest.mock('../settings/apm_indices/get_apm_indices', () => ({
} as PromiseReturnType<typeof getApmIndices>),
}));

jest.mock('../data_view/get_dynamic_data_view', () => ({
jest.mock('../../routes/data_view/get_dynamic_data_view', () => ({
getDynamicDataView: async () => {
return;
},
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/server/lib/helpers/setup_request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { APMRouteHandlerResources } from '../../routes/typings';
import {
ApmIndicesConfig,
getApmIndices,
} from '../settings/apm_indices/get_apm_indices';
} from '../../routes/settings/apm_indices/get_apm_indices';
import {
APMEventClient,
createApmEventClient,
Expand Down
10 changes: 5 additions & 5 deletions x-pack/plugins/apm/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ import { Dataset } from '../../rule_registry/server';
import { APMConfig, APM_SERVER_FEATURE_ID } from '.';
import { UI_SETTINGS } from '../../../../src/plugins/data/common';
import { APM_FEATURE, registerFeaturesUsage } from './feature';
import { registerApmAlerts } from './lib/alerts/register_apm_alerts';
import { registerFleetPolicyCallbacks } from './lib/fleet/register_fleet_policy_callbacks';
import { registerApmAlerts } from './routes/alerts/register_apm_alerts';
import { registerFleetPolicyCallbacks } from './routes/fleet/register_fleet_policy_callbacks';
import { createApmTelemetry } from './lib/apm_telemetry';
import { createApmEventClient } from './lib/helpers/create_es_client/create_apm_event_client';
import { getInternalSavedObjectsClient } from './lib/helpers/get_internal_saved_objects_client';
import { createApmAgentConfigurationIndex } from './lib/settings/agent_configuration/create_agent_config_index';
import { getApmIndices } from './lib/settings/apm_indices/get_apm_indices';
import { createApmCustomLinkIndex } from './lib/settings/custom_link/create_custom_link_index';
import { createApmAgentConfigurationIndex } from './routes/settings/agent_configuration/create_agent_config_index';
import { getApmIndices } from './routes/settings/apm_indices/get_apm_indices';
import { createApmCustomLinkIndex } from './routes/settings/custom_link/create_custom_link_index';
import { apmIndices, apmTelemetry, apmServerSettings } from './saved_objects';
import type {
ApmPluginRequestHandlerContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { SetupUX } from '../routes/rum_client';
import { SetupUX } from '../routes/rum_client/route';
import {
AGENT_NAME,
TRANSACTION_TYPE,
Expand All @@ -14,7 +14,7 @@ import {
import { rangeQuery } from '../../../observability/server';
import { ProcessorEvent } from '../../common/processor_event';
import { TRANSACTION_PAGE_LOAD } from '../../common/transaction_types';
import { getEsFilter } from '../lib/rum_client/ui_filters/get_es_filter';
import { getEsFilter } from '../routes/rum_client/ui_filters/get_es_filter';

export function getRumPageLoadTransactionsProjection({
setup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ import {
TRANSACTION_TYPE,
} from '../../../../common/elasticsearch_fieldnames';
import { environmentQuery } from '../../../../common/utils/environment_query';
import { AlertParams } from '../../../routes/alerts/chart_preview';
import { AlertParams } from '../route';
import {
getSearchAggregatedTransactions,
getDocumentTypeFilterForTransactions,
getTransactionDurationFieldForTransactions,
getProcessorEventForTransactions,
} from '../../helpers/transactions';
import { Setup } from '../../helpers/setup_request';
} from '../../../lib/helpers/transactions';
import { Setup } from '../../../lib/helpers/setup_request';

export async function getTransactionDurationChartPreview({
alertParams,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import { SERVICE_NAME } from '../../../../common/elasticsearch_fieldnames';
import { ProcessorEvent } from '../../../../common/processor_event';
import { AlertParams } from '../../../routes/alerts/chart_preview';
import { AlertParams } from '../route';
import { rangeQuery, termQuery } from '../../../../../observability/server';
import { environmentQuery } from '../../../../common/utils/environment_query';
import { Setup } from '../../helpers/setup_request';
import { Setup } from '../../../lib/helpers/setup_request';

export async function getTransactionErrorCountChartPreview({
setup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ import {
TRANSACTION_TYPE,
} from '../../../../common/elasticsearch_fieldnames';
import { environmentQuery } from '../../../../common/utils/environment_query';
import { AlertParams } from '../../../routes/alerts/chart_preview';
import { AlertParams } from '../route';
import {
getSearchAggregatedTransactions,
getDocumentTypeFilterForTransactions,
getProcessorEventForTransactions,
} from '../../helpers/transactions';
import { Setup } from '../../helpers/setup_request';
} from '../../../lib/helpers/transactions';
import { Setup } from '../../../lib/helpers/setup_request';
import {
calculateFailedTransactionRate,
getOutcomeAggregation,
} from '../../helpers/transaction_error_rate';
} from '../../../lib/helpers/transaction_error_rate';

export async function getTransactionErrorRateChartPreview({
setup,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
} from '../../../common/elasticsearch_fieldnames';
import { ProcessorEvent } from '../../../common/processor_event';
import { environmentQuery } from '../../../common/utils/environment_query';
import { getApmIndices } from '../settings/apm_indices/get_apm_indices';
import { getApmIndices } from '../../routes/settings/apm_indices/get_apm_indices';
import { apmActionVariables } from './action_variables';
import { alertingEsClient } from './alerting_es_client';
import { RegisterRuleDependencies } from './register_apm_alerts';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ import { getDurationFormatter } from '../../../common/utils/formatters';
import {
getDocumentTypeFilterForTransactions,
getTransactionDurationFieldForTransactions,
} from '../helpers/transactions';
import { getApmIndices } from '../settings/apm_indices/get_apm_indices';
} from '../../lib/helpers/transactions';
import { getApmIndices } from '../../routes/settings/apm_indices/get_apm_indices';
import { apmActionVariables } from './action_variables';
import { alertingEsClient } from './alerting_es_client';
import { RegisterRuleDependencies } from './register_apm_alerts';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ import { EventOutcome } from '../../../common/event_outcome';
import { ProcessorEvent } from '../../../common/processor_event';
import { asDecimalOrInteger } from '../../../common/utils/formatters';
import { environmentQuery } from '../../../common/utils/environment_query';
import { getApmIndices } from '../settings/apm_indices/get_apm_indices';
import { getApmIndices } from '../../routes/settings/apm_indices/get_apm_indices';
import { apmActionVariables } from './action_variables';
import { alertingEsClient } from './alerting_es_client';
import { RegisterRuleDependencies } from './register_apm_alerts';
import { SearchAggregatedTransactionSetting } from '../../../common/aggregated_transactions';
import { getDocumentTypeFilterForTransactions } from '../helpers/transactions';
import { getDocumentTypeFilterForTransactions } from '../../lib/helpers/transactions';
import { asPercent } from '../../../../observability/common/utils/formatters';
import { termQuery } from '../../../../observability/server';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/

import * as t from 'io-ts';
import { getTransactionDurationChartPreview } from '../../lib/alerts/chart_preview/get_transaction_duration';
import { getTransactionErrorCountChartPreview } from '../../lib/alerts/chart_preview/get_transaction_error_count';
import { getTransactionErrorRateChartPreview } from '../../lib/alerts/chart_preview/get_transaction_error_rate';
import { getTransactionDurationChartPreview } from './chart_preview/get_transaction_duration';
import { getTransactionErrorCountChartPreview } from './chart_preview/get_transaction_error_count';
import { getTransactionErrorRateChartPreview } from './chart_preview/get_transaction_error_rate';
import { setupRequest } from '../../lib/helpers/setup_request';
import { createApmServerRoute } from '../apm_routes/create_apm_server_route';
import { createApmServerRouteRepository } from '../apm_routes/create_apm_server_route_repository';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,33 @@ import type {
EndpointOf,
} from '@kbn/server-route-repository';
import { PickByValue } from 'utility-types';
import { correlationsRouteRepository } from '../correlations';
import { alertsChartPreviewRouteRepository } from '../alerts/chart_preview';
import { correlationsRouteRepository } from '../correlations/route';
import { alertsChartPreviewRouteRepository } from '../alerts/route';
import { backendsRouteRepository } from '../backends/route';
import { createApmServerRouteRepository } from '../apm_routes/create_apm_server_route_repository';
import { environmentsRouteRepository } from '../environments';
import { errorsRouteRepository } from '../errors';
import { apmFleetRouteRepository } from '../fleet';
import { dataViewRouteRepository } from '../data_view';
import { latencyDistributionRouteRepository } from '../latency_distribution';
import { metricsRouteRepository } from '../metrics';
import { observabilityOverviewRouteRepository } from '../observability_overview';
import { rumRouteRepository } from '../rum_client';
import { fallbackToTransactionsRouteRepository } from '../fallback_to_transactions';
import { serviceRouteRepository } from '../services';
import { serviceMapRouteRepository } from '../service_map';
import { serviceNodeRouteRepository } from '../service_nodes';
import { agentConfigurationRouteRepository } from '../settings/agent_configuration';
import { anomalyDetectionRouteRepository } from '../settings/anomaly_detection';
import { apmIndicesRouteRepository } from '../settings/apm_indices';
import { customLinkRouteRepository } from '../settings/custom_link';
import { sourceMapsRouteRepository } from '../source_maps';
import { traceRouteRepository } from '../traces';
import { transactionRouteRepository } from '../transactions';
import { environmentsRouteRepository } from '../environments/route';
import { errorsRouteRepository } from '../errors/route';
import { apmFleetRouteRepository } from '../fleet/route';
import { dataViewRouteRepository } from '../data_view/route';
import { latencyDistributionRouteRepository } from '../latency_distribution/route';
import { metricsRouteRepository } from '../metrics/route';
import { observabilityOverviewRouteRepository } from '../observability_overview/route';
import { rumRouteRepository } from '../rum_client/route';
import { fallbackToTransactionsRouteRepository } from '../fallback_to_transactions/route';
import { serviceRouteRepository } from '../services/route';
import { serviceMapRouteRepository } from '../service_map/route';
import { serviceNodeRouteRepository } from '../service_nodes/route';
import { agentConfigurationRouteRepository } from '../settings/agent_configuration/route';
import { anomalyDetectionRouteRepository } from '../settings/anomaly_detection/route';
import { apmIndicesRouteRepository } from '../settings/apm_indices/route';
import { customLinkRouteRepository } from '../settings/custom_link/route';
import { sourceMapsRouteRepository } from '../source_maps/route';
import { traceRouteRepository } from '../traces/route';
import { transactionRouteRepository } from '../transactions/route';
import { APMRouteHandlerResources } from '../typings';
import { historicalDataRouteRepository } from '../historical_data';
import { eventMetadataRouteRepository } from '../event_metadata';
import { suggestionsRouteRepository } from '../suggestions';
import { eventMetadataRouteRepository } from '../event_metadata/route';
import { suggestionsRouteRepository } from '../suggestions/route';

const getTypedGlobalApmServerRouteRepository = () => {
const repository = createApmServerRouteRepository()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ import Boom from '@hapi/boom';
import { i18n } from '@kbn/i18n';
import { toNumberRt } from '@kbn/io-ts-utils/to_number_rt';

import { isActivePlatinumLicense } from '../../common/license_check';
import { isActivePlatinumLicense } from '../../../common/license_check';

import { setupRequest } from '../lib/helpers/setup_request';
import { setupRequest } from '../../lib/helpers/setup_request';
import {
fetchPValues,
fetchSignificantCorrelations,
fetchTransactionDurationFieldCandidates,
fetchTransactionDurationFieldValuePairs,
} from '../lib/correlations/queries';
import { fetchFieldsStats } from '../lib/correlations/queries/field_stats/get_fields_stats';
} from './queries';
import { fetchFieldsStats } from './queries/field_stats/get_fields_stats';

import { withApmSpan } from '../utils/with_apm_span';
import { withApmSpan } from '../../utils/with_apm_span';

import { createApmServerRoute } from './apm_routes/create_apm_server_route';
import { createApmServerRouteRepository } from './apm_routes/create_apm_server_route_repository';
import { environmentRt, kueryRt, rangeRt } from './default_api_types';
import { createApmServerRoute } from '../apm_routes/create_apm_server_route';
import { createApmServerRouteRepository } from '../apm_routes/create_apm_server_route_repository';
import { environmentRt, kueryRt, rangeRt } from '../default_api_types';

const INVALID_LICENSE = i18n.translate('xpack.apm.correlations.license.text', {
defaultMessage:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/

import { createStaticDataView } from './create_static_data_view';
import { Setup } from '../helpers/setup_request';
import { Setup } from '../../lib/helpers/setup_request';
import * as HistoricalAgentData from '../../routes/historical_data/has_historical_agent_data';
import { InternalSavedObjectsClient } from '../helpers/get_internal_saved_objects_client';
import { InternalSavedObjectsClient } from '../../lib/helpers/get_internal_saved_objects_client';
import { APMConfig } from '../..';

function getMockSavedObjectsClient(existingDataViewTitle: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { SavedObjectsErrorHelpers } from '../../../../../../src/core/server';
import { APM_STATIC_INDEX_PATTERN_ID } from '../../../common/index_pattern_constants';
import apmDataView from '../../tutorial/index_pattern.json';
import { hasHistoricalAgentData } from '../../routes/historical_data/has_historical_agent_data';
import { Setup } from '../helpers/setup_request';
import { Setup } from '../../lib/helpers/setup_request';
import { APMRouteHandlerResources } from '../../routes/typings';
import { InternalSavedObjectsClient } from '../helpers/get_internal_saved_objects_client.js';
import { InternalSavedObjectsClient } from '../../lib/helpers/get_internal_saved_objects_client.js';
import { withApmSpan } from '../../utils/with_apm_span';
import { getApmDataViewTitle } from './get_apm_data_view_title';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* 2.0.
*/

import { createStaticDataView } from '../lib/data_view/create_static_data_view';
import { createApmServerRouteRepository } from './apm_routes/create_apm_server_route_repository';
import { setupRequest } from '../lib/helpers/setup_request';
import { getDynamicDataView } from '../lib/data_view/get_dynamic_data_view';
import { createApmServerRoute } from './apm_routes/create_apm_server_route';
import { createStaticDataView } from './create_static_data_view';
import { createApmServerRouteRepository } from '../apm_routes/create_apm_server_route_repository';
import { setupRequest } from '../../lib/helpers/setup_request';
import { getDynamicDataView } from './get_dynamic_data_view';
import { createApmServerRoute } from '../apm_routes/create_apm_server_route';

const staticDataViewRoute = createApmServerRoute({
endpoint: 'POST /internal/apm/data_view/static',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

import { termQuery } from '../../../../observability/server';
import { ProcessorEvent } from '../../../common/processor_event';
import { Setup } from '../helpers/setup_request';
import { Setup } from '../../lib/helpers/setup_request';
import {
SERVICE_NAME,
SERVICE_ENVIRONMENT,
} from '../../../common/elasticsearch_fieldnames';
import { ENVIRONMENT_NOT_DEFINED } from '../../../common/environment_filter_values';
import { getProcessorEventForTransactions } from '../helpers/transactions';
import { getProcessorEventForTransactions } from '../../lib/helpers/transactions';

/**
* This is used for getting *all* environments, and does not filter by range.
Expand Down
Loading

0 comments on commit 5a5bbb1

Please sign in to comment.