Skip to main content

Module telemetry_queue

Module telemetry_queue 

Source
Expand description

In-process async telemetry queue for the MCP server process.

MCP tool calls enqueue events without blocking; a single background Tokio task drains the channel and POSTs each event to the cloud server on a threadpool thread.

Shell hooks run as short-lived separate processes that cannot share the in-process channel. They use fire_sync, which caps overhead at 300 ms via a detached thread and a receive-timeout, so the user’s shell command never stalls perceptibly even when the server is unreachable.

Functions§

enqueue
Enqueue a telemetry event for background delivery.
fire_sync
Send a telemetry event from a short-lived process such as a shell hook.
start_drain_task
Spawn the background drain task inside the running Tokio runtime.