import { ElasticsearchClient , Logger } from 'src/core/server' ; import { createOrUpdateIndex , Mappings , } from '../../../../../observability/server' ; import { APMConfig } from '../../..' ; import { getApmIndicesConfig } from '../apm_indices/get_apm_indices' ; export async function createApmAgentConfigurationIndex ( { client , config , logger , } ) { const index = getApmIndicesConfig ( config ) . apmAgentConfigurationIndex ; return createOrUpdateIndex ( { index , client , logger , mappings , } ) ; } const mappings = { dynamic : 'strict' , dynamic_templates : [ { strings : { match_mapping_type : 'string' , mapping : { type : 'keyword' as const , ignore_above : 1024 , } , } , } , ] , properties : { '@timestamp' : { type : 'date' , } , service : { properties : { name : { type : 'keyword' , ignore_above : 1024 , } , environment : { type : 'keyword' , ignore_above : 1024 , } , } , } , settings : { dynamic : true , properties : { } , } , applied_by_agent : { type : 'boolean' , } , agent_name : { type : 'keyword' , ignore_above : 1024 , } , etag : { type : 'keyword' , ignore_above : 1024 , } , } , } ;