Skip to content

Commit

Permalink
remove extraenous aggregate_type label from metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
lilioid committed Feb 13, 2024
1 parent 5c8aac9 commit 1a6ebc4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/vinywaji/metrics/async_instruments.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ def calc_balances(_options: CallbackOptions) -> Iterable[Observation]:
for i in models.User.objects.all().annotate(current_balance=Sum("transactions__amount")).values()
]

yield Observation(attributes={"balances": "all", "aggregate_type": "sum"}, value=reduce(add, balances, 0))
yield Observation(attributes={"balances": "all"}, value=reduce(add, balances, 0))
yield Observation(
attributes={"balances": "negative", "aggregate_type": "sum"},
attributes={"balances": "negative"},
value=reduce(add, (i for i in balances if i < 0), 0),
)
yield Observation(
attributes={"balances": "positive", "aggregate_type": "sum"},
attributes={"balances": "positive"},
value=reduce(add, (i for i in balances if i > 0), 0),
)

0 comments on commit 1a6ebc4

Please sign in to comment.