Create billing alerts

Create alerts to help you stay within your billing limits.

This page shows sample alerts for tracking Active Time Series (ATS), log GB, and span GB ingest. The content is intended for Organization Billing Admin users looking to monitor and control Cloud Observability costs.

Billing alert queries

Expand the tabs below to view sample alert queries using billing metrics.

To use the alert queries in Cloud Observability, click Alerts > Create an alert > Editor and paste in the query. For Cloud Observability-alert basics, visit About alerts and Create alerts.

Basic ATS query

Query the sum of all ATS received by your Cloud Observability project:

1
metric lightstep.billing.hourly_active_time_series | latest | group_by [], sum

Expandable end

Percentage-change ATS query

Compare your project’s current ATS levels to ATS levels from the previous day. The time_shift stages take into account the metric’s 12-hour reporting delay.

1
2
3
4
with
  a = metric lightstep.billing.hourly_active_time_series | time_shift 1d | latest | group_by [], sum;
  b = metric lightstep.billing.hourly_active_time_series | time_shift 2d | latest | group_by [], sum;
join abs((a - b) / b * 100), a=0, b=0

Expandable end

Basic log GB queries

Query the sum of all log GB received by your Cloud Observability project:

1
metric lightstep.billing.log_bytes | delta 1h | group_by [], sum

Query the sum of log GB in your project’s cold storage:

1
metric lightstep.billing.log_storage_cold | reduce max | group_by [], max

Query the sum of log GB in your project’s hot storage:

1
metric lightstep.billing.log_storage_hot | reduce max | group_by [], max

Expandable end

Basic span GB query

Query the sum of all span GB received by your Cloud Observability project. The time_shift takes into account the metric’s one-hour reporting delay.

1
metric lightstep.billing.span_bytes | time_shift 1h | delta 1h | group_by [], sum

Expandable end

Percentage-change span GB query

Compare your project’s current span GB levels to span GB levels from the previous day. The time_shift stages take into account the metric’s one-hour reporting delay.

1
2
3
4
with
  a = metric lightstep.billing.span_bytes | time_shift 1h | delta 24h | group_by [], sum;
  b = metric lightstep.billing.span_bytes | time_shift 25h | delta 24h | group_by [], sum;
join abs((a - b) / b * 100), a=0, b=0

Expandable end

Billing alert thresholds

There are two ways to set basic billing alert thresholds. You may want to monitor and adjust your thresholds over time.

The approaches below are for basic alerts. For percentage-change alerts, base thresholds on time_shift and your needs.

For example, if you compare current data to yesterday’s data and set Critical to 50, you get notified if ingest rises by 50% or more.

Use historical data

Use the last 30 days of data to identify Critical and Warning thresholds. The chart on the alert configuration page shows your historical billing data.

Use hourly project budgets

Estimate hourly, project-level budgets to identify Critical and Warning thresholds.

Follow these steps to estimate hourly project budgets:

  1. Find your monthly ATS, log GB, and span GB limits.

    In Cloud Observability, click Settings > Overview > What are my contract details?.

  2. Calculate your organization’s hourly budgets.

    Divide your monthly limits by 720 (the hours in a 30-day month). For example, if your monthly ATS limit is 2.5M, your organization’s hourly ATS budget is 3,472 (2.5M/720).

  3. Calculate your project’s hourly budgets.

    Multiply your organization’s hourly budgets by your project’s budget percentage. Using the example above, if your project gets 50% of your organization’s hourly ATS budget, your project’s hourly ATS budget is 1,736 (3,472*.5).

Next steps

Visit the links below to learn more about Cloud Observability billing and alerts.

See also

Monitor usage

Create billing dashboards

Create alerts

Updated Sep 27, 2023