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

System.Diagnostics.Activity doesn't flow properly with Hopac, resulting in incorrect telemetry correlation #219

Open
cmeeren opened this issue Apr 29, 2022 · 0 comments

Comments

@cmeeren
Copy link
Contributor

cmeeren commented Apr 29, 2022

The System.Diagnostics.Activity class (reference) is used to support distributed tracing, for example in ASP.NET Core. It flows with the call context, including across async calls. This works well with F#'s native async and task CEs, but when using Hopac, it often does not work correctly, resulting in incorrect telemetry correlation. Specifically, in my experience, telemetry for a lot of requests (or parts of requests) may end up being correlated with a single early request.

This is a hard show-stopper for my use of Hopac in Felicity (an F# JSON:API framework based on ASP.NET Core and Giraffe). But before I rewrite the framework to use native tasks instead of Hopac (which also impacts performance negatively), I figured I should mention this here and ask if there is anything that can be done to alleviate this, whether internally in Hopac or in the usage of Hopac.

Unfortunately Felicity is very complex and I have been unable to produce a minimal repro. I simply don't know what parts of the Hopac API makes the Activity not flow correctly with call context. It's also somewhat non-deterministic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant