Skip to content

feat(fastrace-opentelemetry): allow custom exporter block_on#169

Merged
andylokandy merged 2 commits into
mainfrom
feat-otel-block-on
May 3, 2026
Merged

feat(fastrace-opentelemetry): allow custom exporter block_on#169
andylokandy merged 2 commits into
mainfrom
feat-otel-block-on

Conversation

@andylokandy
Copy link
Copy Markdown
Collaborator

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 remains pollster::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_on hook 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.

Comment thread fastrace-opentelemetry/src/lib.rs Outdated
@andylokandy andylokandy force-pushed the feat-otel-block-on branch from 6a221fe to d4a8692 Compare May 1, 2026 10:35
@andylokandy andylokandy force-pushed the feat-otel-block-on branch from d4a8692 to 888a312 Compare May 1, 2026 10:38
@andylokandy andylokandy merged commit 3de98ec into main May 3, 2026
11 checks passed
@andylokandy andylokandy deleted the feat-otel-block-on branch May 3, 2026 07:40
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.

Allow custom exporter block_on instead of pollster in fastrace-opentelemetry

3 participants