Controlling your costs

The Cloud Billing Reports page, as well as the Logging,
Monitoring, and Trace consoles, show your
current usage data. Based on your current usage data, you can reasonably predict
estimating your bills.

You can create an alerting policy that
monitors your usage and alerts you when you
approach the threshold for billing. To create an alerting policy that triggers
if your Cloud Logging usage exceeds a threshold, use the settings listed in
the next section. The follow-on section contains the settings for an alerting
policy that monitors your trace-span usage.

Alerting on Cloud Logging monthly log bytes ingested

To create an alerting policy that triggers when your monthly
log bytes ingested exceeds your user-defined limit for
Cloud Logging, use the following settings:

For a project to ingest more than the free log allotment of 50 GiB
per month, that project must have a valid
billing account.
Certain limits also apply to your use of Logging; for more
details, including data retention periods, see
Quotas and limits.

Non-chargeable logs

Logging charges for the volume of ingested log data that exceeds
the free monthly logs allotment. All logs received by Logging
count towards the logs allotment limit, except for the following:

You can configure your project to receive Data Access audit logs beyond
those that are provided by the default configuration, but those logs are
chargeable and count against your free allotment.
For more information, see
Configuring Data Access audit logs.

Excluded logs. Logging gives you the ability to
manually identify and exclude less important log entries from your project,
thus reducing your usage. For more information, see
Excluding logs.

Logs storage pricing

Note: There are currently no additional charges for Cloud Logging beyond
ingestion costs. Effective March 31, 2021, storage costs will apply
to all chargeable logs retained longer than the
default retention periods at the rate
of $.01 per GiB per month.

For each Google Cloud project, Logging automatically
creates two logs buckets for storage:
_Required and _Default. When pricing goes into effect, you won't be charged
for logs stored in the _Required logs bucket, which contains
non-chargeable logs.

You can also create custom logs buckets in any Google Cloud project.
If you configure custom retention
periods on your custom buckets or the _Default bucket, extending logs
data retention longer than the
default retention periods, then the
storage costs will apply.

Reduce your logs ingestion

You can take advantage of two free services in Logging to
reduce your logs usage and preserve log entries that might otherwise be lost:

Logs exclusion lets you completely exclude log entries matching a specific
filter or sample certain messages so that only a sampled percentage of the
messages appear in the Logging Logs Viewer. Excluded log
entries don't count against your allotment. You can export your excluded log
entries to retain access to them outside of Logging. For
instructions on how to exclude logs, see
Excluding Logs.

Logs export lets you export log entries out of Logging
before they are discarded because either you have exceeded your logs allotment
or you have marked the log entries for exclusion. There is no
Logging charge for exporting logs, but the services that
receive your exported logs charge you for the usage. For instructions how
to export logs, review Exporting Logs.

When metric data is chargeable, the number and type
of data points in your time series
contribute to your ingested volume. The values for the metric labels that
are part of your time series don't contribute to your ingested volume.
The ingestion volume for a scalar data type is 8 bytes and for a distribution
data type is 80 bytes.

API calls to write time series data
are non-chargeable; API calls to query time series data are charged at a nominal
rate after the free allotment is consumed.

Certain limits also apply to your use of Monitoring; for more
details, including data retention periods, see
Quotas and limits.

Pricing examples

The following examples illustrate how to get an estimate of costs for
collecting metric data. These are intended to illustrate the new metrics
pricing; for comprehensive estimates, use the Pricing
Calculator.

The basic scenario is this: You have some number of
monitored resources, such as Compute Engine, Google Kubernetes Engine,
or App Engine, that are writing data from some number of metrics each month.

The variables across the scenarios include:

The number of resources.

The number of metrics.

Whether the metrics are Google Cloud metrics or not.

The rate at which the metric data is written.

Common background

In the following pricing examples, each metric data point ingested is assumed to
be of type double, int64, or bool; these count as 8 bytes for pricing
purposes.

There are roughly 730 hours (365 days / 12 months * 24 hours) in a month, or
43,800 minutes.

For one metric writing data at the rate of 1 data point/minute for one month:

Total data points is: 43,800

Total volume ingested is:

350,400 bytes (43,800 data points * 8 bytes)

0.33416748 MiB (350,400 bytes / 1,048,576 bytes/MiB)

For one metric writing data at the rate of 1 data point/hour for one month:

Scenario 2: You have 1,000 resources, each writing 75 metrics.
These are chargeable metrics, meaning that they aren't Google Cloud
metrics and aren't Anthos metrics, writing at the rate of 1
data point/minute.

Monthly ingestion: 25,063 MiB (same as above)

Approximate cost per month: $6,427.55

MiB ingested

Rate ($/MiB)

Cost ($)

150

0.00

$0.00

24,913

0.258

$6,427.55

Total

25,063

$6,427.55

Scenario 3: You have 1,000 resources, each writing 75 metrics.
These are chargeable metrics, meaning that they aren't Google Cloud
metrics and aren't Anthos metrics, writing at the rate of 1
data point/hour.

Monthly ingestion: 418 MiB = 0.005569458 MiB for one metric * 75,000

Approximate cost per month: $69.14

MiB ingested

Rate ($/MiB)

Cost ($)

150

0.00

$0.00

267

0.258

$69.14

Total

417

$69.14

Scenario 4: You have 1 resource writing 500,000 metrics.
These are chargeable metrics, meaning that they aren't Google Cloud
metrics and aren't Anthos metrics, writing each at the rate of 1
data point/minute.

Trace pricing

Note: The following pricing for Trace is in effect as of
November 1, 2018. Billing enforcement for scanning has been postponed.Note: Trace pricing doesn't apply to Trace
spans auto-generated by App Engine Standard: ingestion of these traces are
non-chargeable. Trace spans created by instrumentation you add to
your App Engine Standard application are subject to ingestion charges.

Trace charges are based on the number of trace
spans ingested and scanned.
When latency data is sent to Trace, it's packaged as a
trace that is composed of spans, and the spans are ingested by
the Cloud Trace backend. When you view trace data, the stored spans are
scanned by Cloud Trace.

Certain limits apply to the use and retention of Trace data. For
more details, see Quotas and limits.

Pricing examples

If you ingest 2 million spans in a month, your cost is $0. (Your first
2.5 million spans ingested in a month are free.)

If you ingest 14 million spans in a month, your cost is $2.30. (Your first
2.5 million spans in a month are free. The remaining spans' cost is
calculated as 11.5 million spans * $0.20/million spans = $2.30.)

If you ingest 1 billion spans in a month, your cost is $199. (Your first
2.5 million spans in a month are free. The remaining spans' cost
is calculated as 997.5 million spans * $0.20/million spans = $199.)

If you send your VPC flow logs to Logging,
VPC flow logs generation charges are waived, and only
Logging charges apply. However, if you send them and then exclude
your VPC flow logs from Logging,
VPC flow logs charges apply. For more information, see
Google Cloud Pricing Calculator for Networking.