feat(fastrace-opentelemetry): allow custom exporter block_on#169
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds configurability to how fastrace-opentelemetry drives OpenTelemetry exporter futures to completion, enabling integration with async exporters/clients that require a specific runtime (e.g., Tokio) while keeping the existing default behavior.
Changes:
- Add
OpenTelemetryReporter::with_block_on(...)to let callers supply a custom blocking/execution strategy for exporter futures (default remainspollster::block_on). - Update docs (README + crate docs) and changelog to describe using runtime-specific blocking (Tokio example).
- Add an integration test validating that the custom
block_onhook is actually invoked.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| fastrace-opentelemetry/src/lib.rs | Introduces configurable block_on strategy and wires it into export path. |
| fastrace-opentelemetry/tests/block_on.rs | Adds test ensuring the custom block_on callback is used. |
| fastrace-opentelemetry/README.md | Documents how to use async exporters by providing a runtime-specific block_on. |
| fastrace-opentelemetry/CHANGELOG.md | Records the new with_block_on() feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6a221fe to
d4a8692
Compare
d4a8692 to
888a312
Compare
bzp2010
approved these changes
May 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #168
OpenTelemetry OTLP HTTP exporters can be configured with async HTTP clients such as reqwest::Client. Those clients may require a Tokio runtime when their export future is polled, while fastrace-opentelemetry currently drives exporter futures with a runtime-agnostic blocking executor.
This PR lets OpenTelemetryReporter callers provide the blocking strategy used to drive exporter futures, so applications can route async exporter work through the runtime required by their chosen client while preserving the existing default behavior.