import { take } from 'lodash' ; import { ApmServices } from '../../../common/config' ; export async function getErrorGroupIds ( { apmApiClient , start , end , serviceName = 'opbeans-java' , count = 5 , } ) { const { body } = await apmApiClient . readUser ( { endpoint : `GET /internal/apm/services/{serviceName}/errors/groups/main_statistics` , params : { path : { serviceName } , query : { start : new Date ( start ) . toISOString ( ) , end : new Date ( end ) . toISOString ( ) , transactionType : 'request' , environment : 'ENVIRONMENT_ALL' , kuery : '' , } , } , } ) ; return take ( body . errorGroups . map ( ( group ) => group . groupId ) . sort ( ) , count ) ; }