- AI usage meter, which filters the events with the name
ai_usage
and sums thetotal_tokens
field. - Video streaming meter, which filters the events with the name
video_streamed
and sums theduration
field. - File upload meter, which filters the events with the name
file_uploaded
and sums thesize
field.
Creating a Meter
To create a meter, navigate to the Meters page in the sidebar and click the “Create Meter” button.
Filters
A filter is a set of clauses that are combined using conjunctions. They’re used to filter events that you’ve ingested into Polar.
Clauses
A clause is a condition that an event must meet to be included in the meter.Property
Properties are the properties of the event that you want to filter on. If you want to match on a metadata field, you can use the metadata key directly. No need to include ametadata.
prefix.
Operator
Operators are the operators that you want to use to filter the events.- Equals
- Not equals
- Greater Than
- Greater Than or Equals
- Less Than
- Less Than or Equals
- Contains
- Does Not Contain
Value
Values are automatically parsed in the filter builder. They’re parsed in the following order:- Number — Tries to parse the value as number
- Boolean — Checks if value is “true” or “false”
- String — Treats value as string as fallback
Conjunctions
A conjunction is a logical operator that combines two or more clauses.- and — All clauses must be true for the event to be included.
- or — At least one clause must be true for the event to be included.
Aggregation
The aggregation is the function that is used to aggregate the events that match the filter. For example, if you want to count the number of events that match the filter, you can use the Count aggregation. If you want to sum the value of a metadata field, you can use the Sum aggregation.- Count — Counts the number of events that match the filter.
- Sum — Sums the value of a property.
- Average — Computes the average value of a property.
- Minimum — Computes the minimum value of a property.
- Maximum — Computes the maximum value of a property.
- Unique — Counts the number of unique values of a property.
Example
Example
Consider the following events:Here is the result of each aggregation function, over the
total_tokens
metadata property:- Count: 4 units
- Sum: 90 units
- Average: 22.5 units
- Minimum: 10 units
- Maximum: 30 units
- Unique: 3 units
metadata.
prefix.
Example
The following Meter Filter & Aggregation will match events that have the nameopenai-usage
and sum units over metadata property completionTokens
.

You can Preview the events matched by the meter while creating it.