Expand description
Buffered usage accounting for MCP calls.
Recording is synchronous, memory-only, and never performs network I/O. A
separate BillingPipeline::flush drains aggregates into an exporter. If an
export fails, the exact same event identifiers and quantities are retained
for retry, which makes ambiguous provider failures safe.
Structs§
- Aggregated
Usage - One pre-aggregated provider event ready for export.
- Billing
Pipeline - Coordinates a
UsageBufferwith an off-path exporter. - Composite
Exporter - Fan-out exporter for logs, billing, analytics, and audit sinks.
- FnExporter
- Adapter for an application-owned async export function.
- LogExporter
- Stateless exporter that emits structured log events.
- Meter
Event Dead Letter - A meter event that needs application-owned reconciliation.
- Meter
Event Exporter - Exports pre-aggregated usage through an application-supplied provider.
- Meter
Event Provider Error - Sanitized batch-wide provider failure without per-event outcomes.
- Noop
Recorder - Shared, no-op recorder for deployments that want attribution metrics only.
- Usage
Buffer - Thread-safe in-memory aggregator with bounded idempotency memory.
- Usage
Event - One delivered unit event emitted by the request path.
Enums§
- Export
Error - Provider export failure.
- Meter
Event Dead Letter Reason - Why a meter event was quarantined for reconciliation.
- Meter
Event Outcome - The provider’s final or retryable disposition for one meter event.
- Record
Error - Recording failures are internal synchronization failures only.
- Record
Outcome - Result of attempting to record an event.
Traits§
- Batch
Exporter - Exports a prepared batch away from the request path.
- Meter
Event Provider - Submits ordered batches of pre-aggregated usage to a billing provider.
- Usage
Recorder - A synchronous usage sink suitable for the HTTP hot path.
Type Aliases§
- Export
Future - Boxed future returned by object-safe billing exporters.
- Meter
Event Provider Future - Boxed future returned by a meter event provider.
- Shared
Exporter - Convenient trait-object alias for composing exporters at runtime.
- Shared
Recorder - Convenient trait-object alias used by the edge layer.