Expand description
Telemetry pipeline — records every tool invocation and ships batches to a configurable HTTP endpoint, even when the call was executed locally.
§Why on the proxy side?
With transparent routing, some tool calls never reach an upstream MCP server.
Operators who aggregate usage elsewhere (usage dashboards, billing, audit) still
want those invocations to show up somewhere, so the proxy forwards a minimal event
payload (no tool arguments, no responses) to the endpoint configured under
[proxy.telemetry].endpoint. When no endpoint is configured, the pipeline still
buffers events locally but never attempts an upload.
§Back pressure
A single bounded in-memory queue with drop-oldest semantics. We deliberately avoid
SQLite here — the queue exists to ride out short connectivity hiccups, not to persist
across restarts. If the operator wants durable telemetry they can run the proxy in a
supervised process with a writable working directory and a JSONL sink (future
extension).
§Scheduling
The uploader flushes whenever either:
- the buffer reaches
batch_size, or batch_interval_secshave elapsed since the last flush attempt.
When the endpoint is unset the pipeline still records events (helpful for CLI debug commands) but never attempts an upload.
Structs§
- Telemetry
Auth - Authentication credentials used when uploading batches.
- Telemetry
Batch - Request body shape expected by the backend (documented for the future endpoint).
- Telemetry
Buffer - Shared event buffer.
record()is cheap and lock-bound; clones are light (Arc). - Telemetry
Event - Minimal event payload — intentionally excludes tool arguments and responses.
- Telemetry
Pipeline - The full pipeline — owns the buffer, an uploader, and a background flush task.
- Telemetry
Uploader - Uploader — owns the HTTP client and knows how to ship a batch to
endpoint.
Enums§
- Telemetry
Status - Status of a single tool invocation.