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

Discard open spans after 10 minutes #2801

Merged
merged 9 commits into from
Mar 12, 2024
Prev Previous commit
Linting
  • Loading branch information
antonpirker committed Mar 12, 2024
commit 2aa4247876baffebdf6614dfb44476ef8bbd4182
4 changes: 3 additions & 1 deletion sentry_sdk/integrations/opentelemetry/span_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ def _prune_old_spans(self):
Prune spans that have been open for too long.
"""
current_time_minutes = int(time() / 60)
for span_start_minutes in list(self.open_spans.keys()): # making a list because we change the dict
for span_start_minutes in list(
self.open_spans.keys()
): # making a list because we change the dict
# prune empty open spans buckets
if self.open_spans[span_start_minutes] == set():
self.open_spans.pop(span_start_minutes)
Expand Down
Loading