increment sqla model before commit to avoid session trouble.
Fetch the metrics utility from thread-local data

If the cache events do not have access to the current request object,
get the current metrics utility directly from pyramid_metrics, which
would get it from a thread-local data structure.