Skip to content

Commit

Permalink
chore: update to zio-2.0.0-RC5 (#522)
Browse files Browse the repository at this point in the history
* chore: update to zio-2.0.0-RC5
  • Loading branch information
vladimir-lu authored Apr 20, 2022
1 parent 4b52f03 commit 8b11c3e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ import zio.telemetry.opentelemetry.example.config.AppConfig
object JaegerTracer {

def live: RLayer[AppConfig, Tracer] =
ZLayer
.service[AppConfig]
.flatMap(c =>
(for {
spanExporter <- ZIO.attempt(JaegerGrpcSpanExporter.builder().setEndpoint(c.get.tracer.host).build())
spanProcessor <- ZIO.succeed(SimpleSpanProcessor.create(spanExporter))
tracerProvider <- ZIO.succeed(SdkTracerProvider.builder().addSpanProcessor(spanProcessor).build())
openTelemetry <- ZIO.succeed(OpenTelemetrySdk.builder().setTracerProvider(tracerProvider).build())
tracer <- ZIO.succeed(openTelemetry.getTracer("zio.telemetry.opentelemetry.example.JaegerTracer"))
} yield tracer).toLayer
)
ZLayer(for {
c <- ZIO.service[AppConfig]
spanExporter <- ZIO.attempt(JaegerGrpcSpanExporter.builder().setEndpoint(c.tracer.host).build())
spanProcessor <- ZIO.succeed(SimpleSpanProcessor.create(spanExporter))
tracerProvider <- ZIO.succeed(SdkTracerProvider.builder().addSpanProcessor(spanProcessor).build())
openTelemetry <- ZIO.succeed(OpenTelemetrySdk.builder().setTracerProvider(tracerProvider).build())
tracer <- ZIO.succeed(openTelemetry.getTracer("zio.telemetry.opentelemetry.example.JaegerTracer"))
} yield tracer)

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ object ProxyServer extends ZIOAppDefault {
val configLayer = TypesafeConfig.fromResourcePath(descriptor[AppConfig])

val httpBackend: ZLayer[Any, Throwable, SttpBackend[Task, ZioStreams with WebSockets]] =
ZLayer.fromAcquireRelease(AsyncHttpClientZioBackend())(_.close().ignore)
ZLayer.scoped {
ZIO.acquireRelease(AsyncHttpClientZioBackend())(_.close().ignore)
}

val sttp: ZLayer[AppConfig, Throwable, Client.Service] = httpBackend >>> Client.live

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ object Client {

val up = Status.up("proxy")

val live: ZLayer[AppConfig with Backend, Throwable, Service] = (for {
val live: ZLayer[AppConfig with Backend, Throwable, Service] = ZLayer(for {
conf <- ZIO.service[AppConfig]
backend <- ZIO.service[Backend]
service = new Service {
Expand All @@ -33,5 +33,5 @@ object Client {
Statuses(List(status, up))
}
}
} yield service).toLayer
} yield service)
}
10 changes: 5 additions & 5 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import sbt._
object Dependencies {
object Versions {
val jaeger = "1.6.0"
val sttp3 = "3.5.1"
val sttp3 = "3.5.2"
val opentracing = "0.33.0"
val opentelemetry = "1.11.0"
val opencensus = "0.31.0"
val zipkin = "2.16.3"
val zio = "2.0.0-RC4"
val zioHttp = "2.0.0-RC6"
val zioJson = "0.3.0-RC6"
val zioConfig = "3.0.0-RC7"
val zio = "2.0.0-RC5"
val zioHttp = "2.0.0-RC7"
val zioJson = "0.3.0-RC7"
val zioConfig = "3.0.0-RC8"
}

lazy val zio = Seq(
Expand Down

0 comments on commit 8b11c3e

Please sign in to comment.