Viewing Cloud Router 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 certain events, such as route and BGP events, to Logging.

Cloud Logging 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

How to view logs

To view logs, follow these steps:

  1. In the Google Cloud Console, open the Cloud Routers page.

    Open the Cloud Routers page

  2. In the Logs column, click View.

    Cloud Router logs have the following format:

    [Event Type]: [Log Text]

  3. To do an advanced search, in the filter by label or text search box, click the disclosure triangle on the far right and choose Convert to Advanced Filter.

Info log

The following table lists events logged in the Logging Info log.

Event Description
Router event Router task activated
Router task de-activated
BGP event Successfully added configuration for peers: LIST_OF_PEERS
BGP peering with PEER came up X seconds ago
BGP peering with PEER went down
BGP Router ID set to: BGP_ROUTER_ID
Route event Advertising prefix to peers: PREFIX
Withdrawing prefix from peers: PREFIX
Prefix PREFIX Nexthops LIST_OF_NEXTHOPS received by Cloud Router
Prefix PREFIX Nexthops LIST_OF_NEXTHOPS deleted from Cloud Router

Error log

The following table lists events logged in the Logging Error log.

Event Description
Route event Dropping Route: PREFIX Maximum allowed routes MAX_ROUTES already in Datapath
If you get this error, reduce the number of prefixes announced from the peer router to the MAX_ROUTES value.

Common Logging events

