View logs and metrics
Cloud Router sends logging information to Cloud Logging and sends monitoring metrics to Cloud Monitoring. This page shows you how to access both types of information.
Logs
Cloud Router sends logging information to Cloud Logging , which logs the following events:
- Router events related to your Cloud Router
- BGP events related to a BGP configuration and session
- Route events related to route announcements between the two BGP peers
View logs
Console
-
In the Google Cloud console, go to the Cloud Routerspage.
-
Select a Cloud Router from the list of Cloud Routers.
-
In the Logscolumn, click View.
Cloud Router logs have the following format:
[Event Type]: [Log Text]
-
To build queries in the Logs Explorer, see Build queries in the Logs Explorer .
Info log
The following table lists events that are logged in the Logging Info log.
LIST_OF_PEERS
PEER
came up x
seconds ago PEER
went down with the
reason MESSAGE
, where MESSAGE
provides an explanation such as HOLD_TIMER_EXPIRED
or LINK_DOWN
.
For more information about LINK_DOWN
, see LINK_DOWN
message appears in Cloud Router logs
. BGP_ROUTER_ID
PREFIX
PREFIX
PREFIX
Nexthops LIST_OF_NEXTHOPS
received
by Cloud Router PREFIX
Nexthops LIST_OF_NEXTHOPS
deleted
from Cloud RouterCommon Logging events
To view common Logging events for Cloud Router as listed in the following table, use the steps for viewing logs . Specify one of the advanced filters listed in the table. Adjust the time frame for the Logging search as needed.
Event description | Logging advanced filter |
---|---|
Migrating or restarting a Cloud Router process | resource.type="gce_router" "task activated" |
Adding learned routes | resource.type="gce_router" "received by cloud router" |
Removing learned routes | resource.type="gce_router" "deleted from cloud router" |
Exporting advertised routes | resource.type="gce_router" ("Route Event" AND "Advertising prefix") |
BGP peering came up | resource.type="gce_router" ("BGP peering" AND "came up") |
BGP peering came up with MD5 authentication | resource.type="gce_router" ("BGP peering" AND "came up" AND "MD5 authentication enabled") |
BGP peering went down | resource.type="gce_router" ("BGP peering" AND "went down") |
BGP peering went down because the link went down on the Google peering edge router | resource.type="gce_router" ("BGP peering" AND "went down" AND "LINK_DOWN") |
A BGP session was shut down due to excessive received routes | resource.type="gce_router" ("NOTIFICATION 6/1") severity="CRITICAL" |
A Cloud Router dynamic route prefix quota has been exceeded | resource.type="gce_network_region" ("No more routes" AND "can be programmed") severity="ERROR" |
A route was dropped because of a quota issue | resource.type="gce_network_region" severity="ERROR" jsonPayload.affectedResource.routes.nextHopIpAddresses=" PEER_IP_ADDRESS
" |
A BFD session waiting for peer | resource.type="gce_router" ("BFD Event" AND "bfd enabled, state [Init, NoDiagnostic]") |
A BFD session came up | resource.type="gce_router" ("BFD Event" AND "to [Up, NoDiagnostic]") |
A BFD session went down (Rx Timer expired) | resource.type="gce_router" ("BFD Event" AND "to [Down, ControlDetectionTimeExpired]") |
A BFD session went down (Peer's state is Down
or AdminDown
) |
resource.type="gce_router" ("BFD Event" AND "to [Down, NeighborSessionDown]") |
A BFD session is disabled locally | resource.type="gce_router" ("BFD Event" AND "bfd disabled") |
Metrics
Cloud Router publishes metrics to Cloud Monitoring . For a list of metrics published for Cloud Router, see Monitor metrics for Cloud Router .
All Cloud Router metrics cover both IPv4 and IPv6 traffic.
View metrics by using the API
You can access these metrics by using the Cloud Monitoring API. For more information, see Read metric data .
View metrics by using Monitoring dashboards
You can also create a custom dashboard in Cloud Monitoring to help you analyze these metrics. For more information, see Manage custom dashboards .
To create a custom dashboard, follow these steps.
Console
-
In the Google Cloud console, go to the Monitoringpage.
-
Select Dashboards, and then on the Dashboards Overviewpage, click Create dashboard.
-
Optional: Update the dashboard title with a descriptive name for your dashboard.
-
In the Chart library, select the chart that you want to add. For example, to add a Linechart to the dashboard, click or drag that entry from the Chart libraryto the graph area.
-
In Chart Title, change the chart title or use the suggested title.
-
In What data do you want to view?, do the following:
- In Resource type, click the Type to filterfield, and enter
Cloud Router
. - In Metric, add a Cloud Router metric.
- In Resource type, click the Type to filterfield, and enter
-
Use the Filtercontrols to restrict the view to only certain routers or sessions.
-
To add another metric, click Add another metric.
Some metrics are for the Cloud Router and some metrics are for a BGP
session on a given Cloud Router. Cloud Router metrics are
shown as router-name
, while BGP session metrics are shown as router-name(bgp-name)
.
Monitoring metrics for Cloud Router
The "metric type" strings in this table must be prefixed
with router.googleapis.com/
. That prefix has been
omitted from the entries in the table.
When querying a label, use the metric.labels.
prefix; for
example, metric.labels. LABEL
=" VALUE
"
.
Display name
Monitored resources
Labels
best_received_routes_count
GA
(project)
Received routes count
bfd/control/receive_intervals
BETA
(project)
BFD control packets receive intervals
peer_ip
:
The peer IP of the BFD session.bfd/control/received_packets_count
BETA
(project)
Control packets received
peer_ip
:
The peer IP of the BFD session.bfd/control/rejected_packets_count
BETA
(project)
Control packets rejected
peer_ip
:
The peer IP of the BFD session.bfd/control/transmit_intervals
BETA
(project)
BFD control packets transmit intervals
peer_ip
:
The peer IP of the BFD session.bfd/control/transmitted_packets_count
BETA
(project)
Control packets transmitted
peer_ip
:
The peer IP of the BFD session.bfd/session_flap_events_count
BETA
(project)
BFD session flap
peer_ip
:
The peer IP of the BFD session.event_type
:
The reason for the BFD flap such as "AdminDown" or "ControlDetectionTimeExpired".bfd/session_up
BETA
(project)
BFD session status
peer_ip
:
The peer IP of the BFD session.bgp/received_routes_count
GA
(project)
BGP received routes count
bgp_peer_name
:
The name of the bgp session.bgp/sent_routes_count
GA
(project)
BGP sent routes count
bgp_peer_name
:
The name of the bgp session.bgp/session_up
GA
(project)
BGP session status
bgp_peer_name
:
The name of the bgp session.bgp_sessions_down_count
GA
(project)
BGP sessions down count
bgp_sessions_up_count
GA
(project)
BGP sessions up count
dynamic_routes/learned_routes/any_dropped_unique_destinations
BETA
(project)
Any unique destinations dropped
routing_mode
:
Routing mode of the route, one of ["global" - learned from remote regions; "regional" - learned from local regions].dynamic_routes/learned_routes/dropped_unique_destinations
BETA
(project)
Unique destinations dropped
routing_mode
:
Routing mode of the route, one of ["global" - learned from remote regions; "regional" - learned from local regions].dynamic_routes/learned_routes/unique_destinations_limit
BETA
(project)
Unique destinations limit
routing_mode
:
Routing mode of the route, one of ["global" - learned from remote regions; "regional" - learned from local regions].dynamic_routes/learned_routes/used_unique_destinations
BETA
(project)
Unique destinations used
routing_mode
:
Routing mode of the route, one of ["global" - learned from remote regions; "regional" - learned from local regions].nat/allocated_ports
GA
(project)
Allocated ports
nat_ip
:
NAT IP of the ports.nat/closed_connections_count
GA
(project)
Closed connections count
ip_protocol
:
The protocol of the connection. Can be TCP, UDP or ICMP.nat/dropped_received_packets_count
GA
(project)
Received packets dropped count
ip_protocol
:
The protocol of the connection. Can be TCP, UDP or ICMP.nat/dropped_sent_packets_count
GA
(project)
Sent packets dropped count
ip_protocol
:
The protocol of the connection. Can be TCP, UDP or ICMP.reason
:
The reason for the packet drop. Possible values are OUT_OF_RESOURCES, ENDPOINT_INDEPENDENCE_CONFLICT.nat/nat_allocation_failed
GA
(project)
NAT allocation failed
nat/new_connections_count
GA
(project)
New connections count
ip_protocol
:
The protocol of the connection. Can be TCP, UDP or ICMP.nat/open_connections
GA
(project)
Open connections
ip_protocol
:
The protocol of the connection. Can be TCP, UDP or ICMP.nat/port_usage
GA
(project)
Port usage
ip_protocol
:
The protocol of the connection. Can be TCP, UDP or ICMP.nat/received_bytes_count
GA
(project)
Received bytes count
ip_protocol
:
The protocol of the connection. Can be TCP, UDP or ICMP.nat/received_packets_count
GA
(project)
Received packets count
ip_protocol
:
The protocol of the connection. Can be TCP, UDP or ICMP.nat/sent_bytes_count
GA
(project)
Sent bytes count
ip_protocol
:
The protocol of the connection. Can be TCP, UDP or ICMP.nat/sent_packets_count
GA
(project)
Sent packets count
ip_protocol
:
The protocol of the connection. Can be TCP, UDP or ICMP.router_up
GA
(project)
Router tasks up
sent_routes_count
GA
(project)
Sent routes count
Table generated at 2025-08-28 21:10:54 UTC.
What's next
- To troubleshoot issues when using Cloud Router, see Troubleshooting .