[APM] Use constants for system indices (#149521)

We should use constants when referring to the system indices.
This commit is contained in:
Søren Louv-Jansen 2023-01-26 01:40:34 +01:00 committed by GitHub
parent d7dbc91877
commit 80542567f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -6,6 +6,10 @@
*/
import { CoreStart, Logger } from '@kbn/core/server';
import {
APM_AGENT_CONFIGURATION_INDEX,
APM_SOURCE_MAP_INDEX,
} from '../../settings/apm_indices/get_apm_indices';
const apiKeyMetadata = {
application: 'apm',
@ -41,7 +45,7 @@ export async function createApmSourceMapApiKey({
apmSystemIndices: {
index: [
{
names: ['.apm-source-map'],
names: [APM_SOURCE_MAP_INDEX],
privileges: indexLevelPrivileges,
allow_restricted_indices: true,
},
@ -82,7 +86,7 @@ export async function createApmAgentConfigApiKey({
apmSystemIndices: {
index: [
{
names: ['.apm-agent-configuration'],
names: [APM_AGENT_CONFIGURATION_INDEX],
privileges: indexLevelPrivileges,
allow_restricted_indices: true,
},

View file

@ -41,8 +41,7 @@ export async function scheduleSourceMapMigration({
taskManager.registerTaskDefinitions({
[TASK_TYPE]: {
title: 'Migrate fleet source map artifacts',
description:
'Migrates fleet source map artifacts to `.apm-source-map` index',
description: `Migrates fleet source map artifacts to "${APM_SOURCE_MAP_INDEX}" index`,
timeout: '1h',
maxAttempts: 5,
maxConcurrency: 1,