Skip to content

Commit

Permalink
Fixes backwards compatibility for commit 07d7860 (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrainHorse authored Nov 22, 2024
1 parent 07d7860 commit 04edf3e
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 04edf3e

Please sign in to comment.