Skip to content

Development

Adding a command

  1. Add an input + *Validator in .DomainModel / .DomainModel.Impl.
  2. Add the method to IUsageMetersProcessor / DefaultUsageMetersProcessor; mutate the UsageMeter aggregate and emit the appropriate metering.* event.
  3. Expose over both adapters (IUsageMeterManagementService -> REST + Grpc*).
  4. Add unit + acceptance tests, including cross-adapter parity.

Wiring the quota-enforcement saga

UsageMeterQuotaEnforcementStateMachine exists but its UsageReportedForQuotaInboundEvent topic is not registered. To activate it, add the inbound topic to MeteringMassTransitTopology.ConfigureInboundConsumedMessageTopology and the corresponding consumer registration (docs/backlog/metering-gap-backlog.md).

Adding baseline dimensions

Baseline dimensions (api.requests, storage.gb) are hardcoded in DefaultUsageMetersProcessor. Add new baseline dimensions there so they are provisioned on tenant activation.

Keep it counter-based

This context is intentionally not a time-series store. If long-term usage history is needed, emit usage-recorded events to a downstream analytics sink rather than storing rows here.

See also