feat: billing — usage tracking per SQS operation in PostgreSQL
- New package app/billing: Init/RecordUsage/Close with auto-migrate - Integration in actionHandler: record tenant_id, operation, msg_count, msg_bytes - Helm chart: billing section in values.yaml, secret-billing.yaml, env vars in deployment - Optional: billing disabled by default (BILLING_PG_HOST not set = no-op) - Table: sqs_usage_records with index on (tenant_id, recorded_at)
This commit is contained in:
@@ -2,6 +2,15 @@
|
||||
|
||||
## Версия v0.1.x
|
||||
|
||||
### v0.1.23-dev (2026-04-12) — billing: учёт SQS-операций в PostgreSQL
|
||||
- ✅ Новый пакет `app/billing/` — подключение к PG, auto-migrate, async запись usage
|
||||
- ✅ Интеграция в actionHandler — каждая успешная SQS-операция записывается
|
||||
- ✅ Опциональность: если BILLING_PG_HOST не задан — billing выключен, SQS работает как раньше
|
||||
- ✅ Helm chart: секция `billing:` в values.yaml, secret-billing.yaml, env в deployment.yaml
|
||||
- ✅ Таблица `sqs_usage_records`: tenant_id, operation, msg_count, msg_bytes, recorded_at
|
||||
- ✅ `go build ./...` — OK
|
||||
- 🔲 Собрать Docker image и задеплоить с PostgreSQL credentials
|
||||
|
||||
### v0.1.22 (2026-04-12) — demo UI showcase mode deployed
|
||||
- ✅ Demo UI token поддержан сервером: `demo-ui-shared-sqs-ngcloud-2026`
|
||||
- ✅ Реальный JWT login сохранён без изменений
|
||||
@@ -122,6 +131,8 @@
|
||||
|
||||
## Next Steps
|
||||
|
||||
- [ ] Перед production без demo user удалить из кода demo UI token path, seeded demo tenant, demo credentials в README и все публичные demo-подсказки в UI
|
||||
- [ ] Если demo path нужен дольше, сначала вынести его под явный feature flag с default=off для production окружения
|
||||
- [ ] Per-queue locking (заменить глобальный мьютекс на per-queue sync.RWMutex)
|
||||
- [ ] DLQ (Dead Letter Queue) — maxReceiveCount → перемещение в DLQ
|
||||
- [ ] Rate limiting per tenant
|
||||
@@ -187,6 +198,12 @@ Secret Key: demo-secret-key-shared-sqs-ngcloud-2026
|
||||
Endpoint: https://qu.kube5s.ru
|
||||
```
|
||||
|
||||
TODO перед production без demo-доступа:
|
||||
- удалить demo token path из [app/admin/admin.go](/home/naeel/remote_dev/SQS-service/app/admin/admin.go)
|
||||
- выключить/удалить seeded demo tenant
|
||||
- удалить публичные demo credentials и demo token из пользовательской документации
|
||||
- убрать demo-подсказки из [app/ui/index.html](/home/naeel/remote_dev/SQS-service/app/ui/index.html)
|
||||
|
||||
## Deployment
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user