Skip to content

Commit

Permalink
Merge pull request #866 from iRevive/deps/cats-effect-36
Browse files Browse the repository at this point in the history
Update cats-effect to `3.6.0-RC1`, resolve compilation issues
  • Loading branch information
iRevive authored Dec 31, 2024
2 parents 3819ff7 + 10d97ce commit 909be58
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ ThisBuild / mergifyPrRules ++= Seq(
)

val CatsVersion = "2.11.0"
val CatsEffectVersion = "3.5.7"
val CatsEffectVersion = "3.6.0-RC1"
val CatsMtlVersion = "1.4.0"
val FS2Version = "3.11.0"
val MUnitVersion = "1.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package org.typelevel.otel4s.sdk.autoconfigure

import cats.MonadThrow
import cats.effect.MonadCancelThrow
import cats.effect.Resource
import cats.syntax.monadError._

Expand Down Expand Up @@ -89,7 +89,7 @@ object AutoConfigure {
* @tparam A
* the type of the component
*/
abstract class WithHint[F[_]: MonadThrow, A](
abstract class WithHint[F[_]: MonadCancelThrow, A](
hint: String,
configKeys: Set[Config.Key[_]]
) extends AutoConfigure[F, A] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package org.typelevel.otel4s.sdk.metrics.autoconfigure

import cats.MonadThrow
import cats.effect.MonadCancelThrow
import cats.effect.Resource
import org.typelevel.otel4s.sdk.autoconfigure.AutoConfigure
import org.typelevel.otel4s.sdk.autoconfigure.Config
Expand All @@ -41,7 +41,7 @@ import org.typelevel.otel4s.sdk.metrics.exemplar.TraceContextLookup
* @see
* [[https://opentelemetry.io/docs/languages/java/configuration/#exemplars]]
*/
private final class ExemplarFilterAutoConfigure[F[_]: MonadThrow](
private final class ExemplarFilterAutoConfigure[F[_]: MonadCancelThrow](
lookup: TraceContextLookup
) extends AutoConfigure.WithHint[F, ExemplarFilter](
"ExemplarFilter",
Expand Down Expand Up @@ -118,7 +118,7 @@ private[sdk] object ExemplarFilterAutoConfigure {
* @param traceContextLookup
* used by the exemplar reservoir to extract tracing information from the context
*/
def apply[F[_]: MonadThrow](
def apply[F[_]: MonadCancelThrow](
traceContextLookup: TraceContextLookup
): AutoConfigure[F, ExemplarFilter] =
new ExemplarFilterAutoConfigure[F](traceContextLookup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package org.typelevel.otel4s.sdk.metrics.autoconfigure

import cats.MonadThrow
import cats.data.NonEmptyList
import cats.effect.MonadCancelThrow
import cats.effect.Resource
import cats.effect.std.Console
import cats.syntax.applicative._
Expand All @@ -41,7 +41,7 @@ import org.typelevel.otel4s.sdk.metrics.exporter.MetricExporter
* @see
* [[https://opentelemetry.io/docs/languages/java/configuration/#metric-exporters]]
*/
private final class MetricExportersAutoConfigure[F[_]: MonadThrow: Console](
private final class MetricExportersAutoConfigure[F[_]: MonadCancelThrow: Console](
extra: Set[AutoConfigure.Named[F, MetricExporter[F]]]
) extends AutoConfigure.WithHint[F, Map[String, MetricExporter[F]]](
"MetricExporters",
Expand All @@ -64,7 +64,7 @@ private final class MetricExportersAutoConfigure[F[_]: MonadThrow: Console](
config: Config
): Resource[F, Map[String, MetricExporter[F]]] = {
val values = config.getOrElse(ConfigKeys.Exporter, Set.empty[String])
Resource.eval(MonadThrow[F].fromEither(values)).flatMap {
Resource.eval(MonadCancelThrow[F].fromEither(values)).flatMap {
case names if names.contains(Const.NoneExporter) && names.sizeIs > 1 =>
Resource.raiseError(
ConfigurationError(
Expand Down Expand Up @@ -162,7 +162,7 @@ private[sdk] object MetricExportersAutoConfigure {
* @param configurers
* the configurers to use
*/
def apply[F[_]: MonadThrow: Console](
def apply[F[_]: MonadCancelThrow: Console](
configurers: Set[AutoConfigure.Named[F, MetricExporter[F]]]
): AutoConfigure[F, Map[String, MetricExporter[F]]] =
new MetricExportersAutoConfigure[F](configurers)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package org.typelevel.otel4s.sdk.trace.autoconfigure

import cats.MonadThrow
import cats.data.NonEmptyList
import cats.effect.MonadCancelThrow
import cats.effect.Resource
import org.typelevel.otel4s.context.propagation.ContextPropagators
import org.typelevel.otel4s.context.propagation.TextMapPropagator
Expand All @@ -43,7 +43,7 @@ import org.typelevel.otel4s.sdk.trace.context.propagation.W3CTraceContextPropaga
* @see
* [[https://opentelemetry.io/docs/languages/java/configuration/#propagators]]
*/
private final class ContextPropagatorsAutoConfigure[F[_]: MonadThrow](
private final class ContextPropagatorsAutoConfigure[F[_]: MonadCancelThrow](
extra: Set[AutoConfigure.Named[F, TextMapPropagator[Context]]]
) extends AutoConfigure.WithHint[F, ContextPropagators[Context]](
"ContextPropagators",
Expand Down Expand Up @@ -73,7 +73,7 @@ private final class ContextPropagatorsAutoConfigure[F[_]: MonadThrow](

def fromConfig(config: Config): Resource[F, ContextPropagators[Context]] = {
val values = config.getOrElse(ConfigKeys.Propagators, Set.empty[String])
Resource.eval(MonadThrow[F].fromEither(values)).flatMap {
Resource.eval(MonadCancelThrow[F].fromEither(values)).flatMap {
case names if names.contains(Const.NonePropagator) && names.sizeIs > 1 =>
Resource.raiseError(
ConfigurationError(
Expand Down Expand Up @@ -149,7 +149,7 @@ private[sdk] object ContextPropagatorsAutoConfigure {
* @param extra
* extra configurers to use
*/
def apply[F[_]: MonadThrow](
def apply[F[_]: MonadCancelThrow](
extra: Set[AutoConfigure.Named[F, TextMapPropagator[Context]]]
): AutoConfigure[F, ContextPropagators[Context]] =
new ContextPropagatorsAutoConfigure[F](extra)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package org.typelevel.otel4s.sdk.trace.autoconfigure

import cats.MonadThrow
import cats.effect.MonadCancelThrow
import cats.effect.Resource
import cats.syntax.either._
import org.typelevel.otel4s.sdk.autoconfigure.AutoConfigure
Expand All @@ -37,7 +37,7 @@ import org.typelevel.otel4s.sdk.trace.samplers.Sampler
* @see
* [[https://opentelemetry.io/docs/languages/java/configuration/#sampler]]
*/
private final class SamplerAutoConfigure[F[_]: MonadThrow](
private final class SamplerAutoConfigure[F[_]: MonadCancelThrow](
extra: Set[AutoConfigure.Named[F, Sampler[F]]]
) extends AutoConfigure.WithHint[F, Sampler[F]]("Sampler", SamplerAutoConfigure.ConfigKeys.All) {

Expand Down Expand Up @@ -154,7 +154,7 @@ private[sdk] object SamplerAutoConfigure {
* @see
* [[https://opentelemetry.io/docs/languages/java/configuration/#sampler]]
*/
def apply[F[_]: MonadThrow](extra: Set[AutoConfigure.Named[F, Sampler[F]]]): AutoConfigure[F, Sampler[F]] =
def apply[F[_]: MonadCancelThrow](extra: Set[AutoConfigure.Named[F, Sampler[F]]]): AutoConfigure[F, Sampler[F]] =
new SamplerAutoConfigure[F](extra)

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

package org.typelevel.otel4s.sdk.trace.autoconfigure

import cats.MonadThrow
import cats.data.NonEmptyList
import cats.effect.MonadCancelThrow
import cats.effect.Resource
import cats.effect.std.Console
import cats.syntax.applicative._
Expand All @@ -41,7 +41,7 @@ import org.typelevel.otel4s.sdk.trace.exporter.SpanExporter
* @see
* [[https://opentelemetry.io/docs/languages/java/configuration/#span-exporters]]
*/
private final class SpanExportersAutoConfigure[F[_]: MonadThrow: Console](
private final class SpanExportersAutoConfigure[F[_]: MonadCancelThrow: Console](
extra: Set[AutoConfigure.Named[F, SpanExporter[F]]]
) extends AutoConfigure.WithHint[F, Map[String, SpanExporter[F]]](
"SpanExporters",
Expand All @@ -62,7 +62,7 @@ private final class SpanExportersAutoConfigure[F[_]: MonadThrow: Console](

def fromConfig(config: Config): Resource[F, Map[String, SpanExporter[F]]] = {
val values = config.getOrElse(ConfigKeys.Exporter, Set.empty[String])
Resource.eval(MonadThrow[F].fromEither(values)).flatMap {
Resource.eval(MonadCancelThrow[F].fromEither(values)).flatMap {
case names if names.contains(Const.NoneExporter) && names.sizeIs > 1 =>
Resource.raiseError(
ConfigurationError(
Expand Down Expand Up @@ -157,7 +157,7 @@ private[sdk] object SpanExportersAutoConfigure {
* @param configurers
* the configurers to use
*/
def apply[F[_]: MonadThrow: Console](
def apply[F[_]: MonadCancelThrow: Console](
configurers: Set[AutoConfigure.Named[F, SpanExporter[F]]]
): AutoConfigure[F, Map[String, SpanExporter[F]]] =
new SpanExportersAutoConfigure[F](configurers)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package org.typelevel.otel4s.sdk.trace.autoconfigure

import cats.MonadThrow
import cats.effect.MonadCancelThrow
import cats.effect.Resource
import org.typelevel.otel4s.sdk.autoconfigure.AutoConfigure
import org.typelevel.otel4s.sdk.autoconfigure.Config
Expand All @@ -39,7 +39,7 @@ import org.typelevel.otel4s.sdk.trace.SpanLimits
* @see
* [[https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#span-limits]]
*/
private final class SpanLimitsAutoConfigure[F[_]: MonadThrow]
private final class SpanLimitsAutoConfigure[F[_]: MonadCancelThrow]
extends AutoConfigure.WithHint[F, SpanLimits](
"SpanLimits",
SpanLimitsAutoConfigure.ConfigKeys.All
Expand Down Expand Up @@ -100,7 +100,7 @@ private final class SpanLimitsAutoConfigure[F[_]: MonadThrow]
withMaxAttributeValueLength.build
}

Resource.eval(MonadThrow[F].fromEither(configure))
Resource.eval(MonadCancelThrow[F].fromEither(configure))
}
}

Expand Down Expand Up @@ -153,7 +153,7 @@ private[sdk] object SpanLimitsAutoConfigure {
* @see
* [[https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#span-limits]]
*/
def apply[F[_]: MonadThrow]: AutoConfigure[F, SpanLimits] =
def apply[F[_]: MonadCancelThrow]: AutoConfigure[F, SpanLimits] =
new SpanLimitsAutoConfigure[F]

}

0 comments on commit 909be58

Please sign in to comment.