Rename auto create data view APM setting (#120689) (#120708)

from `xpack.apm.autocreateApmIndexPattern` to `xpack.apm.autoCreateApmDataView`.

Note the capitalization change. It now is `autoCreate` instead of `autocreate`.

Fixes #120095.

Co-authored-by: Nathan L Smith <nathan.smith@elastic.co>
This commit is contained in:
Kibana Machine 2021-12-07 23:53:14 -05:00 committed by GitHub
parent e62439dbfc
commit 0c6ac199d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 12 deletions

View file

@ -101,8 +101,8 @@ Changing these settings may disable features of the APM App.
| `xpack.apm.indices.sourcemap` {ess-icon}
| Matcher for all source map indices. Defaults to `apm-*`.
| `xpack.apm.autocreateApmIndexPattern` {ess-icon}
| Set to `false` to disable the automatic creation of the APM index pattern when the APM app is opened. Defaults to `true`.
| `xpack.apm.autoCreateApmDataView` {ess-icon}
| Set to `false` to disable the automatic creation of the APM data view when the APM app is opened. Defaults to `true`.
|===
// end::general-apm-settings[]
// end::general-apm-settings[]

View file

@ -17,6 +17,7 @@ import { APMPlugin } from './plugin';
// All options should be documented in the APM configuration settings: https://github.com/elastic/kibana/blob/main/docs/settings/apm-settings.asciidoc
// and be included on cloud allow list unless there are specific reasons not to
const configSchema = schema.object({
autoCreateApmDataView: schema.boolean({ defaultValue: true }),
serviceMapEnabled: schema.boolean({ defaultValue: true }),
serviceMapFingerprintBucketSize: schema.number({ defaultValue: 100 }),
serviceMapTraceIdBucketSize: schema.number({ defaultValue: 65 }),
@ -25,7 +26,6 @@ const configSchema = schema.object({
}),
serviceMapTraceIdGlobalBucketSize: schema.number({ defaultValue: 6 }),
serviceMapMaxTracesPerRequest: schema.number({ defaultValue: 50 }),
autocreateApmIndexPattern: schema.boolean({ defaultValue: true }),
ui: schema.object({
enabled: schema.boolean({ defaultValue: true }),
transactionGroupBucketSize: schema.number({ defaultValue: 1000 }),
@ -59,7 +59,15 @@ const configSchema = schema.object({
// plugin config
export const config: PluginConfigDescriptor<APMConfig> = {
deprecations: ({ renameFromRoot, deprecateFromRoot, unusedFromRoot }) => [
deprecations: ({
rename,
renameFromRoot,
deprecateFromRoot,
unusedFromRoot,
}) => [
rename('autocreateApmIndexPattern', 'autoCreateApmDataView', {
level: 'warning',
}),
renameFromRoot(
'apm_oss.transactionIndices',
'xpack.apm.indices.transaction',

View file

@ -36,7 +36,7 @@ describe('createStaticDataView', () => {
const savedObjectsClient = getMockSavedObjectsClient('apm-*');
await createStaticDataView({
setup,
config: { autocreateApmIndexPattern: false } as APMConfig,
config: { autoCreateApmDataView: false } as APMConfig,
savedObjectsClient,
spaceId: 'default',
});
@ -53,7 +53,7 @@ describe('createStaticDataView', () => {
await createStaticDataView({
setup,
config: { autocreateApmIndexPattern: true } as APMConfig,
config: { autoCreateApmDataView: true } as APMConfig,
savedObjectsClient,
spaceId: 'default',
});
@ -70,7 +70,7 @@ describe('createStaticDataView', () => {
await createStaticDataView({
setup,
config: { autocreateApmIndexPattern: true } as APMConfig,
config: { autoCreateApmDataView: true } as APMConfig,
savedObjectsClient,
spaceId: 'default',
});
@ -90,7 +90,7 @@ describe('createStaticDataView', () => {
await createStaticDataView({
setup,
config: { autocreateApmIndexPattern: true } as APMConfig,
config: { autoCreateApmDataView: true } as APMConfig,
savedObjectsClient,
spaceId: 'default',
});
@ -117,7 +117,7 @@ describe('createStaticDataView', () => {
await createStaticDataView({
setup,
config: { autocreateApmIndexPattern: true } as APMConfig,
config: { autoCreateApmDataView: true } as APMConfig,
savedObjectsClient,
spaceId: 'default',
});

View file

@ -31,8 +31,8 @@ export async function createStaticDataView({
spaceId?: string;
}): Promise<boolean> {
return withApmSpan('create_static_data_view', async () => {
// don't autocreate APM data view if it's been disabled via the config
if (!config.autocreateApmIndexPattern) {
// don't auto-create APM data view if it's been disabled via the config
if (!config.autoCreateApmDataView) {
return false;
}