To view common Logging events for Cloud Router as listed in the following table, use the instructions for viewing logs and 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"
("Route Event" AND "received by cloud router")
Removing learned routes resource.type="gce_router"
("Route Event" AND "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 went down resource.type="gce_router"
("BGP peering" AND "went down")
A Cloud Router limit has been exceeded resource.type="gce_router"
("No more routes" AND "can be programmed")
severity="ERROR"
A BGP session was terminated due to excessive received routes resource.type="gce_router"
("NOTIFICATION 6/1")
severity="CRITICAL"

Metrics

Cloud Router publishes metrics to Cloud Monitoring. For a list of metrics published for Cloud Router, see Monitoring metrics for Cloud Router.

Viewing metrics using the API

You can access these metrics by using the Cloud Monitoring API. For more information, see Reading metric data.

Viewing metrics by using Cloud Monitoring dashboards

You can also create a custom dashboard in Cloud Monitoring to help you analyze these metrics. For more information about how to create a custom dashboard, see Managing dashboards through the console.

To create a custom dashboard, do the following:

  1. In the Google Cloud Console, go to Monitoring.

    Go to Monitoring

  2. Select Dashboards > Create Dashboard.

  3. Replace Untitled Dashboard with an appropriate name.

  4. Click Add chart.

  5. In the Find resource type and metric field, add Cloud Router as a resource, and then add a Cloud Router metric.

  6. Change the chart Title or use the suggested title.

  7. Use the Filter controls to restrict the view to only certain routers or sessions.

  8. To add another metric, click Add metric.

  9. Click Save to add the chart to your dashboard.

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 by router-name while BGP sessions 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.

Metric type Launch stage
Display name
Kind, Type, Unit
Monitored resources
Description
Labels
best_received_routes_count GA
Received routes count
GAUGEINT641
gce_router
Current number of best routes received by router. Sampled every 60 seconds. After sampling, data is not visible for up to 180 seconds.
bfd/control/receive_intervals BETA
BFD control packets receive intervals
GAUGEINT64ms
gce_router
BFD control packets receive intervals. Sampled every 60 seconds. After sampling, data is not visible for up to 180 seconds.
peer_ip: The peer IP of the BFD session.
bfd/control/received_packets_count BETA
Control packets received
DELTAINT641
gce_router
Number of control packets received from this BFD session. Sampled every 60 seconds. After sampling, data is not visible for up to 180 seconds.
peer_ip: The peer IP of the BFD session.
bfd/control/rejected_packets_count BETA
Control packets rejected
DELTAINT641
gce_router
Number of control packets rejected, from this BFD session. Sampled every 60 seconds. After sampling, data is not visible for up to 180 seconds.
peer_ip: The peer IP of the BFD session.
bfd/control/transmit_intervals BETA
BFD control packets transmit intervals
GAUGEINT64ms
gce_router
BFD control packets transmit intervals. Sampled every 60 seconds. After sampling, data is not visible for up to 180 seconds.
peer_ip: The peer IP of the BFD session.
bfd/control/transmitted_packets_count BETA
Control packets transmitted
DELTAINT641
gce_router
Number of control packets transmitted from this BFD session. Sampled every 60 seconds. After sampling, data is not visible for up to 180 seconds.
peer_ip: The peer IP of the BFD session.
bfd/session_up BETA
BFD session status
GAUGEINT641
gce_router
Indicator for successful BFD session establishment. Sampled every 60 seconds. After sampling, data is not visible for up to 180 seconds.
peer_ip: The peer IP of the BFD session.
bgp/received_routes_count GA
BGP received routes count
GAUGEINT641
gce_router
Current number of routes received on a bgp session. Sampled every 60 seconds. After sampling, data is not visible for up to 180 seconds.
bgp_peer_name: The name of the bgp session.
bgp/sent_routes_count GA
BGP sent routes count
GAUGEINT641
gce_router
Current number of routes sent on a bgp session. Sampled every 60 seconds. After sampling, data is not visible for up to 180 seconds.
bgp_peer_name: The name of the bgp session.
bgp/session_up GA
BGP session status
GAUGEINT641
gce_router
Indicator for successful bgp session establishment. Sampled every 60 seconds. After sampling, data is not visible for up to 180 seconds.
bgp_peer_name: The name of the bgp session.
bgp_sessions_down_count GA
BGP sessions down count
GAUGEINT641
gce_router
Number of BGP sessions on the router that are down. Sampled every 60 seconds. After sampling, data is not visible for up to 180 seconds.
bgp_sessions_up_count GA
BGP sessions up count
GAUGEINT641
gce_router
Number of BGP sessions on the router that are up. Sampled every 60 seconds. After sampling, data is not visible for up to 180 seconds.
nat/allocated_ports GA
Allocated ports
GAUGEINT64{port}
nat_gateway
Number of ports allocated to all VMs by the NAT gateway. Sampled every 60 seconds. After sampling, data is not visible for up to 225 seconds.
nat_ip: NAT IP of the ports.
nat/closed_connections_count GA
Closed connections count
DELTAINT64{connection}
nat_gateway
Count of connections closed over the NAT gateway. Sampled every 60 seconds. After sampling, data is not visible for up to 225 seconds.
ip_protocol: The protocol of the connection. Can be TCP, UDP or ICMP.
nat/dropped_received_packets_count GA
Received packets dropped count
DELTAINT64{packet}
nat_gateway
Count of received packets dropped by the NAT gateway. Sampled every 60 seconds. After sampling, data is not visible for up to 225 seconds.
ip_protocol: The protocol of the connection. Can be TCP, UDP or ICMP.
nat/dropped_sent_packets_count GA
Sent packets dropped count
DELTAINT64{packet}
nat_gateway
Count of sent packets dropped by the NAT gateway. Sampled every 60 seconds. After sampling, data is not visible for up to 225 seconds.
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
NAT allocation failed
GAUGEBOOL
nat_gateway
Indicates if there is a failure in allocating NAT IPs to any VM in the NAT gateway. Sampled every 60 seconds. After sampling, data is not visible for up to 120 seconds.
nat/new_connections_count GA
New connections count
DELTAINT64{connection}
nat_gateway
Count of new connections created over the NAT gateway. Sampled every 60 seconds. After sampling, data is not visible for up to 225 seconds.
ip_protocol: The protocol of the connection. Can be TCP, UDP or ICMP.
nat/open_connections GA
Open connections
GAUGEINT64{connection}
nat_gateway
Number of connections currently open on the NAT gateway. Sampled every 60 seconds. After sampling, data is not visible for up to 225 seconds.
ip_protocol: The protocol of the connection. Can be TCP, UDP or ICMP.
nat/port_usage GA
Port usage
GAUGEINT64{port}
nat_gateway
Maximum number of connections from VM to a single internet endpoint (IP:port). Sampled every 60 seconds. After sampling, data is not visible for up to 225 seconds.
ip_protocol: The protocol of the connection. Can be TCP, UDP or ICMP.
nat/received_bytes_count GA
Received bytes count
DELTAINT64By
nat_gateway
Count of bytes received (Internet -> VMs) via the NAT gateway. Sampled every 60 seconds. After sampling, data is not visible for up to 225 seconds.
ip_protocol: The protocol of the connection. Can be TCP, UDP or ICMP.
nat/received_packets_count GA
Received packets count
DELTAINT64{packet}
nat_gateway
Count of packets received (Internet -> VMs) via the NAT gateway. Sampled every 60 seconds. After sampling, data is not visible for up to 225 seconds.
ip_protocol: The protocol of the connection. Can be TCP, UDP or ICMP.
nat/sent_bytes_count GA
Sent bytes count
DELTAINT64By
nat_gateway
Count of bytes sent (VMs -> Internet) over the NAT gateway. Sampled every 60 seconds. After sampling, data is not visible for up to 225 seconds.
ip_protocol: The protocol of the connection. Can be TCP, UDP or ICMP.
nat/sent_packets_count GA
Sent packets count
DELTAINT64{packet}
nat_gateway
Count of packets sent (VMs -> Internet) over the NAT gateway. Sampled every 60 seconds. After sampling, data is not visible for up to 225 seconds.
ip_protocol: The protocol of the connection. Can be TCP, UDP or ICMP.
router_up GA
Router status
GAUGEINT641
gce_router
Router status, up or down. Sampled every 60 seconds. After sampling, data is not visible for up to 180 seconds.
sent_routes_count GA
Sent routes count
GAUGEINT641
gce_router
Current number of routes sent by router. Sampled every 60 seconds. After sampling, data is not visible for up to 180 seconds.

Table generated at 2020-10-29 13:04:13 UTC.