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
