import { Span , SpanStatusCode } from '@opentelemetry/api' ; import { DbStatementSerializer } from './types' ; export const endSpan = ( span , err ) => { if ( err ) { span . recordException ( err ) ; span . setStatus ( { code : SpanStatusCode . ERROR , message : err . message , } ) ; } span . end ( ) ; } ; export const defaultDbStatementSerializer = ( cmdName , cmdArgs ) => Array . isArray ( cmdArgs ) && cmdArgs . length ? `${ cmdName } ${ cmdArgs . join ( ' ' ) }` : cmdName ;