Monetized Usage Record Sync
Aria Allegro monetizes usage records, aggregating them to control volume before syncing with core Aria. It uses a batch-size setting to call the bulk_record_usage_m API. Below is the component architecture for synchronizing monetized usage records.

Summary of the block diagram:
- Scheduler uses the Billing Aggregate configuration to determine how often to synchronize monetized usage records. It calls the core Service to manage aggregated usage.
- Allegro Operations service is invoked by the scheduler to perform these activities
- Refers to the Aggregate Monetized usage configuration to decide if the usage record needs aggregation. If yes, it uses the configuration to determine the attributes to aggregate.
- Finds all monetized usage records not yet synchronized.
- Aggregates usage records using the configuration.
- Creates aggregated usage records.
- Updates monetized usage in batch with the aggregate ID to link aggregated usage and monetized usage. The batch size are system configuration parameters that control the batch-size to use with the bulk_record_usage_m API.
- Publishes each batch ID to the KAFKA topic for the Allegro sync service to consume.
- Aria Allegro Sync Service consumes aggregate usage IDs from the KAFKA topic and performs these activities:
- Reads the batch id from the KAFKA topic and fetches all the aggregated records for the batch.
- Makes a synchronous core Aria bulk_record_usage_m API call.
- Updates the success or error status for each aggregated usage record in the batch based on the core Aria API response.
- Records with errors in the batch are available for later reprocessing.
- Repeats step-3 in parallel for all batches created.
- Allegro UI allows review and reprocessing of aggregated monetized usage that failed to synchronize.