Allow absolute values in Weighted Sum Aggregation
complete
M
Markand
Currently Weighted sum aggregation doesn't support sending absolute values. For example, if we are measuring storage like S3, and at any instance user uploads 5 GB of data, we send unit property as 5, now when user deletes some data(say 1 GB) we need to send -1(relative to previously sent reading) instead of 4.
Generally in large systems not every byte of upload and delete is measured, rather total storage at the end of the day is measured. So what happens is we need to store what reading we submitted in last event. So when we get a current storage size of user, we need to calculate the difference from previous reading and then send that difference in the event which can lead to inconsistencies and involves storing previous readings for all customers. Hence it will be very helpful if we can send usage meter property in absolute value.
Basically I am requesting recurring time weighted LATEST aggregate!
Lago admin
complete
You can now use our feature SQL CUSTOM EXPRESSIONS, available for all our users:
For your usage-based metrics, define SQL expressions to aggregate usage, such as rounding, concatenation or math operations.
Docs: https://getlago.com/docs/guide/billable-metrics/sql-expressions
M
Markand
Lago admin I just referred to the documentation. I can not understand, how it solves this issue? Documentation does not clarify that when this expression is run, and does it apply to the event being ingested or all events? If it just applies to event being ingested, how we can send absolute value and achieve desired result? It'll be better if an example can be provided or documentation expanded to explain how custom sql expression works and what should be output of the expression
Lago admin
in progress
Lago admin
planned
This will be achievable through a feature called
custom SQL expressions
Ayush Chothe
Yes, this should be implemented as we don't always have the last value sent to Lago.