Business metrics collection. Products push what happened; brokkr stores it in Postgres at the grain the metric declares; Metabase reads one view.
POST/v1/observe
count distinct entities — the same entity twice counts once
curl -X POST https://<host>/v1/observe \
-H 'Authorization: Bearer brk_<product>_<env>_…' \
-H 'Content-Type: application/json' \
-d '{
"metric": "active_users",
"entity": "u_4711",
"dims": {"client": "socaps"},
"spec": {"grain": "day"}
}'
metricentityatoptionaldimsoptionalproductoptionalspecoptional
POST/v1/measure
accumulate a counter (add) or record a snapshot (set)
curl -X POST https://<host>/v1/measure \
-H 'Authorization: Bearer brk_<product>_<env>_…' \
-H 'Content-Type: application/json' \
-d '{
"metric": "entity_views",
"value": 1,
"mode": "add",
"dims": {"client": "socaps"}
}'
metricvalueoptionalmodeoptionalatoptionaldimsoptionalproductoptionalspecoptional
Fields above are read from the running service, so they cannot drift from the
API. What a metric means — grain, kinds, why a monthly unique count is re-counted
rather than summed — lives in the
concepts guide. Check that writes land with
GET /v1/status.
