flagsmith icon indicating copy to clipboard operation
flagsmith copied to clipboard

Organisation usage charts should show data for current billing period

Open matthewelwell opened this issue 1 year ago • 3 comments

Conversation for context: https://github.com/Flagsmith/flagsmith/pull/3340#pullrequestreview-1872606131.

Currently the Organisation usage charts show the numbers for the previous 30 days. We are making changes in the PR linked above to send customers alerts when they hit certain thresholds of their API calls limits. Based on this, we'll need to add information to this screen which shows the data for the current billing period.

image

I suggest that we add some kind of switcher which allows you to switch between current billing period and then the previous 30 days. The charts should display exactly the same, but the numbers should change (in 99% of cases).

matthewelwell avatar Feb 12 '24 14:02 matthewelwell

Next step: discuss with @novakzaballa as to what is feasible from a FE perspective.

matthewelwell avatar Feb 12 '24 14:02 matthewelwell

Notes from call with Novak:

  • Include prior billing period as it's own selection
  • Include current billing period (TBD: how does the current billing period look if there is not many days?)
  • Include rolling 30 day billing period.

Some possible nice to haves:

  • A 60 or 90 day window to show longer window to users.

Notes on the integration:

  • Should be straightforward if the structure is similar for the graphs.
  • Not 100% sure about the structure for the current billing period or the 90 day window will be able to easily snap in.

zachaysan avatar Apr 22 '24 18:04 zachaysan

@zachaysan I can explain how the downsampling works in Influx - there are several downsampling stages so its important you are querying the right bucket if timeliness of data is important.

dabeeeenster avatar Apr 23 '24 07:04 dabeeeenster

The endpoint at /api/v1/organisations/{organisation_pk}/usage-data accepts the query parameter period=current_billing_period|previous_billing_period|90_day_period.

Note that only paid organisations should have access to the billing period specific periods.

matthewelwell avatar Aug 21 '24 11:08 matthewelwell