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

PoC asyncio batch span processor #3489

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aabmass
Copy link
Member

@aabmass aabmass commented Oct 30, 2023

Quick concept of BatchSpanProcessor implemented with asyncio #3274. Not nearly as fleshed out as #3485 but could be offered in addition to that

This would work as a drop in for the current implementation and is thread safe. We could expose async functions on TracerProvider and an async SpanExporter which would could work entirely in one thread. Benefits of using asyncio:

  • Queueing and exporting are all happening in a single thread, so handling concurrency is simplified
  • Every BSP instance uses the same thread which may be less resource intensive. I think this is debatable without testing. Note SpanExporter.export() is run in a shared ThreadPoolExecutor, although we could introduce AsyncSpanExporter to avoid this (Support for async exporters #3273)
  • Couroutines can be cancelled/timed out as opposed to threads, which is a big issue with the current BSP blocking shutdown. Again won't work great with existing blocking SpanExporter.export()

@mastizada
Copy link

Hello, is there a way that I can help with this? It will be really nice to have async exporter.

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

Successfully merging this pull request may close these issues.

2 participants