    def duration_buckets(
        duration: dict[str, t.Any] = Provide[api_server_config.metrics.duration],
    ) -> tuple[float, ...]:
        """
        Returns a tuple of duration buckets in seconds. If not explicitly configured,
        the Prometheus default is returned; otherwise, a set of exponential buckets
        generated based on the configuration is returned.
        """
        from ..utils.metrics import INF
        from ..utils.metrics import exponential_buckets

        if None not in (
            duration.get("min"),
            duration.get("max"),
            duration.get("factor"),
        ):
            return exponential_buckets(
                duration["min"], duration["factor"], duration["max"]
            )
        elif "buckets" in duration:
            return tuple(duration["buckets"]) + (INF,)
        else:
            raise BentoMLConfigException(
                "Either `buckets` or `min`, `max`, and `factor` must be set in `api_server.metrics.duration`"
            )
Returns a tuple of duration buckets in seconds. If not explicitly configured,
the Prometheus default is returned; otherwise, a set of exponential buckets
generated based on the configuration is returned.
src/bentoml/_internal/configuration/containers.py