Yellow sticky traps will help thin them out. CLI use a lab up in San Francisco that does cannabis testing (there are a few), and I just mail stuff USPS Priority in smell-proof bags. Cannabinoid testing is $75 per test. I think terpene testing is more expensive.
For killing gnats you want to find something that dissolves in water containing BTI (Bacillus thuringiensis subspecies israelensis). In the states it's sold as Mosquito Bits/Dunks because it kills their larvae too.
You dissolve them in a bucket of water, wait 24 hours, and then use that to water your plants. If you have space, mix up enough in a 5 gallon bucket and whatever is left over will repopulate with more BTI so you save money on bits.
Use that for every watering for a week or two and then once a week and your gnats should be gone.
Other methods include putting sand on top of the soil or diatomaceous earth, but that only works when it's dry, so rarely!