Abstract Fused deposition modeling (FDM) has been widely used for fabricating parts with complex geometries. However, during the printing process the nozzle temperature fluctuates which may cause nozzle blockage, inter-filament delamination, over-melting, etc. Therefore, it is of significance to develop an online and in-situ nozzle monitoring system which could overcome such drawbacks for quality assurance. In this work, a multifunctional system is designed by incorporating a traditional ultrasonic probe and a metamaterial buffer rod to online monitor the nozzle temperature and ensure a correct extrusion force and speed. A parametric simulation model is first constructed implicitly based on thermal-acoustic metamaterial structures for the buffer rod. Secondly, since the high-fidelity calculation is computationally expensive, an efficient surrogate model with kriging approach is constructed based on the dataset drawn from limited trials for rapid prediction. Thirdly, multidisciplinary optimization is performed by the NSGA-III algorithm considering the thermal insulation performance, ultrasonic attenuation and structure integrity. The rod is fabricated according to the best parameters decided. A cross-correlation algorithm is calibrated with thermocouple measurement after waveform recording at different temperatures. The online and in-situ temperature measurement can be realized during 3D printing successfully eventually. This will help to improve the printing quality with potential feedback strategies.