@@ -24,7 +24,12 @@ export class PostgreSQLQuery {
2424
2525 if ( filteredSpans . length === 0 ) {
2626 throw new Error (
27- `No query by ${ this . serviceName } to postgresql with database name ${ name } was found` ,
27+ `No query by ${
28+ this . serviceName
29+ } to postgresql with database name ${ name } was found. Found db names: ${ extractAttributeStringValues (
30+ this . spans ,
31+ SemanticAttributes . DB_NAME ,
32+ ) } `,
2833 ) ;
2934 }
3035
@@ -43,10 +48,10 @@ export class PostgreSQLQuery {
4348 throw new Error (
4449 `No query by ${
4550 this . serviceName
46- } to postgresql with statement ${ statement } was found. Found statements: ${ extractAttributeStringValues (
51+ } to postgresql with statement ${ statement } was found. Found statements:\n ${ extractAttributeStringValues (
4752 this . spans ,
4853 SemanticAttributes . DB_STATEMENT ,
49- ) } `,
54+ ) . join ( '\n\n' ) } `,
5055 ) ;
5156 }
5257
@@ -78,7 +83,7 @@ export class PostgreSQLQuery {
7883 } to postgresql with operations ${ operations } was found. Found statements: ${ extractAttributeStringValues (
7984 this . spans ,
8085 SemanticAttributes . DB_STATEMENT ,
81- ) } `,
86+ ) . join ( '\n\n' ) } `,
8287 ) ;
8388 }
8489
@@ -100,10 +105,10 @@ export class PostgreSQLQuery {
100105 const cleaned = matches ?. map ( ( elem : string ) => {
101106 const [ _ , second ] = elem . split ( ' ' ) ;
102107 return second
103- . replace ( '"' , '' )
104- . replace ( '(' , '' )
105- . replace ( ')' , '' )
106- . replace ( '\n' , '' )
108+ . replaceAll ( '"' , '' )
109+ . replaceAll ( '(' , '' )
110+ . replaceAll ( ')' , '' )
111+ . replaceAll ( '\n' , '' )
107112 . toLocaleLowerCase ( ) ;
108113 } ) ;
109114
@@ -119,7 +124,7 @@ export class PostgreSQLQuery {
119124 } to postgresql with tables ${ tables } was found. Found statements: ${ extractAttributeStringValues (
120125 this . spans ,
121126 SemanticAttributes . DB_STATEMENT ,
122- ) } `,
127+ ) . join ( '\n\n' ) } `,
123128 ) ;
124129 }
125130
0 commit comments