Skip to content

fix(microgpt-serve): use reqwest-blocking-client for OTLP exporter#1100

Merged
aaylward merged 2 commits intomainfrom
fix/microgpt-serve-otel-blocking-reqwest
Mar 2, 2026
Merged

fix(microgpt-serve): use reqwest-blocking-client for OTLP exporter#1100
aaylward merged 2 commits intomainfrom
fix/microgpt-serve-otel-blocking-reqwest

Conversation

@aaylward
Copy link
Copy Markdown
Collaborator

@aaylward aaylward commented Mar 2, 2026

Summary

  • The previous fix (fix(microgpt-serve): use thread-based PeriodicReader to fix Tokio reactor panic #1099) dropped rt-tokio from opentelemetry_sdk to stop the PeriodicReader from using tokio::time, but the OTLP HTTP exporter was still using reqwest-client (async reqwest), which also requires a Tokio reactor
  • When the PeriodicReader OS thread fires its export, it calls into async reqwest with no runtime present, causing the same "no reactor running" panic
  • Switch to reqwest-blocking-client so the entire OTel export path is synchronous and reactor-free

Test plan

  • Built locally (cargo build -p microgpt_serve)
  • Ran service with OTEL_METRIC_EXPORT_INTERVAL=2000 and a real model — no panic after multiple export cycles
  • Bazel build passes

The previous fix dropped `rt-tokio` from opentelemetry_sdk to stop the
PeriodicReader from using tokio::time, but the OTLP HTTP exporter was
still using `reqwest-client` (async reqwest), which also requires a
Tokio reactor.  When the PeriodicReader OS thread fires its export, it
calls into async reqwest with no runtime present, causing the same
"no reactor running" panic.

Switch to `reqwest-blocking-client` so the entire OTel export path is
synchronous and reactor-free.  Verified locally: service starts without
panic under OTEL_METRIC_EXPORT_INTERVAL=2000ms with a real model.
@aaylward aaylward enabled auto-merge (squash) March 2, 2026 20:28
@aaylward aaylward merged commit 7dcd22b into main Mar 2, 2026
11 checks passed
@aaylward aaylward deleted the fix/microgpt-serve-otel-blocking-reqwest branch March 2, 2026 20:33
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.

1 participant