diff --git a/modules/metrics/src/main/scala/com/evolutiongaming/skafka/metrics/KafkaMetricsCollector.scala b/modules/metrics/src/main/scala/com/evolutiongaming/skafka/metrics/KafkaMetricsCollector.scala index 57c0f8a1..3b6cd7a1 100644 --- a/modules/metrics/src/main/scala/com/evolutiongaming/skafka/metrics/KafkaMetricsCollector.scala +++ b/modules/metrics/src/main/scala/com/evolutiongaming/skafka/metrics/KafkaMetricsCollector.scala @@ -36,10 +36,20 @@ import scala.util.matching.Regex */ class KafkaMetricsCollector[F[_]: Monad: ToTry]( kafkaClientMetrics: F[Seq[ClientMetric[F]]], - prefix: Option[String] = None, - customLabels: List[(String, String)] = List.empty, + prefix: Option[String] = None, + customLabels: List[(String, String)], ) extends Collector { + // Secondary constructor for backward compatibility. Should be removed in the next major bump + def this( + kafkaClientMetrics: F[Seq[ClientMetric[F]]], + prefix: Option[String] + ) = this( + kafkaClientMetrics = kafkaClientMetrics, + prefix = prefix, + customLabels = List.empty + ) + private val (customLabelsKeys, customLabelsValues) = customLabels.separate protected def getCollectorType(metric: ClientMetric[F]): Collector.Type = {