Why observability matters in GCP - Performance Analysis
We want to understand how the effort to observe cloud systems grows as they get bigger or more complex.
How does the amount of data and monitoring needed change when more resources are added?
Analyze the time complexity of collecting logs and metrics from multiple cloud resources.
// Pseudocode for observability data collection
for each resource in project_resources:
fetch_logs(resource)
fetch_metrics(resource)
send_data_to_monitoring_service()
This sequence collects logs and metrics from each resource and sends them to a monitoring service.
Identify the API calls, resource provisioning, data transfers that repeat.
- Primary operation: Fetching logs and metrics for each resource.
- How many times: Once per resource in the project.
As the number of resources grows, the number of data fetches grows at the same rate.
| Input Size (n) | Approx. Api Calls/Operations |
|---|---|
| 10 | 20 (2 per resource) |
| 100 | 200 |
| 1000 | 2000 |
Pattern observation: The operations increase directly with the number of resources.
Time Complexity: O(n)
This means the work to collect observability data grows in direct proportion to the number of resources.
[X] Wrong: "Observability data collection stays the same no matter how many resources there are."
[OK] Correct: Each resource adds its own logs and metrics, so more resources mean more data to collect and process.
Understanding how monitoring scales helps you design systems that stay reliable as they grow, a key skill in cloud roles.
"What if we aggregated logs at the source before sending? How would the time complexity change?"