diff --git a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/patches/client.rb b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/patches/client.rb index 0b50b8d99..10a9e92c5 100644 --- a/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/patches/client.rb +++ b/instrumentation/mysql2/lib/opentelemetry/instrumentation/mysql2/patches/client.rb @@ -97,7 +97,7 @@ def _otel_client_attributes(sql) def db_sql_table_name(sql) Regexp.last_match(1) if sql =~ TABLE_NAME - rescue StandardError + rescue StandardError => e OpenTelemetry.handle_error(message: 'Error extracting collection name', exception: e) nil end