File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
packages/opentelemetry-plugin-mysql/src Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1414 * limitations under the License.
1515 */
1616
17- import { BasePlugin } from '@opentelemetry/core' ;
17+ import { BasePlugin , isWrapped } from '@opentelemetry/core' ;
1818import { CanonicalCode , Span , SpanKind } from '@opentelemetry/api' ;
1919import * as mysqlTypes from 'mysql' ;
2020import * as shimmer from 'shimmer' ;
@@ -179,11 +179,13 @@ export class MysqlPlugin extends BasePlugin<typeof mysqlTypes> {
179179 if ( arguments [ 1 ] ) {
180180 // this is the callback passed into a query
181181 // no need to unwrap
182- shimmer . wrap (
183- arguments [ 1 ] ,
184- 'query' ,
185- thisPlugin . _patchQuery ( arguments [ 1 ] )
186- ) ;
182+ if ( ! isWrapped ( arguments [ 1 ] . query ) ) {
183+ shimmer . wrap (
184+ arguments [ 1 ] ,
185+ 'query' ,
186+ thisPlugin . _patchQuery ( arguments [ 1 ] )
187+ ) ;
188+ }
187189 }
188190 if ( typeof cb === 'function' ) {
189191 cb ( ...arguments ) ;
You can’t perform that action at this time.
0 commit comments