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

BatchSpanProcessor doesn't work across processes #2185

Closed
benjaminsky opened this issue Oct 8, 2021 · 6 comments
Closed

BatchSpanProcessor doesn't work across processes #2185

benjaminsky opened this issue Oct 8, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@benjaminsky
Copy link
Contributor

Describe your environment
Should be the same on all environments.

Steps to reproduce
Initialize the BatchSpanProcessor in a separate process from the instrumented code.

What is the expected behavior?
Spans should be exported when the BatchSpanProcessor worker thread runs in a different process

What is the actual behavior?
Spans are not exported when the BatchSpanProcessor worker thread runs in a different process than the instrumented code. Internally it uses a collections.deque which multiprocessing.Manager() doesn't support. Recommend changing this to multiprocessing.Queue.

@benjaminsky benjaminsky added the bug Something isn't working label Oct 8, 2021
@owais
Copy link
Contributor

owais commented Oct 9, 2021

What are the downsides/implications of moving to multiprocessing.Queue?

@owais
Copy link
Contributor

owais commented Oct 9, 2021

This might also help with uWSGI and gunicorn not working with the opentelemetry-instrument command.

It would be great to have this prototyped to figure out all implications of this change.

@srikanthccv
Copy link
Member

Is it the underlying queue class reason for this behaviour? I thought it is because lock is acquired by deamon thread during the initialization and newly spawned processes will never be able to acquire it hence no spans are exported. I would like to see if moving to multiprocessing.Queue solves the problem.

@srikanthccv
Copy link
Member

This should be fixed now.

@cruisehall
Copy link

This should be fixed now.

@srikanthccv could you link the PR that fixed this bug?

@srikanthccv
Copy link
Member

here #2242

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants