Use Cases
Feature Usage
Measure adoption and entitlement usage across product features.
Use feature usage metering when you need to understand which features customers use, gate features by plan, or report adoption to customer-facing teams.
Model
Create a meter such as feature_usage with:
| Field | Value |
|---|---|
| Unit | event |
| Aggregation | sum |
| Quantity | Usually 1 per feature action |
Useful dimensions:
featureplansourceenvironment
How To Use It
Record usage after a feature action succeeds. Keep feature names stable and product-oriented, not tied to temporary internal implementation names.
This lets you answer:
- Which customers use a feature?
- Which plans rely on a feature most?
- Which features are rarely used?
- Which features should be expanded, limited, or packaged differently?
Example
Create a feature meter:
curl -X POST "$OPEN_SPANNER_BASE_URL/v1/meters" \
-H "Authorization: Bearer $OPEN_SPANNER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "feature_usage",
"description": "Product feature usage",
"unit": "event",
"aggregation": "sum",
"event_retention_days": 180,
"dimensions": [
{ "name": "feature", "type": "string", "required": true },
{ "name": "plan", "type": "string" },
{ "name": "source", "type": "string" },
{ "name": "environment", "type": "string" }
]
}'Record a feature action after it succeeds:
curl -X POST "$OPEN_SPANNER_BASE_URL/v1/usages" \
-H "Authorization: Bearer $OPEN_SPANNER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"idempotency_key": "feature_org_123_bulk_export_001",
"subject": "org_123",
"meter": "feature_usage",
"quantity": 1,
"metadata": {
"feature": "bulk_export",
"plan": "enterprise",
"source": "dashboard",
"environment": "production"
}
}'