Tailbased sampling is available in 7.x, but it was made generally available in 8.1: APM version 8.1 | Elastic Observability [8.15] | Elastic
Maybe you should consider upgrading your stack some time.
I think you need to install the assets for the Elastic APM integration from Fleet - even if you use the standalone APM server: Install and uninstall Elastic Agent integration assets | Fleet and Elastic Agent Guide [7.17] | Elastic
Here is someone, that had a similar issue: APM Server index template matching [traces-apm.sampled] not found - #2 by simitt