def telemetry_attributes_provider_factory(
msg: Union["ConsumerRecord", Sequence["ConsumerRecord"], None],
) -> Union[
KafkaTelemetrySettingsProvider,
BatchKafkaTelemetrySettingsProvider,
]:
if isinstance(msg, Sequence):
return BatchKafkaTelemetrySettingsProvider()
else:
return KafkaTelemetrySettingsProvider()