Flushing metered records

Flushing metered records

Flushing is the process of sending accumulated usage data from the Meter processor to downstream systems at the end of each metering period. This ensures that all usage is accurately recorded, reported, and ready for billing, auditing, or further processing.

Note!
A usage audit is generated whenever input data is sent out from the Meter processor.

What happens during a flush?

When a flush occurs:

  • The Meter processor generates a record containing all aggregated usage data for each meter.

  • This record is sent downstream in JSON format.

  • The meter’s values are reset, preparing it for the next metering period.

  • Any custom fields or group breakdowns configured for the meter are included in the output.

When does a flush occur?

Flushes are typically triggered by the meter’s reset schedule (for example, daily, monthly, or at a custom interval). At the end of each period, meters are flushed if either of the following conditions is met:

  • The meter type is currently active (i.e., the current date is within the meter type’s start and end dates), or

  • The meter has accumulated new usage data during the period.

If a meter has not been updated during the current period and the meter type’s active period has ended (“active to date” has passed), the meter will not be flushed at period end.

What data is included in a flushed record?

Each flushed record contains a comprehensive snapshot of the meter’s state at the end of the period.
The following fields are included:

Field

Description

Field

Description

meterTypeId

Unique ID of the meter type that aggregates usage.

userId

Unique ID of the user (e.g., email, username, MSISDN).

meterKey

The key for the Meter processor that has aggregated the usage.

value

Current value of the meter, based on aggregation rules.

groupBreakdowns

Breakdown of aggregated values by group, as defined in the meter configuration.

carryFirst

First occurrence of fields to be carried over (configured in Copy-Meter processor).

carryLast

Last occurrence of fields to be carried over (configured in Copy-Meter processor).

customFields

Additional fields added via API (e.g., brand, type, model).

capacity

The total capacity of the meter type, used as a reference for thresholds.

thresholds

Any configured thresholds that trigger events or notifications.

deleteOnReset

Indicates if the meter will be deleted at the end of the period (can be updated via API).

createdAt

UTC timestamp when the meter was created.

updatedAt

UTC timestamp when the meter was last updated.

id

Unique ID of the meter.

meterTypeName

Name of the meter type.

timezone

Timezone for the reset time, as defined in the meter type.

unit

Unit of measurement for usage.

periodStart

UTC timestamp for when the metering period started.

periodEnd

UTC timestamp for when the metering period ended.

meterMetaData

Additional meta information (e.g., first/last record timestamps for this meter).

Viewing and using flushed records

  • Flushed records can be viewed in the Meter processor inspect tab

  • All custom fields and group breakdowns are included, allowing for detailed analysis or integration with external systems (such as billing platforms).

  • You can use APIs to collect and extract data from flushed records, including any custom fields. See https://infozone.atlassian.net/wiki/x/qwJoDQ.

view-meter.png