def _prometheus_class_metric_decorator(f: FunctionType):
    '\n    A Prometheus decorator adding timing metrics to a function in a class.\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    '

    @functools.wraps(f)
    async def wrapper(*args, **kwargs):
        with H.labels(call=f.__name__).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 in a class.
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_class_metric_decorator(f: FunctionType):
    '\n    A Prometheus decorator adding timing metrics to a function in a class.\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    '

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