Skip to content

feat: #2135 add public flush_traces API#2844

Merged
seratch merged 1 commit intomainfrom
feat/flush-traces-api
Apr 4, 2026
Merged

feat: #2135 add public flush_traces API#2844
seratch merged 1 commit intomainfrom
feat/flush-traces-api

Conversation

@seratch
Copy link
Copy Markdown
Member

@seratch seratch commented Apr 4, 2026

This pull request adds a public flush_traces() utility for callers that need immediate trace export at a unit-of-work boundary, while preserving the default processor’s periodic background exports.

It also makes TraceProvider.force_flush() backward-compatible for custom providers, ensures BatchTraceProcessor.force_flush() waits for in-flight background exports before returning, documents Celery and FastAPI usage with finally blocks so failure traces are flushed too, and adds regression coverage for these behaviors.

Resolves #2135

@seratch seratch added this to the 0.13.x milestone Apr 4, 2026
seratch added a commit that referenced this pull request Apr 4, 2026
@github-actions github-actions bot added enhancement New feature or request feature:tracing labels Apr 4, 2026
@seratch seratch merged commit 7a3f6b7 into main Apr 4, 2026
16 of 17 checks passed
@seratch seratch deleted the feat/flush-traces-api branch April 4, 2026 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature:tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Traces are silently dropped in long-running workers

1 participant