Azure Monitor and Google Cloud Observability
CloudWatch bundles metrics, logs, alarms and dashboards. Azure's equivalent is Azure Monitor (metrics, Log Analytics workspaces queried with KQL, Application Insights, alerts). Google's is Google Cloud Observability: Cloud Monitoring, Cloud Logging, Cloud Trace and Error Reporting. The audit trail (CloudTrail) is the Activity log on Azure and Cloud Audit Logs on Google Cloud.
On AWS this is… Amazon CloudWatch (metrics, Logs Insights, alarms, dashboards) and CloudTrail and AWS Config. For Prometheus, Grafana, Loki and OpenTelemetry in depth, see the Observability course.
Side by side
| AWS | Azure | Google Cloud | |
|---|---|---|---|
| Platform metrics | CloudWatch metrics | Azure Monitor platform metrics (automatic) | Cloud Monitoring metrics (automatic, compute.googleapis.com/instance/cpu/utilization…) |
| Logs store | log groups | Log Analytics workspace (tables like ContainerLogV2, AzureActivity, AppRequests) |
log buckets (_Default, _Required) via the Log Router |
| Getting resource logs in | often automatic, or subscription filters | diagnostic settings per resource (or Azure Policy to deploy them everywhere) | automatic for most services; sinks route copies elsewhere |
| Query language | Logs Insights QL (also SQL, PPL) | KQL (Kusto Query Language) | Logging query language (filters); Log Analytics with SQL on upgraded buckets |
| Agent on VMs | CloudWatch agent | Azure Monitor Agent + data collection rules | Ops Agent |
| APM / traces | X-Ray, Application Signals | Application Insights (OpenTelemetry-based) | Cloud Trace (OpenTelemetry) |
| Prometheus | Amazon Managed Service for Prometheus | Azure Monitor managed service for Prometheus | Google Cloud Managed Service for Prometheus (PromQL also works in Cloud Monitoring) |
| Grafana | Amazon Managed Grafana | Azure Managed Grafana | Grafana with the Cloud Monitoring data source |
| Alerts | alarms → SNS | alert rules → action groups | alerting policies → notification channels |
| Audit trail | CloudTrail | Activity log (control plane, kept 90 days; export it) + resource logs for data plane | Cloud Audit Logs: Admin Activity (always on), Data Access (mostly off by default), System Event, Policy Denied |
The Azure gotcha: resource logs are not collected until you add a diagnostic setting. A storage account, key vault or SQL database logs nothing to your workspace by default. Landing zones use Azure Policy (deployIfNotExists) to add diagnostic settings to every new resource.
The Google Cloud gotcha: Data Access audit logs are off by default for most services (BigQuery is the exception), so "who read this bucket?" can't be answered unless you turned them on beforehand.
One question, three query languages
"Count HTTP 5xx responses per service over the last hour":
# CloudWatch Logs Insights
fields service, status
| filter status >= 500
| stats count(*) as errors by service
| sort errors desc
// Azure Monitor (KQL, Application Insights table)
AppRequests
| where TimeGenerated > ago(1h) and toint(ResultCode) >= 500
| summarize errors = count() by AppRoleName
| order by errors desc
# Google Cloud Logging query (the filter), then count in Log Analytics with SQL
resource.type="cloud_run_revision" AND httpRequest.status>=500
SELECT JSON_VALUE(resource.labels.service_name) AS service, COUNT(*) AS errors
FROM `shop-prod-4821.global._Default._AllLogs`
WHERE http_request.status >= 500 AND timestamp > TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 1 HOUR)
GROUP BY service ORDER BY errors DESCAll three do the same thing: filter, group, count, sort. The model below runs that pipeline on a few sample log records so you can see the shape of the answer:
from collections import Counter
logs = [
{"service": "shop-api", "status": 200}, {"service": "shop-api", "status": 503},
{"service": "checkout", "status": 500}, {"service": "shop-api", "status": 502},
{"service": "checkout", "status": 201}, {"service": "search", "status": 200},
{"service": "shop-api", "status": 500}, {"service": "checkout", "status": 504},
]
# filter -> summarize count() by service -> order by desc
errors = Counter(r["service"] for r in logs if r["status"] >= 500)
total = Counter(r["service"] for r in logs)
print(f"{'service':<10}{'errors':>7}{'requests':>10}{'error rate':>12}")
for service, n in sorted(errors.items(), key=lambda kv: (-kv[1], kv[0])):
print(f"{service:<10}{n:>7}{total[service]:>10}{n / total[service]:>12.0%}")service errors requests error rate
shop-api 3 4 75%
checkout 2 3 67%
search has no errors, so it doesn't appear, the same as in the real queries. When you alert on this, alert on the rate, not the count, or a traffic spike looks like an outage.
Sample sessions
# Azure: a workspace, send a key vault's logs to it, query it, list recent control-plane events
az monitor log-analytics workspace create -g rg-shop-ops -n log-shop-prod -l westeurope
az monitor diagnostic-settings create --name to-law \
--resource "$(az keyvault show -n kv-shop-prod --query id -o tsv)" \
--workspace "$(az monitor log-analytics workspace show -g rg-shop-ops -n log-shop-prod --query id -o tsv)" \
--logs '[{"categoryGroup":"allLogs","enabled":true}]' --metrics '[{"category":"AllMetrics","enabled":true}]'
az monitor log-analytics query -w "$WORKSPACE_GUID" \
--analytics-query "AzureDiagnostics | where ResourceProvider == 'MICROSOFT.KEYVAULT' | take 5"
az monitor activity-log list -g rg-shop-prod-app --offset 1d \
--query "[].{when:eventTimestamp, who:caller, op:operationName.value}" -o table
# Azure: a metric alert to an action group
az monitor metrics alert create -g rg-shop-ops -n vm-cpu-high \
--scopes "$VM_ID" --condition "avg Percentage CPU > 85" \
--window-size 5m --evaluation-frequency 1m --action "$ACTION_GROUP_ID"
# Google Cloud: read logs, and route audit logs to a central bucket in another project
gcloud logging read 'resource.type="cloud_run_revision" AND severity>=ERROR' \
--freshness=1h --limit=5 --format="table(timestamp, resource.labels.service_name, textPayload)"
gcloud logging sinks create audit-to-central \
logging.googleapis.com/projects/shop-logs-0001/locations/europe-west1/buckets/audit \
--log-filter='logName:"cloudaudit.googleapis.com"'The az monitor log-analytics query -w flag takes the workspace's customer ID (a GUID), not its resource ID: one more ID format to keep straight.
Test yourself
You created an Azure Key Vault and a Log Analytics workspace. Why are there no Key Vault logs in the workspace?
- Key Vault doesn't log
- Resource logs need a diagnostic setting that sends them to the workspace
- Logs take 24 hours
- KQL can't query them
Which Google Cloud audit logs are always on?
- Data Access
- Admin Activity
- None
- Only BigQuery's
What is the query language of Azure Monitor Logs?
- PromQL
- KQL
- LogQL
- JMESPath