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

LogBackend logs from different fiber #24

Open
caspiano opened this issue Jun 10, 2022 · 3 comments
Open

LogBackend logs from different fiber #24

caspiano opened this issue Jun 10, 2022 · 3 comments

Comments

@caspiano
Copy link
Contributor

Describe the bug

The OpenTelemetry::Instrumentation::LogBackend logs asynchronously from a different fiber.
This prevents the logs from being attached to the span from which the log entry was produced.

To Reproduce

Configure the Log with OpenTelemetry::Instrumentation::LogBackend as the log backend.

Expected behavior

Logs emitted to OpenTelemetry::Instrumentation::LogBackend should be attached as events to the span that produced the Log::Entry

@wyhaines
Copy link
Owner

Ah. This makes sense. The solution will take a little more thought, though.

@wyhaines
Copy link
Owner

I think the easiest fix here is to make the OpenTelemetry::Instrumentation::LogBackend only operate with a SyncDispatcher. The only thing that it is doing is adding an event to the existing span, so this should be extremely fast, which reduces any argument for an AsyncDispatcher. Also, if using the AsyncDispatcher, the code would have to ensure that the Span object itself still exists by the time that the LogBackend#write method ends up being called.

@caspiano
Copy link
Contributor Author

Nice! That seems like the most logical solution

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

2 participants