Used filament in print

Basic Information:

Printer Model: ArtilleryX2
MCU / Printerboard: Ruby

Describe your issue:

hello all, I’m trying to figure out how to get the amount of filament used for a print? In Mainsail I see the quantity, but I would need to have the data because I’m designing a system with NFC tags to save the data of the spool, color, filament length used, bed and print temperature. Thank you