
The ingestion of the first 50 GiB of logs per month for a project is free; after that, it is $0.50/GiB, which includes 30 days of storage, (the default). You can increase the period for logs, but this will incur a storage cost.
There is also a free allotment of monitoring data per month, but charges apply after the first 150 MiB is ingested per billing account. Log-based metrics are also chargeable. This is all as of the time of writing. It is a good idea to keep an eye on the pricing page for changes, as when working at scale, these costs can add up once you have a lot of services and therefore a lot of data.
Summary
You have just dipped your toe into observability. As you may appreciate by now, it is a huge topic, and there is a lot more to learn. However, you have now seen how you can use the Cloud Logging and Cloud Monitoring services to capture logs and metrics and display them in dashboards. You have also seen how you can use alerts to notify you when something goes wrong.
To create this facility, you used the following services directly:
- Cloud Logging is used for capturing and aggregating logs in one place and making them searchable.
- Cloud Monitoring is used for collecting and displaying metrics and creating alerts.
- OpenTelemetry is used for creating metrics and traces from your application to use in Cloud Monitoring and Cloud Trace.
It has been said, “You cannot improve what you cannot measure,” a foundational principle that informed decisions rely on tangible data and observations. Without a clear understanding of a situation, making effective improvements becomes a shot in the dark. In Chapter 14, you’ll look at the scalability of the system. Equipped with the right metrics, you can pinpoint inefficiencies, make informed choices, and optimize performance for better outcomes. You will learn about some of the options you have when scalability becomes an issue.