Skip to content

Commit

Permalink
make compatible with scala 2.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Denys Fakhritdinov committed Jul 12, 2024
1 parent 2c84391 commit 2a454d5
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,19 @@ object KafkaMetricsRegistry {
for {
sources <- Ref[F].of(Map.empty[UUID, F[Seq[ClientMetric[F]]]]).toResource

metrics = sources.get.flatMap { sources =>
sources.toSeq.flatTraverse {
case (uuid, metrics) =>
metrics.map { metrics =>
metrics.map { metric => metric.copy(tags = metric.tags + ("uuid" -> uuid.toString)) }
metrics = sources
.get
.flatMap { sources =>
sources
.toList
.flatTraverse {
case (uuid, metrics) =>
metrics.map { metrics =>
metrics.toList.map { metric => metric.copy(tags = metric.tags + ("uuid" -> uuid.toString)) }
}
}
}
}
.widen[Seq[ClientMetric[F]]]

collector = new KafkaMetricsCollector[F](metrics, prefix)
allocate = Sync[F].delay { prometheus.register(collector) }
Expand Down

0 comments on commit 2a454d5

Please sign in to comment.