-
Notifications
You must be signed in to change notification settings - Fork 437
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
Exporting spans from inside DLL on Windows does not work. #3176
Comments
CMakeLists.txt The try.cc source
The lib.cc source
|
A related issue: #2534 |
I support my own soft fork which I'm using at work, but being My goal is to have single opinionated So long story short, the version I've got works with your example, but being soft fork also makes it not suitable for your needs - e.g. I won't be able to support it. Given that it works, it's possible that you may have some mis-configuration with CMake and should be something easy to fix. Here is what I've got - malkia@1ef815f Edit: I saw that the request was to make https://github.com/malkia/opentelemetry-cpp/blob/main/x/rsomla1/README.md |
This issue is specific to Windows environment and using DLL libraries.
I build a simple executable which sets span exporter and creates a span. It also calls a library function that crates another span. Here is the main executable
Function
foo()
defined in a DLL library does thisWhen I build this code on Linux it produces the expected output with two spans, the "foo" span a child of "main" span:
However, if I build and run the same code on Windows the output is as follows without the "foo" span:
As you can see I am testing with otel 1.17.0. My guess is that in case of Windows the connection between tracer provider configured in the main application and the one obtained inside DLL is broken. Therefore the function inside DLL gets the phony provider which ignores all traces sent to it. This is why the span from foo() is not seen in the Windows output.
The text was updated successfully, but these errors were encountered: