openvibers/openvibe.host Commits

alerts: print the AI balance in dollars, not milli-units (#300)

OP OpenVibers committed 7 days ago · 6dbfb32bb5 · 1 file, +1 −1

humanize renders 0.05 as "50m", which reads as fifty million. A printf with
two decimals says "$0.05" in the ticket the owner gets.

Changes

ddiff --git a/deploy/prometheus/openvibe-rules.yml b/deploy/prometheus/openvibe-rules.yml
iindex 1b61a26..38390ab 100644
---- a/deploy/prometheus/openvibe-rules.yml
++++ b/deploy/prometheus/openvibe-rules.yml
@@@ -35,7 +35,7 @@ groups:
for: 10m
labels: { severity: ticket }
annotations:
-- summary: "OpenVibe.AI provider {{ $labels.provider }} balance is ${{ $value | humanize }} (below $2): top it up before AI stops answering"
++ summary: 'OpenVibe.AI provider {{ $labels.provider }} balance is ${{ printf "%.2f" $value }} (below $2): top it up before AI stops answering'
- alert: HighErrorRate
expr: |
sum by (service) (rate(http_requests_total{status=~"5.."}[10m]))