Skip to main content

Module usage

Module usage 

Source
Expand description

Usage aggregation subsystem.

Subscribes to fraiseql::mutation_audit tracing events (emitted by the runtime after every successful mutation) and maintains in-memory per-tenant, per-period, per-entity-type counters.

§Architecture

fraiseql-core runtime
  └── tracing::info!(target: "fraiseql::mutation_audit", ...)
        │
        ▼
MutationAuditLayer (tracing_subscriber::Layer)
  └── UsageAggregator (DashMap<(tenant, period, entity), AtomicU64>)
        │
        ▼
HTTP query endpoint
  GET /api/v1/admin/usage?tenant_id=…&period=…

§Limitations (v1)

  • In-memory only: counters reset to zero on process restart.
  • Unbounded: no eviction; see aggregator module docs for growth bounds.

Modules§

aggregator
In-memory usage counter store.
events
Mutation audit event type.
layer
Tracing subscriber layer that captures fraiseql::mutation_audit events.