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

Use OTel SDK's self-diagnostics - native code #960

Open
pellared opened this issue Jul 20, 2022 · 2 comments
Open

Use OTel SDK's self-diagnostics - native code #960

pellared opened this issue Jul 20, 2022 · 2 comments
Milestone

Comments

@pellared
Copy link
Member

pellared commented Jul 20, 2022

We should take advantage of OTel SDK's self-diagnostics for internal logging and try to adopt it in the native code.

We could do it by emitting EventSource events from the C++ code. Then we would probably need to create guidelines/tools to be able to catch these events in case the process crashes before OTel SDK's self-diagnostic is initialized (as well as to catch events that are emitted before it is initialized). Or we should have a separate mechanism for logging before OTel SDK's self-diagnostic is initialized.

@nrcventura
Copy link
Member

The native code has the ability to run before any managed code is loaded/executed. In particular the initialization code of the profiler runs before any managed code is loaded, and those initialization related logs are very important, so the solution that we choose needs to ensure that we can capture those logs.

@pjanotti
Copy link
Contributor

pjanotti commented Nov 8, 2022

@nrcventura Q is very relevant. Initially, we could simply have a point at which the native code switches from file to EventSource. Anyway, let's record that the runtime provides support to write EventSource events from a CLR profiler. ICorProfilerInfo12 introduced such support, however, it requires .NET 5.0 and above, so it is not available on any supported .NET Framework version.

@Kielek Kielek modified the milestones: 1.0.0-rc, post-1.0.0 Jan 19, 2023
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

4 participants