FYI, most of the newer diesels (with SCR systems) have onboard NOx sensors. I'm not sure the exact cost, but they're comparable in technology with an O2 sensor. I see some used ones on eBay for $50:
05 12 GL ml R Class Nox Sensor Brain Module Harness Nock Knock Exhaust | eBay
As far as CO goes, you might be able to modify a CO meter that's used for environmental safety (like near furnaces). I think they're fairly cheap.
You might also be able to do something similar with CO2. I know some industries (like breweries & greenhouses) have little meters for safety, however, I'm not sure if they'd read high enough for exhaust gas.
CO2, however, is one thing you can get quite accurately from fuel consumption because it's a major product of combustion. Same goes for O2 on a diesel.
With these meters you'd have to do something to cool the gas before it gets to the meter, because it likely won't be able to take the heat.