    def count_exceptions(self, exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]] = Exception) -> ExceptionCounter:
        """Count exceptions in a block of code or function.

        Can be used as a function decorator or context manager.
        Increments the counter when an exception of the given
        type is raised up out of the code.
        """
        self._raise_if_not_observable()
        return ExceptionCounter(self, exception)
Count exceptions in a block of code or function.

Can be used as a function decorator or context manager.
Increments the counter when an exception of the given
type is raised up out of the code.
prometheus_client/metrics.py