Menu
Grafana Cloud

Set up usage alerts for Grafana Cloud billing

Set up billing usage alerts for Cloud Metrics, Cloud Logs, or Cloud Traces to get notified when your usage has exceeded a set threshold. This can help prevent unexpected charges.

It’s best to set up billing alerts for overall usage or product-level usage.

Before you begin

Make sure you understand how usage is billed:

Make sure you understand how Grafana alerting and alert routing works.

Set up a billing alert for overall or product usage

To set up billing alerts, the easiest way is to create alerts from panels in the Grafana Cloud billing dashboard.

  1. In your Grafana Cloud instance, go to the Billing/Usage dashboard.

  2. Create an alert:

    • For overall usage, go to the panel named Current Billable Usage Cost.

    • For product-level usage cost, go to one of the following panels:

      • Current Metrics Usage Cost
      • Current Logs Usage Cost
      • Current Traces Usage Cost.
  3. Select the vertical ellipsis > More… > New alert rule.

  4. Follow the instructions within the UI.

    1. Enter a name for your alert rule.

    2. In the Define query and alert condition section, set a value for Threshold.

      If you set a threshold to 10000 in the IS ABOVE field, the alert fires after your month-to-date billable usage has exceeded $10,000.

      Optionally, you can modify an alert query and condition. For more information, refer to Define query and condition.

  5. In the Set evaluation behavior section, define how the alert is evaluated, and select the evaluation group to put it in.

    For more information, refer to Set alert evaluation behavior.

  6. (Optional) In the Add annotations section, add annotations for your alert.

    Doing so provides a summary and description about what happened and what the alert rules does.

    For example:

    • Summary (optional): If the current situation continues, the cost threshold that you set will be exceeded.
    • Description (optional): Your usage consumption is currently higher than the alert threshold. To make sure that it’s not a result of very high cardinality or a misconfiguration, refer to the cardinality dashboard. Alternatively, revise your monthly budget.

    For more information, refer to Labels and annotations.

  7. In the Configure notifications section, define how your notifications are to be routed.

    1. Add custom labels to change the way your notifications are routed.
    2. Preview the routing results.

    For more information, refer to Configure notifications.

  8. In the upper right, click Save rule and exit.

Set up additional metrics-usage alerts

Grafana Cloud Metrics uses 95th percentile billing to avoid billing you for temporary spikes in metrics volumes. However, this also means that alerts based on billable series can be slower at detecting increases in metric usage.

If you want more forewarning about increases in metrics usage, we recommend configuring two additional alerts:

  • Active series
  • Data points per minute (DPM)

Set up an alert for active series usage

Follow these directions to set up an alert for active series usage.

  1. In your Grafana Cloud instance, navigate to the Alerts & IRM > Alerting > Alert rules.

  2. Click Create alert rule.

  3. Select Grafana managed alert.

  4. In query panel A, select grafanacloud-usage from the data source dropdown menu.

  5. Select the Code option in the upper-right corner of the panel.

  6. Enter the following query:

    promql
    (
    # Number of active series:
    sum(grafanacloud_instance_active_series)
    *
    # Current price per billable-series (calculated from current usage levels and your contract):
    sum (grafanacloud_org_metrics_overage) / sum (grafanacloud_org_metrics_billable_series)
    )
  7. Run the query if it hasn’t run yet; click Run queries.

  8. Set your budget threshold by dragging the red tab at the right of the graph, or by setting an IS ABOVE condition in the panel that has this threshold setting. This is probably panel B or C.

    Alert setup
    Alert setup

  9. Add optional descriptive details to your alert, for example:

    • Summary: If your current active series count continues, you will eventually exceed your monthly metrics budget.
    • Description: Your active series usage is currently higher than the alert threshold. Consult the cardinality dashboard to ensure it is not a result of high cardinality or a misconfiguration, or reconsider your monthly budget.
      Alert details
      Alert details

Set up an alert for data points per minute

The set up for an alert on (data points per minute) (DPM) as follows relates to a billable series:

  1. In your Cloud instance, navigate to the Alerts & IRM > Alerting > Alert rules.

  2. Click Create alert rule.

  3. Select Grafana managed alert.

  4. In query panel A, select grafanacloud-usage from the data source dropdown menu.

  5. Select the Code option in the upper-right corner of the panel.

  6. Enter the following query:

    promql
    (
    # Data points received per minute:
    sum (grafanacloud_instance_samples_per_second*60)
    /
    # Divide by "Included DPM" to approximate billable-series
    sum (grafanacloud_org_metrics_included_dpm_per_series)
    *
    # Current price per billable-series (calculated from current usage levels and your contract):
    sum (grafanacloud_org_metrics_overage) / sum (grafanacloud_org_metrics_billable_series)
    )
  7. Set your budgeting threshold by dragging the red tab at the right of the graph, or by setting an IS ABOVE condition in panel B.

  8. Add optional descriptive details to your alert, for example:

    • Summary: If you continue at your current DPM usage level, you will eventually exceed your monthly metrics budget.
    • Description: The billable series due to DPM (total data points received / data points included per series) is currently higher than the alert threshold. If the ActiveSeries Usage alert is not firing, then you likely have some series with a DPM higher than what’s included in your plan. To view the DPM of your metrics, use the following query: count_over_time{__name__=<your_metric_name_here>}[10m])).