1
---
2
name: google-cloud-networking-observability
3
metadata:
4
version: "1.0.11"
5
category: Compute
6
description: >-
7
Investigates Google Cloud networking issues by analyzing Google Cloud logs,
8
metrics, and control-plane diagnostics. Use when troubleshooting Cloud Load
9
Balancing, VPC Flow Logs (traffic analysis, packet drops, Private Service
10
Connect, serverless egress, or cost estimation), Firewall Rules Logging,
11
Cloud NAT, Cloud IDS and Firewall Threat Logs, Cloud VPN tunnels and metrics,
12
Cloud Router BGP sessions and route policies, network latency/RTT, or Network
13
Management Connectivity Tests. Don't use for generic VM administration or
14
non-networking tasks.
15
---
16
17
# Google Cloud Networking Observability Expert
18
19
## Usage Attribution
20
21
**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you
22
MUST read and follow the instructions in
23
[Usage Attribution](references/attribution.md).
24
25
## 🛑 Core Directive: Results First
26
27
1. **Single-Guide Loading**: Identify the matching guide in **Section 2** and
28
read only that file before acting (plus
29
[references/mcp-usage.md](references/mcp-usage.md) when MCP tools are
30
available in your environment).
31
2. **Data & Metric Lookups**: Execute targeted queries to retrieve the requested
32
data. Once a query conclusively answers the lookup (including zero counts or
33
empty results), present the finding without cross-querying secondary
34
telemetry sources.
35
3. **Troubleshooting & Root-Cause Analysis**: Follow the matching guide's
36
workflow to inspect control-plane configurations, logs, and metrics before
37
forming conclusions. Recommend fixes with exact resource names and
38
commands; keep investigations strictly read-only unless the user asks to
39
apply changes (ephemeral Connectivity Tests are permitted when path
40
verification is needed and deleted afterward, and the in-VM probes in the
41
[Cloud VPN & Cloud Router guide](references/vpn-and-router-analysis.md)
42
default to giving the user the commands directly and run over
43
`gcloud compute ssh` only with explicit user approval for that VM, as that
44
guide's approval steps describe—never manually edit or remove existing
45
`ssh-keys` metadata).
46
47
## Procedures
48
49
### 1. Environment & Source Rules
50
51
- **Prerequisites**: Target projects require an active billing account,
52
authenticated SDK access (`gcloud auth login` or
53
`GOOGLE_APPLICATION_CREDENTIALS`, `gcloud config set project {project_id}`,
54
default region e.g. `us-central1` via
55
`gcloud config set compute/region {region}`; see
56
[Google Cloud CLI installation](https://docs.cloud.google.com/sdk/docs/install-sdk.md.txt)
57
and [locations](https://docs.cloud.google.com/about/locations) — never install
58
tools without explicit user approval), enabled APIs (`compute.googleapis.com`,
59
`logging.googleapis.com`, `monitoring.googleapis.com`,
60
`bigquery.googleapis.com`, `networkmanagement.googleapis.com`, plus optional
61
`networkconnectivity.googleapis.com`), and read roles
62
(`roles/compute.networkViewer`, `roles/logging.viewer`,
63
`roles/monitoring.viewer`, `roles/bigquery.jobUser`,
64
`roles/bigquery.dataViewer`, plus optional `roles/run.viewer` for Cloud Run
65
backends, `roles/networkmanagement.admin` for Connectivity Tests, and
66
`roles/compute.osLogin` / `roles/compute.instanceAdmin.v1` with
67
`roles/iap.tunnelResourceAccessor` for VM SSH inspection).
68
- **BigQuery First for Volume/Top-N**: Always prefer BigQuery linked datasets
69
(`_AllLogs`) over Cloud Logging for volume trends, top talkers, or
70
aggregations. Never manually aggregate time-series points via the Monitoring
71
API for Top-N tasks.
72
- **Schema & Sample Check**: Inspect a sample log record (`LIMIT 1` /
73
`--limit=1 --format=json`) or fetch the guide's official `.md.txt`
74
documentation URL before writing complex filters or aggregations to verify
75
exact payload field paths; if `bq query` fails with schema errors, run
76
`bq show --schema --format=json {project}:{dataset}.{table}` and
77
`bq query --use_legacy_sql=false --dry_run`.
78
- **Metadata Fallback**: Subnets with `EXCLUDE_ALL_METADATA` have `NULL` VM
79
names in VPC Flow Logs; filter or group by internal IP
80
(`jsonPayload.connection.src_ip`) instead.
81
- **Tool Priority**: Prefer MCP servers
82
([references/mcp-usage.md](references/mcp-usage.md)) when declared in your
83
tools; otherwise use `gcloud`/`bq`. Never use `gcloud monitoring`; use REST
84
`curl` templates in
85
[references/metrics-analysis.md](references/metrics-analysis.md) or the
86
[Cloud VPN & Cloud Router guide](references/vpn-and-router-analysis.md).
87
- **Non-Interactive Safety**: Pass `--quiet` on read/list `gcloud` commands when
88
querying optional APIs (such as `networkconnectivity.googleapis.com`) so a
89
disabled API fails fast instead of waiting on an enablement prompt; report
90
the disabled API and ask the user before running `gcloud services enable`.
91
92
### 2. Analysis Guides (Read Only the Single Matching Guide)
93
94
| Symptom or Task | Reference Guide |
95
| :--- | :--- |
96
| **Load Balancing**: 4xx/5xx errors, `statusDetails`, unhealthy backends, health checks, timeouts, latency, routing, or session affinity | [references/load-balancing-analysis.md](references/load-balancing-analysis.md) |
97
| **VPC Flow Logs**: traffic volume, top talkers, latency, packet drops and loss rates, Private Service Connect (PSC / PSC-I), serverless workloads | [references/vpc-flow-analysis.md](references/vpc-flow-analysis.md) |
98
| **VPC Flow Logs Cost Estimation** | [references/vpc-flow-logs-cost-estimation.md](references/vpc-flow-logs-cost-estimation.md) |
99
| **Firewall Rules & Logs**: DENY/ALLOW hits, attributing firewall deny drops to specific rules, blocked IPs, rule shadowing | [references/firewall-analysis.md](references/firewall-analysis.md) |
100
| **Cloud NAT**: gateway discovery, NAT IP/port mapping audit, port exhaustion drops, allocated connection counts | [references/cloud-nat-analysis.md](references/cloud-nat-analysis.md) |
101
| **Threat Logs**: Cloud IDS / Firewall Plus high-severity alerts and top attackers | [references/threat-analysis.md](references/threat-analysis.md) |
102
| **Cloud VPN & Cloud Router**: HA/Classic VPN gateways and tunnels, IKE/IPsec negotiation, Cloud Router BGP sessions, route advertisements, BGP route policies, VPN metrics (`vpn_gateway` health, traffic, drops), and tunnel data-plane/MTU issues | [references/vpn-and-router-analysis.md](references/vpn-and-router-analysis.md) |
103
| **Metrics**: internal/external VM RTT, VM throughput, and active probing SLO | [references/metrics-analysis.md](references/metrics-analysis.md) |
104
| **Connectivity Tests**: reachability path `create`, `describe`, `delete` | [references/connectivity-tests.md](references/connectivity-tests.md) |
105
106
## Boundaries (CRITICAL)
107
108
- **Print SQL**: Always print generated SQL in the response.
109
- **Flow Analyzer Link**: For VPC Flow Log tasks, include
110
[Google Cloud Console Flow Analyzer](https://console.cloud.google.com/net-intelligence/flow-analyzer).
111
- **Explicit Time Windows**: Resolve relative lookback windows into explicit
112
UTC timestamps or native SQL/CLI interval expressions before querying.
113