-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thoughts about compatibility with ZIO and also tracing #500
Comments
Hey @valenterry, thanks for the feedback!
I agree, although given how big the ZIO API is, it'll require a fair bit of work to support all of its methods. Are there any specific ones you feel like you're often missing? Also, feel free to open a PR to add any of them as you see fit!
I'm a little bit confused regarding this one. Can you provide an example of such usecase?
I agree that it would be nice for Datasources to be instrumented for OTEL. However, I'm not sure to what degree this is useful since zio-query uses the ZIO runtime, which most OTEL libraries already support. In addition, this needs to be implemented at the OTEL libraries, not in zio-query. Which OTEL library do you use? Perhaps we could add an OTEL module for ZQuery in |
For example, I use caliban. Some of my endpoints are defined as ZIO and some are defined as ZQuery. I have some functions factored out that first run common logic (e.g. auth and logging) and then run the effect. Their signature is something like As for the OpenTelemetry part, I'm actually not 100% sure how it work conceptually, given that ZQuery is precisely there to abstract over the querying-flow. As for what I use, that would be GCP's opentelemetry package. |
Lifting a ZIO to ZQuery can be done via the I think this is as best as we can do since |
Yeah, but if I have either a ZIO or ZQuery at hand, then I need to either convert them (which is annoying) or use Since both can be me e.g. mapped, it would theoretically be possible to have a common trait However, I doubt that this will ever happen in the ZIO ecosystem - please just consider it a little rant. :) As for the missing functionality, I will add some of these (I hope). Like ZQuery.filter(...) for example. |
I believe what you're asking for can be achieved by using the |
Oh yeah, I forgot that this exists. This is exactly what should be used IMHO. If you could setup the build/project structure then I'm happy to add the instances in there. |
Perhaps |
I don't know if we'd want to add dependency to core since that has downstream effects (for instance in caliban). I think either way we'd want a separate module, just a question of if it goes here or in zio-prelude |
Definitely not in zio-prelude! The point of zio-prelude is that other libs in the ZIO family depend on it. Not the other way around.
You already depend on ZIO itself 😄 ZIO Prelude is the second most "core" library, right after ZIO. If it will make the decision easier for you, we'll be publishing 1.0.0 of ZIO Prelude in the near future.
Orphan instances are pure pain. I always recommend avoiding it if at least a little bit possible. |
I think it should be possible to make |
The ZIO ecosystem is awesome and very pragmatic. However, when it comes to ZIO and ZQuery, the lack of abstraction shows a bit.
ZQuery is missing quite a few convenience functions that are on ZIO (even though it should be no problem to add them on ZQuery). Also, there is no common interface, so when having code that needs to work with both sometimes, common abstractions are harder.
Furthermore, there is no OpenTelemetry support for ZQuery unless I missed something - that is really a bummer.
Thoughts?
The text was updated successfully, but these errors were encountered: