Skip to content

telemetry_attributes_provider_factory

faststream.confluent.opentelemetry.provider.telemetry_attributes_provider_factory #

telemetry_attributes_provider_factory(msg)
Source code in faststream/confluent/opentelemetry/provider.py
def telemetry_attributes_provider_factory(
    msg: Union["Message", Sequence["Message"], None],
) -> Union[
    ConfluentTelemetrySettingsProvider,
    BatchConfluentTelemetrySettingsProvider,
]:
    if isinstance(msg, Sequence):
        return BatchConfluentTelemetrySettingsProvider()
    else:
        return ConfluentTelemetrySettingsProvider()