def METHOD_NAME(
    key: str,
    instance: Optional[str] = None,
    tags: Optional[Tags] = None,
    sample_rate: float = settings.SENTRY_METRICS_SAMPLE_RATE,
) -> Generator[MutableTags, None, None]:
    start = time.monotonic()
    current_tags: MutableTags = dict(tags or ())
    try:
        yield current_tags
    except Exception:
        current_tags["result"] = "failure"
        raise
    else:
        current_tags["result"] = "success"
    finally:
        timing(key, time.monotonic() - start, instance, current_tags, sample_rate)