Expand description
Per-addon / per-tool usage metering (P5 — discovery & observability).
Every gateway proxy call (crate::core::gateway::proxy) is attributed to
its owning server and tool, and counted in a local ledger
(<data_dir>/addons/usage.json). This is the foundation for marketplace
analytics, builder dashboards and usage-metered billing (Track B) — without
it there is no honest basis to pay a builder or show “most-used” tools.
Local-only and side-channel: metering writes to a state file, never to a tool
output body, so it cannot perturb output determinism (#498). Controlled by
addons.metering (default on).
Structs§
- Server
Usage - Aggregated usage for one gateway server (= one addon).
- Tool
Stat - Call counters for a single downstream tool.
- Usage
Ledger - The on-disk usage ledger (
<data_dir>/addons/usage.json).
Functions§
- record
- Record a single proxied call for
server::tool. No-op whenaddons.meteringis off or the data dir is unavailable. Best-effort: a metering write failure never affects the proxied call’s result.