Skip to content

fix: spawn process metrics as background task#12

Merged
kosuke-fujishiro merged 1 commit into
mainfrom
fix/telemetry-blocking
Jan 22, 2026
Merged

fix: spawn process metrics as background task#12
kosuke-fujishiro merged 1 commit into
mainfrom
fix/telemetry-blocking

Conversation

@kosuke-fujishiro

@kosuke-fujishiro kosuke-fujishiro commented Jan 22, 2026

Copy link
Copy Markdown

Summary:
telemetry を有効にするとサーバーが起動しない問題を修正。

opentelemetry_system_metrics::init_process_observer() は内部で無限ループを持ち、システムメトリクスを継続的に収集するバックグラウンドタスクとして設計されている。ライブラリ更新.await を追加したことで無限ループが実行されるようになり、サーバー起動がブロックされていた。

tokio::spawn でバックグラウンドタスクとして実行するように修正。また、OTLP gzip 圧縮に必要な gzip-tonic feature を追加。

init_process_observer runs an infinite loop to collect system metrics,
so it must be spawned as a background task instead of being awaited.
Also add gzip-tonic feature for OTLP compression support.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

@flum1025 flum1025 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

なるほど!

@takumi3488 takumi3488 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🙏

@kosuke-fujishiro kosuke-fujishiro merged commit 4aae9cc into main Jan 22, 2026
16 checks passed
@kosuke-fujishiro kosuke-fujishiro deleted the fix/telemetry-blocking branch January 22, 2026 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants