open-telemetry / open-telemetry/opentelemetry-python

Use an event loop to coordinate async SDK work

Open
#3,274 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request logging metrics sdk tracing
Dominant language
Python
Stars
2.6k
Forks
1k
Avg merge
4d 15h
Merged PRs (30d)
19

Description

Originally from https://github.com/open-telemetry/opentelemetry-python/issues/62#issuecomment-1515418483

For example handling periodic exporting in BatchSpanProcessor and PeriodicExportingMetricReader could be done in a single asyncio event loop (using a single thread) across all instances of all of these objects.

We could avoid creating a new background thread in each instance of those classes and it would simplify the synchronization logic. Would work nicely with async exporters and async callbacks which could all run in the same event loop https://github.com/open-telemetry/opentelemetry-python/issues/3273.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the BatchSpanProcessor and PeriodicExportingMetricReader implementations, then examine the related async exporter and callback discussion in issue #3273. Define how one asyncio event loop would coordinate all instances and what synchronization, shutdown, and async exporter behavior must be preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.