The easiest way to implement this is likely just filtering the traces we return by the limit for Free plan users. If they upgrade to the Pro plan, they can see the entire history.
This won't impact self-hosting the application where there would be no trace or data retention limits.
This will likely require a CRON job we run e.g. weekly.