async fn record_request_metrics<T, C, M>(
core: &BTreeMap<String, C>,
modules: &BTreeMap<ModuleInstanceId, BTreeMap<String, M>>,
request_method: &ApiMethod,
version_label: &'static str,
response: impl Future<Output = Result<T, ApiError>>,
) -> Result<T, ApiError>