def _prometheus_module_metric_decorator(f: FunctionType):
    '\n    A Prometheus decorator adding timing metrics to a function.\n    This decorator will work on both asynchronous and synchronous functions.\n    Note, however, that this function will turn synchronous functions into\n    asynchronous ones when used as a decorator.\n    :param f: The function for which to capture metrics\n    '
    module_ = f.__module__.split('.')[(- 1)]
    call_key = '{}_{}'.format(module_, f.__name__)

    @functools.wraps(f)
    async def wrapper(*args, **kwargs):
        with H.labels(call=call_key).time():
            if asyncio.iscoroutinefunction(f):
                return (await f(*args, **kwargs))
            else:
                return f(*args, **kwargs)
    return wrapper
A Prometheus decorator adding timing metrics to a function.
This decorator will work on both asynchronous and synchronous functions.
Note, however, that this function will turn synchronous functions into
asynchronous ones when used as a decorator.
:param f: The function for which to capture metrics
def _prometheus_module_metric_decorator(f: FunctionType):
    '\n    A Prometheus decorator adding timing metrics to a function.\n    This decorator will work on both asynchronous and synchronous functions.\n    Note, however, that this function will turn synchronous functions into\n    asynchronous ones when used as a decorator.\n    :param f: The function for which to capture metrics\n    '
    module_ = f.__module__.split('.')[(- 1)]
    call_key = '{}_{}'.format(module_, f.__name__)

    @functools.wraps(f)
    async def wrapper(*args, **kwargs):
        with H.labels(call=call_key).time():
            if asyncio.iscoroutinefunction(f):
                return (await f(*args, **kwargs))
            else:
                return f(*args, **kwargs)
    return wrapper