zio / zio-telemetry

ZIO-powered OpenTelemetry library
https://zio.dev/zio-telemetry
Apache License 2.0
112 stars 55 forks source link

Fix opentelemetry example #833

Closed IvanFinochenko closed 4 months ago

IvanFinochenko commented 4 months ago

Issue https://github.com/zio/zio-telemetry/issues/832

grouzen commented 4 months ago

Hey! This is a good catch. But I doubt we need to merge this. I think we shouldn't overcomplicate the examples. The better option would be to add explicit instructions on changing the OtelSdk to use Jaeger and Seq providers instead of default ones. This approach will encourage people to play with examples' code to gain a better understanding. For this, we could just point to the specific lines in https://github.com/zio/zio-telemetry/blob/series/2.x/opentelemetry-example/src/main/scala/zio/telemetry/opentelemetry/example/otel/TracerProvider.scala#L37 and https://github.com/zio/zio-telemetry/blob/series/2.x/opentelemetry-example/src/main/scala/zio/telemetry/opentelemetry/example/otel/LoggerProvider.scala#L36, saying that a user needs to replace the stdout providers in https://github.com/zio/zio-telemetry/blob/series/2.x/opentelemetry-example/src/main/scala/zio/telemetry/opentelemetry/example/otel/OtelSdk.scala#L13 with the above ones. What do you think?

IvanFinochenko commented 4 months ago

Yes, I agree. I changed it new PR https://github.com/zio/zio-telemetry/pull/835