Metasurface-based ultracompact instrumentation to support future smart manufacturing