Skip to content

Commit

Permalink
removes all references to the deprecated apm_oss.* config paths in APM
Browse files Browse the repository at this point in the history
  • Loading branch information
ogupte committed Oct 1, 2021
1 parent a5d2013 commit b763ccd
Show file tree
Hide file tree
Showing 35 changed files with 174 additions and 278 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ describe('No data screen', () => {
url: apmIndicesSaveURL,
method: 'POST',
body: {
'apm_oss.sourcemapIndices': 'foo-*',
'apm_oss.errorIndices': 'foo-*',
'apm_oss.onboardingIndices': 'foo-*',
'apm_oss.spanIndices': 'foo-*',
'apm_oss.transactionIndices': 'foo-*',
'apm_oss.metricsIndices': 'foo-*',
'xpack.apm.sourcemapIndices': 'foo-*',
'xpack.apm.errorIndices': 'foo-*',
'xpack.apm.onboardingIndices': 'foo-*',
'xpack.apm.spanIndices': 'foo-*',
'xpack.apm.transactionIndices': 'foo-*',
'xpack.apm.metricsIndices': 'foo-*',
},
headers: {
'kbn-xsrf': true,
Expand All @@ -50,12 +50,12 @@ describe('No data screen', () => {
url: apmIndicesSaveURL,
method: 'POST',
body: {
'apm_oss.sourcemapIndices': '',
'apm_oss.errorIndices': '',
'apm_oss.onboardingIndices': '',
'apm_oss.spanIndices': '',
'apm_oss.transactionIndices': '',
'apm_oss.metricsIndices': '',
'xpack.apm.sourcemapIndices': '',
'xpack.apm.errorIndices': '',
'xpack.apm.onboardingIndices': '',
'xpack.apm.spanIndices': '',
'xpack.apm.transactionIndices': '',
'xpack.apm.metricsIndices': '',
},
headers: { 'kbn-xsrf': true },
auth: { user: 'apm_power_user', pass: 'changeme' },
Expand Down
24 changes: 12 additions & 12 deletions x-pack/plugins/apm/public/utils/testHelpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ interface MockSetup {
uiFilters: UxUIFilters;
indices: {
/* eslint-disable @typescript-eslint/naming-convention */
'apm_oss.sourcemapIndices': string;
'apm_oss.errorIndices': string;
'apm_oss.onboardingIndices': string;
'apm_oss.spanIndices': string;
'apm_oss.transactionIndices': string;
'apm_oss.metricsIndices': string;
'xpack.apm.sourcemapIndices': string;
'xpack.apm.errorIndices': string;
'xpack.apm.onboardingIndices': string;
'xpack.apm.spanIndices': string;
'xpack.apm.transactionIndices': string;
'xpack.apm.metricsIndices': string;
/* eslint-enable @typescript-eslint/naming-convention */
apmAgentConfigurationIndex: string;
apmCustomLinkIndex: string;
Expand Down Expand Up @@ -179,12 +179,12 @@ export async function inspectSearchParams(
uiFilters: {},
indices: {
/* eslint-disable @typescript-eslint/naming-convention */
'apm_oss.sourcemapIndices': 'myIndex',
'apm_oss.errorIndices': 'myIndex',
'apm_oss.onboardingIndices': 'myIndex',
'apm_oss.spanIndices': 'myIndex',
'apm_oss.transactionIndices': 'myIndex',
'apm_oss.metricsIndices': 'myIndex',
'xpack.apm.sourcemapIndices': 'myIndex',
'xpack.apm.errorIndices': 'myIndex',
'xpack.apm.onboardingIndices': 'myIndex',
'xpack.apm.spanIndices': 'myIndex',
'xpack.apm.transactionIndices': 'myIndex',
'xpack.apm.metricsIndices': 'myIndex',
/* eslint-enable @typescript-eslint/naming-convention */
apmAgentConfigurationIndex: 'myIndex',
apmCustomLinkIndex: 'myIndex',
Expand Down
6 changes: 0 additions & 6 deletions x-pack/plugins/apm/scripts/shared/read-kibana-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ export const readKibanaConfig = () => {
'xpack.apm.spanIndices': 'apm-*',
'xpack.apm.onboardingIndices': 'apm-*',
'xpack.apm.sourcemapIndices': 'apm-*',
'apm_oss.transactionIndices': 'apm-*',
'apm_oss.metricsIndices': 'apm-*',
'apm_oss.errorIndices': 'apm-*',
'apm_oss.spanIndices': 'apm-*',
'apm_oss.onboardingIndices': 'apm-*',
'apm_oss.sourcemapIndices': 'apm-*',
/* eslint-enable @typescript-eslint/naming-convention */
'elasticsearch.hosts': 'http://localhost:9200',
...loadedKibanaConfig,
Expand Down
12 changes: 4 additions & 8 deletions x-pack/plugins/apm/server/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ import { mergeConfigs } from './index';
describe('mergeConfigs', () => {
it('merges the configs', () => {
const apmConfig = {
transactionIndices: 'apm-*-transaction-*',
spanIndices: 'apm-*-span-*',
errorIndices: 'apm-*-error-*',
metricsIndices: 'apm-*-metric-*',
transactionIndices: 'traces-apm*,apm-*-transaction-*',
spanIndices: 'traces-apm*,apm-*-span-*',
errorIndices: 'logs-apm*,apm-*-error-*',
metricsIndices: 'metrics-apm*,apm-*-metric-*',
ui: { enabled: false },
enabled: true,
metricsInterval: 2000,
Expand All @@ -28,10 +28,6 @@ describe('mergeConfigs', () => {
'xpack.apm.metricsIndices': 'metrics-apm*,apm-*-metric-*',
'xpack.apm.spanIndices': 'traces-apm*,apm-*-span-*',
'xpack.apm.transactionIndices': 'traces-apm*,apm-*-transaction-*',
'apm_oss.errorIndices': 'logs-apm*,apm-*-error-*',
'apm_oss.metricsIndices': 'metrics-apm*,apm-*-metric-*',
'apm_oss.spanIndices': 'traces-apm*,apm-*-span-*',
'apm_oss.transactionIndices': 'traces-apm*,apm-*-transaction-*',
'xpack.apm.metricsInterval': 2000,
'xpack.apm.ui.enabled': false,
'xpack.apm.agent.migrations.enabled': true,
Expand Down
7 changes: 0 additions & 7 deletions x-pack/plugins/apm/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,6 @@ export function mergeConfigs(apmConfig: APMXPackConfig) {
'xpack.apm.metricsIndices': apmConfig.metricsIndices,
'xpack.apm.sourcemapIndices': apmConfig.sourcemapIndices,
'xpack.apm.onboardingIndices': apmConfig.onboardingIndices,
// TODO: Remove all apm_oss options by 8.0
'apm_oss.transactionIndices': apmConfig.transactionIndices,
'apm_oss.spanIndices': apmConfig.spanIndices,
'apm_oss.errorIndices': apmConfig.errorIndices,
'apm_oss.metricsIndices': apmConfig.metricsIndices,
'apm_oss.sourcemapIndices': apmConfig.sourcemapIndices,
'apm_oss.onboardingIndices': apmConfig.onboardingIndices,
/* eslint-enable @typescript-eslint/naming-convention */
'xpack.apm.serviceMapEnabled': apmConfig.serviceMapEnabled,
'xpack.apm.serviceMapFingerprintBucketSize':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function registerErrorCountAlertType({
});

const searchParams = {
index: indices['apm_oss.errorIndices'],
index: indices['xpack.apm.errorIndices'],
size: 0,
body: {
query: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ export function registerTransactionDurationAlertType({
SearchAggregatedTransactionSetting.never;

const index = searchAggregatedTransactions
? indices['apm_oss.metricsIndices']
: indices['apm_oss.transactionIndices'];
? indices['xpack.apm.metricsIndices']
: indices['xpack.apm.transactionIndices'];

const field = getTransactionDurationFieldForAggregatedTransactions(
searchAggregatedTransactions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ export function registerTransactionErrorRateAlertType({
SearchAggregatedTransactionSetting.never;

const index = searchAggregatedTransactions
? indices['apm_oss.metricsIndices']
: indices['apm_oss.transactionIndices'];
? indices['xpack.apm.metricsIndices']
: indices['xpack.apm.transactionIndices'];

const searchParams = {
index,
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/apm/server/lib/alerts/test_utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export const createRuleTypeMocks = () => {

const mockedConfig$ = of({
/* eslint-disable @typescript-eslint/naming-convention */
'apm_oss.errorIndices': 'apm-*',
'apm_oss.transactionIndices': 'apm-*',
'xpack.apm.errorIndices': 'apm-*',
'xpack.apm.transactionIndices': 'apm-*',
/* eslint-enable @typescript-eslint/naming-convention */
} as APMConfig);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export async function createAnomalyDetectionJobs(
`Creating ML anomaly detection jobs for environments: [${uniqueMlJobEnvs}].`
);

const indexPatternName = indices['apm_oss.metricsIndices'];
const indexPatternName = indices['xpack.apm.metricsIndices'];
const responses = await Promise.all(
uniqueMlJobEnvs.map((environment) =>
createAnomalyDetectionJob({ ml, environment, indexPatternName })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ describe('data telemetry collection tasks', () => {
'xpack.apm.metricsIndices': 'apm-8.0.0-metric',
'xpack.apm.spanIndices': 'apm-8.0.0-span',
'xpack.apm.transactionIndices': 'apm-8.0.0-transaction',
'apm_oss.errorIndices': 'apm-8.0.0-error',
'apm_oss.metricsIndices': 'apm-8.0.0-metric',
'apm_oss.spanIndices': 'apm-8.0.0-span',
'apm_oss.transactionIndices': 'apm-8.0.0-transaction',
/* eslint-enable @typescript-eslint/naming-convention */
} as ApmIndicesConfig;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const tasks: TelemetryTask[] = [
};

const params = {
index: [indices['apm_oss.transactionIndices']],
index: [indices['xpack.apm.transactionIndices']],
body: {
size: 0,
timeout,
Expand Down Expand Up @@ -138,7 +138,7 @@ export const tasks: TelemetryTask[] = [
// fixed date range for reliable results
const lastTransaction = (
await search({
index: indices['apm_oss.transactionIndices'],
index: indices['xpack.apm.transactionIndices'],
body: {
query: {
bool: {
Expand Down Expand Up @@ -253,10 +253,10 @@ export const tasks: TelemetryTask[] = [

const response = await search({
index: [
indices['apm_oss.errorIndices'],
indices['apm_oss.metricsIndices'],
indices['apm_oss.spanIndices'],
indices['apm_oss.transactionIndices'],
indices['xpack.apm.errorIndices'],
indices['xpack.apm.metricsIndices'],
indices['xpack.apm.spanIndices'],
indices['xpack.apm.transactionIndices'],
],
body: {
size: 0,
Expand Down Expand Up @@ -310,10 +310,10 @@ export const tasks: TelemetryTask[] = [

const response = await search({
index: [
indices['apm_oss.errorIndices'],
indices['apm_oss.metricsIndices'],
indices['apm_oss.spanIndices'],
indices['apm_oss.transactionIndices'],
indices['xpack.apm.errorIndices'],
indices['xpack.apm.metricsIndices'],
indices['xpack.apm.spanIndices'],
indices['xpack.apm.transactionIndices'],
],
body: {
size: 0,
Expand Down Expand Up @@ -345,7 +345,7 @@ export const tasks: TelemetryTask[] = [
name: 'environments',
executor: async ({ indices, search }) => {
const response = await search({
index: [indices['apm_oss.transactionIndices']],
index: [indices['xpack.apm.transactionIndices']],
body: {
query: {
bool: {
Expand Down Expand Up @@ -426,12 +426,12 @@ export const tasks: TelemetryTask[] = [
name: 'processor_events',
executor: async ({ indices, search }) => {
const indicesByProcessorEvent = {
error: indices['apm_oss.errorIndices'],
metric: indices['apm_oss.metricsIndices'],
span: indices['apm_oss.spanIndices'],
transaction: indices['apm_oss.transactionIndices'],
onboarding: indices['apm_oss.onboardingIndices'],
sourcemap: indices['apm_oss.sourcemapIndices'],
error: indices['xpack.apm.errorIndices'],
metric: indices['xpack.apm.metricsIndices'],
span: indices['xpack.apm.spanIndices'],
transaction: indices['xpack.apm.transactionIndices'],
onboarding: indices['xpack.apm.onboardingIndices'],
sourcemap: indices['xpack.apm.sourcemapIndices'],
};

type ProcessorEvent = keyof typeof indicesByProcessorEvent;
Expand Down Expand Up @@ -549,10 +549,10 @@ export const tasks: TelemetryTask[] = [
return prevJob.then(async (data) => {
const response = await search({
index: [
indices['apm_oss.errorIndices'],
indices['apm_oss.spanIndices'],
indices['apm_oss.metricsIndices'],
indices['apm_oss.transactionIndices'],
indices['xpack.apm.errorIndices'],
indices['xpack.apm.spanIndices'],
indices['xpack.apm.metricsIndices'],
indices['xpack.apm.transactionIndices'],
],
body: {
size: 0,
Expand Down Expand Up @@ -599,9 +599,9 @@ export const tasks: TelemetryTask[] = [
executor: async ({ search, indices }) => {
const response = await search({
index: [
indices['apm_oss.transactionIndices'],
indices['apm_oss.spanIndices'],
indices['apm_oss.errorIndices'],
indices['xpack.apm.transactionIndices'],
indices['xpack.apm.spanIndices'],
indices['xpack.apm.errorIndices'],
],
terminateAfter: 1,
body: {
Expand Down Expand Up @@ -647,7 +647,7 @@ export const tasks: TelemetryTask[] = [
executor: async ({ search, indices }) => {
const errorGroupsCount = (
await search({
index: indices['apm_oss.errorIndices'],
index: indices['xpack.apm.errorIndices'],
body: {
size: 0,
timeout,
Expand Down Expand Up @@ -683,7 +683,7 @@ export const tasks: TelemetryTask[] = [

const transactionGroupsCount = (
await search({
index: indices['apm_oss.transactionIndices'],
index: indices['xpack.apm.transactionIndices'],
body: {
size: 0,
timeout,
Expand Down Expand Up @@ -719,7 +719,7 @@ export const tasks: TelemetryTask[] = [

const tracesPerDayCount = (
await search({
index: indices['apm_oss.transactionIndices'],
index: indices['xpack.apm.transactionIndices'],
body: {
query: {
bool: {
Expand All @@ -742,9 +742,9 @@ export const tasks: TelemetryTask[] = [
const servicesCount = (
await search({
index: [
indices['apm_oss.transactionIndices'],
indices['apm_oss.errorIndices'],
indices['apm_oss.metricsIndices'],
indices['xpack.apm.transactionIndices'],
indices['xpack.apm.errorIndices'],
indices['xpack.apm.metricsIndices'],
],
body: {
size: 0,
Expand Down Expand Up @@ -812,9 +812,9 @@ export const tasks: TelemetryTask[] = [

const response = await search({
index: [
indices['apm_oss.errorIndices'],
indices['apm_oss.metricsIndices'],
indices['apm_oss.transactionIndices'],
indices['xpack.apm.errorIndices'],
indices['xpack.apm.metricsIndices'],
indices['xpack.apm.transactionIndices'],
],
body: {
size: 0,
Expand Down Expand Up @@ -1006,12 +1006,12 @@ export const tasks: TelemetryTask[] = [
const response = await indicesStats({
index: [
indices.apmAgentConfigurationIndex,
indices['apm_oss.errorIndices'],
indices['apm_oss.metricsIndices'],
indices['apm_oss.onboardingIndices'],
indices['apm_oss.sourcemapIndices'],
indices['apm_oss.spanIndices'],
indices['apm_oss.transactionIndices'],
indices['xpack.apm.errorIndices'],
indices['xpack.apm.metricsIndices'],
indices['xpack.apm.onboardingIndices'],
indices['xpack.apm.sourcemapIndices'],
indices['xpack.apm.spanIndices'],
indices['xpack.apm.transactionIndices'],
],
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ describe('get buckets', () => {
'xpack.apm.spanIndices': 'apm-*',
'xpack.apm.transactionIndices': 'apm-*',
'xpack.apm.metricsIndices': 'apm-*',
'apm_oss.sourcemapIndices': 'apm-*',
'apm_oss.errorIndices': 'apm-*',
'apm_oss.onboardingIndices': 'apm-*',
'apm_oss.spanIndices': 'apm-*',
'apm_oss.transactionIndices': 'apm-*',
'apm_oss.metricsIndices': 'apm-*',
/* eslint-enable @typescript-eslint/naming-convention */
apmAgentConfigurationIndex: '.apm-agent-configuration',
apmCustomLinkIndex: '.apm-custom-link',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ describe('unpackProcessorEvents', () => {
'xpack.apm.spanIndices': 'my-apm-*-span-*',
'xpack.apm.onboardingIndices': 'my-apm-*-onboarding-',
'xpack.apm.sourcemapIndices': 'my-apm-*-sourcemap-*',
'apm_oss.transactionIndices': 'my-apm-*-transaction-*',
'apm_oss.metricsIndices': 'my-apm-*-metric-*',
'apm_oss.errorIndices': 'my-apm-*-error-*',
'apm_oss.spanIndices': 'my-apm-*-span-*',
'apm_oss.onboardingIndices': 'my-apm-*-onboarding-',
'apm_oss.sourcemapIndices': 'my-apm-*-sourcemap-*',
} as ApmIndicesConfig;

res = unpackProcessorEvents(request, indices);
Expand Down
Loading

0 comments on commit b763ccd

Please sign in to comment.