Skip to content

settings_provider_factory

faststream.kafka.prometheus.provider.settings_provider_factory #

settings_provider_factory(msg)
Source code in faststream/kafka/prometheus/provider.py
def settings_provider_factory(
    msg: Union["ConsumerRecord", Sequence["ConsumerRecord"], None],
) -> Union[
    KafkaMetricsSettingsProvider,
    BatchKafkaMetricsSettingsProvider,
]:
    if isinstance(msg, Sequence):
        return BatchKafkaMetricsSettingsProvider()
    else:
        return KafkaMetricsSettingsProvider()