You can collect historical information on long running queries and store it for a specified period of time.
The application will need to provide the ability to configure
constant collection for queries, with the option to collect on long
running queries, and save them for a specified period of time.