import { ElasticsearchClient , Logger } from 'src/core/server' ; import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey' ; import { createOrUpdateIndex , Mappings , } from '../../../../../observability/server' ; import { APMConfig } from '../../..' ; import { getApmIndicesConfig } from '../apm_indices/get_apm_indices' ; export const createApmCustomLinkIndex = async ( { client , config , logger , } ) => { const index = getApmIndicesConfig ( config ) . apmCustomLinkIndex ; return createOrUpdateIndex ( { index , client , logger , mappings , } ) ; } ; const mappings = { dynamic : 'strict' , properties : { '@timestamp' : { type : 'date' , } , label : { type : 'text' , fields : { keyword : { type : 'keyword' , } , } , } as estypes . MappingPropertyBase , url : { type : 'keyword' , } , service : { properties : { name : { type : 'keyword' , } , environment : { type : 'keyword' , } , } , } , transaction : { properties : { name : { type : 'keyword' , } , type : { type : 'keyword' , } , } , } , } , } ;