Get history of queries on MariaDB
My performance_schema.setup_consumers was not properly set.

By default performance_schema.events_statements_history_long is not enabled.

update setup_consumers set enabled="YES" where name="events_statements_history";
update setup_consumers set enabled="YES" where name="events_statements_history_long";