PGFouine is nice, but it needs a major do-over. It would be good written with a plpgsql backend running against database loaded csv log files, so that it could handle huge logs, unlike now.
You could avoid having to create a per-schema id function by passing the shard id and the sequence oid as params to the function, so you'd have
default public.next_id(5,'insta5.table_id_seq'::regclass)