Either of Swede's optical or Hall effect can be done for about $10 -$20 or so for all 3 axis. (unless you are like me and when you order something you gotta order 10 extra. )
Add another $5-10 to make it pretty with nice connectors. And extra $4 for Blue LEDs to get the cool blue glow under your machine.
You'd probably want to put the NPN Photo Transistor in a tube or heatshrink to reduce ambient light.
If you are a coolant user... You can pot everything in a couple of tubes with Clear Epoxy.