import { Entity } from '../entity' ; import { ApmFields } from './apm_fields' ; import { Instance } from './instance' ; export class Service extends Entity < ApmFields > { instance ( instanceName ) { return new Instance ( { ... this . fields , [ 'service.node.name' ] : instanceName , 'host.name' : instanceName , 'container.id' : instanceName , } ) ; } } export function service ( name , environment , agentName ) { return new Service ( { 'service.name' : name , 'service.environment' : environment , 'agent.name' : agentName , } ) ; }