import { withSpan , SpanOptions , parseSpanOptions } from '@kbn/apm-utils' ; export function withApmSpan < T > ( optionsOrName , cb ) { const options = parseSpanOptions ( optionsOrName ) ; const optionsWithDefaults = { ... ( options . intercept ? { } : { type : 'plugin:apm' } ) , ... options , labels : { plugin : 'apm' , ... options . labels , } , } ; return withSpan ( optionsWithDefaults , cb ) ; }