Use Cases
Active Users
Track seats, active users, workspaces, and plan-level adoption.
Use active-user metering when your product needs to report seats, monthly active users, active workspaces, or similar account-level activity. This is useful for SaaS pricing, customer health, entitlement audits, and adoption reporting.
Model
Create a meter such as active_users with:
| Field | Value |
|---|---|
| Unit | user |
| Aggregation | sum for activity events, or last for observed seat counts |
| Quantity | 1 per active user event, or a count snapshot |
Useful dimensions:
planworkspacerolesource
How To Use It
For activity-based metering, emit events when users perform meaningful product actions. For seat-count metering, emit snapshots from your account or identity system.
This lets you answer:
- Which customers are active this week or month?
- Which plans drive the most active usage?
- How many seats or workspaces should be billed?
- Which roles are using the product most?
Example
Create a meter for activity events:
curl -X POST "$OPEN_SPANNER_BASE_URL/v1/meters" \
-H "Authorization: Bearer $OPEN_SPANNER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "active_users",
"description": "Meaningful user activity",
"unit": "user",
"aggregation": "sum",
"event_retention_days": 180,
"dimensions": [
{ "name": "plan", "type": "string" },
{ "name": "workspace", "type": "string" },
{ "name": "role", "type": "string" },
{ "name": "source", "type": "string" }
]
}'Record one active-user event when a user performs a billable or reportable action:
curl -X POST "$OPEN_SPANNER_BASE_URL/v1/usages" \
-H "Authorization: Bearer $OPEN_SPANNER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"idempotency_key": "active_org_123_user_456_2026_06_19",
"subject": "org_123",
"meter": "active_users",
"quantity": 1,
"metadata": {
"plan": "enterprise",
"workspace": "workspace_456",
"role": "admin",
"source": "dashboard"
}
}'