grafana / synthetic-monitoring-app

Synthetic Monitoring frontend application
https://grafana.com/docs/grafana-cloud/how-do-i/synthetic-monitoring/
GNU Affero General Public License v3.0
122 stars 17 forks source link

Disable check creation for free tier users that have exceeded their limits #914

Open ckbedwell opened 1 month ago

ckbedwell commented 1 month ago

Problem

Currently the free tier for Grafana Cloud is 100,000 executions per month. If a user exceeds this limit they aren't informed in the UI until they go through the process of creating / updating a check and receiving a 'Save failed' error message:

Screenshot of Grafana Cloud Synthetic Monitoring check form on the submission section of check creation. It shows a save failed error with a check executions quota description.

Completion criteria

Do a manual lookup up of how many executions all of a tenant's checks create and if it exceeds 100,000:

Considerations

Please ensure your solution will account for when browser checks are GA. It is unconfirmed yet but it is likely that 1 browser check will be the equivalent to 10 test executions.

The manual calculation is somewhat naive and may yield incorrect results. e.g. we count an execution per minute of a check's execution time. If a user's tests are long-running they may have used more of their quota each month then our manual calculation results.

This is a known limitation which is not expected to be considered for this ticket to be considered completed. However it may be worth investigating how the cloud-home-app queries the Synthetics usage as that would be more accurate than our own calculations:

Screenshot of Grafana Cloud cloud home app dashboard with usage metrics being displayed.