Record and query usage_meter_recorded
Document what each usage_meter_recorded row represents and which service sends it. Send test events to check the fields, then verify that the query answers your question.
- 1
Outcome becomes final
Usage metering service emits only after the authoritative meter accepts the increment or absolute reading.
- 2
Choose the fields
10 required fields preserve the declared grain: One accepted usage increment per idempotency key and meter.
- 3
Check the test event
Check types, UTC time, alternate outcomes, idempotency, and every pseudonymous or review-classified field.
- 4
Query the result
Which accounts are approaching a quota, and can metered usage be reconciled to the billing ledger?
Grain
One accepted usage increment per idempotency key and meter.
Owner
Usage metering service
Emit when
After the authoritative meter accepts the increment or absolute reading.
Field contract
Field types and data to exclude
Keep field names and types stable once production queries depend on them. Document optional fields and add them only when they answer a specific question.
| Field | Type | Required | Privacy | Meaning |
|---|---|---|---|---|
| timestamp_utc | timestamp | yes | non-sensitive | UTC time when the operation finishes. |
| event_id | string | yes | non-sensitive | Stable unique identifier used for deduplication. |
| release | string | yes | non-sensitive | Application or service version that emitted the event. |
| account_id | string | yes | pseudonymous | Stable internal account identifier, never an email or name. |
| meter_name | string | yes | non-sensitive | Stable low-cardinality billable meter. |
| meter_version | string | yes | non-sensitive | Version of the quantity and aggregation contract. |
| idempotency_key | string | yes | pseudonymous | Stable key used to reject duplicate usage records. |
| quantity | number | yes | non-sensitive | Accepted quantity in the documented unit. |
| unit | string | yes | non-sensitive | Requests, tokens, bytes, seats, or another fixed unit. |
| billing_period | string | yes | non-sensitive | Normalized billing period such as 2026-07. |
Synthetic JSON event
{
"timestamp_utc": "2026-07-29T10:25:18Z",
"event_id": "evt_meter_01",
"account_id": "acct_8f31",
"release": "2026.07.3",
"meter_name": "query_seconds",
"meter_version": "v2",
"idempotency_key": "meter_fa82",
"quantity": 18.4,
"unit": "seconds",
"billing_period": "2026-07"
}Privacy review
Review identifiers before ingestion
This example uses synthetic identifiers. Pseudonymous values can still be personal data, and review fields can expose business or provider context. Apply your own consent, retention, access, residency, and deletion requirements.
account_id: pseudonymousidempotency_key: pseudonymous
Validation checklist
Test the schema before building a dashboard
- Send one known usage_meter_recorded fixture after the documented outcome boundary.
- Verify all 10 required fields arrive with the documented types.
- Retry the same event identifier and confirm the chosen deduplication behavior.
- Send a controlled failure or alternate outcome when the workflow supports one.
- Run the related SQL over a fixed window and reconcile the result to the fixture.
Common mistakes
Record one result per row
- Emitting usage_meter_recorded before usage metering service knows the final outcome.
- Mixing different kinds of results in one table, which makes counts and rates ambiguous.
- Replacing controlled categories with raw URLs, payloads, prompts, or error text.
- Changing a field type in place after saved queries and dashboards depend on it.
- Adding identifiers without a documented investigation, access, and retention need.
Use the contract
Query the event and set up monitoring
Related contracts
Send a test event before production traffic
Create a free API key, send the synthetic event, and inspect the inferred table before connecting a live workflow.