Skip to content
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

OpenTelemetry: integration with zio-http, parent span ends immidiately for the response stream #722

Open
grouzen opened this issue Jun 19, 2023 · 2 comments
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested

Comments

@grouzen
Copy link
Contributor

grouzen commented Jun 19, 2023

Reported in Discord channel: https://discord.com/channels/629491597070827530/639825316021272602/1120329881318862848

I am currently trying to integrate zio-http with zio-opentelemetry. While we use relatively old versions of both, I am unable to e.g. create a span for each request I receive that ends only when the response body stream completes. With several hacks I do manage to create a child span for the response stream, but the parent span ends where it begins.
I come here to ask if there is an already premade solution to this, even if it necessitates an upgrade of the libraries.

@grouzen grouzen added bug Something isn't working help wanted Extra attention is needed question Further information is requested labels Jun 19, 2023
@grouzen
Copy link
Contributor Author

grouzen commented Jun 19, 2023

Worth trying to implement this scenario for the latest zio-http, zio-opentelemetry and zio2.

@grouzen
Copy link
Contributor Author

grouzen commented Jul 25, 2023

In the original Discord thread, I suggested using ZIO Http Middleware to solve the issue and it turned out that another person took the same approach and shared his solution. Here is an example of such middleware: https://gist.github.com/tjarvstrand/aceb00102a2fa21fd6c7b6f4fe431be9. I hope it might be helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant