Viewing logs and metrics

This page describes logs and metrics for Network Connectivity Center and metrics for Router appliance.

Logging for Router appliance is handled by Cloud Router; for more information, see Viewing Cloud Router logs and metrics.

How metrics work

The local_resource_type label reports the number of data transfer bytes on the Google Cloud side of the resource monitored. That is, the label reports when the resource attached to a spoke sends traffic to another Google Cloud resource.

The local_resource_type label can take one of the following values:

  • A Compute Engine virtual machine (VM) value called GCE_VM
  • An HA VPN gateway value called VPN
  • A VLAN attachment value for an Interconnect connection called ICA
  • A value for traffic to all other resources called OTHER
  • A value for the router appliance instance called ROUTER_APPLIANCE

If the local_resource_type is VPN, ICA, or ROUTER_APPLIANCE, the metric reports data transfer information. For more information about data transfer, see Network Connectivity Center overview.

Logs

Network Connectivity Center hubs send logs to Logging. Because hybrid spokes always use Cloud Routers, review the Cloud Router logs and metrics documentation.

How to view logs

To view logs for Network Connectivity Center, follow these steps.

Console

  1. In the Google Cloud console, go to the Logs Explorer page.

    Go to Logs Explorer

  2. To see all Network Connectivity Center logs, on the first pull-down menu, select the metric for the spoke resource attached to the spoke. For example, HA VPN.

    To see logs for just one hub, on the menu, select a single hub name.

    Log fields of type boolean typically only appear if they have a value of true. If a boolean field has a value of false, that field is omitted from the log.

    UTF-8 encoding is enforced for log fields. Characters that are not UTF-8 characters are replaced with question marks.

Routing logs

You can configure the sinks of logs-based metrics for Network Connectivity Center resource logs.

Logging stores Network Connectivity Center logs for only 30 days. If you want to keep your logs for a longer period, you must route them.

You can route Network Connectivity Center logs to Pub/Sub or BigQuery for analysis.

What is logged

Network Connectivity Center log entries contain the following types of information that is useful for monitoring and debugging your hubs:

  • General information shown in most Google Cloud logs, such as severity, project ID, project number, and timestamp.
  • Other information that varies depending on the log entry.

Monitoring metrics

To view metrics and create alerts related to your Network Connectivity Center spokes, use Cloud Monitoring.

In addition to the predefined dashboards in Monitoring, you can create custom dashboards, set up alerts, and query the metrics through the Monitoring API.

Monitoring metrics for Network Connectivity Center

The following metrics for the connectivity_hub resource type are reported into Monitoring.

All of the metrics in the following table measure user payload. They measure the bytes that were sent by the user, rather than the encapsulated traffic, which includes transport and network protocol headers. Also, depending on the type of transport, traffic might be compressed as part of transport.

Metric name Metric name in the Monitoring API Description
Interconnect Egress bytes networking.googleapis.com/interconnect_attachment/egress_bytes_count Indicates the number of bytes sent (user payload) from Google Cloud through the VLAN attachment to locations outside of Google Cloud—for example, to on-premises hosts or to other cloud providers. Sampled every 60 seconds. After sampling, data is not visible for up to five minutes.
Interconnect Ingress bytes networking.googleapis.com/interconnect_attachment/ingress_bytes_count Indicates the number of bytes sent (user payload) to Google Cloud, through the VLAN attachment from locations outside of Google Cloud—for example, from on-premises hosts or from other cloud providers. Sampled every 60 seconds. After sampling, data is not visible for up to 150 seconds.
VPN tunnel Egress bytes networking.googleapis.com/vpn_tunnel/egress_bytes_count Indicates the number of bytes sent (user payload) from Google Cloud through the HA VPN tunnel to the other side of the tunnel. Sampled every 60 seconds. After sampling, data is not visible for up to 150 seconds.
VPN tunnel Ingress bytes networking.googleapis.com/vpn_tunnel/ingress_bytes_count Indicates the number of bytes sent (user payload) to Google Cloud through the HA VPN tunnel from the other side of the tunnel. Sampled every 60 seconds. After sampling, data is not visible for up to 150 seconds.
Router appliance Egress bytes networking.googleapis.com/router_appliance/gateway/egress_bytes_count Indicates the number of bytes sent (user payload) through and from the router appliance instance to locations outside of Google Cloud. For example, to on-premises hosts or to other cloud providers. Sampled every 60 seconds. After sampling, data is not visible for up to 150 seconds.
Router appliance Ingress bytes networking.googleapis.com/router_appliance/gateway/ingress_bytes_count Indicates the number of bytes sent (user payload) to the router appliance instance from locations outside of Google Cloud. For example, from on-premises hosts or from other cloud providers. Sampled every 60 seconds. After sampling, data is not visible for up to 150 seconds.

View metrics in Metrics Explorer

To view Monitoring metrics in Metrics Explorer, follow these steps.

Console

To view the metrics for a monitored resource by using the Metrics Explorer, do the following:

  1. In the Google Cloud console, go to the  Metrics explorer page:

    Go to Metrics explorer

    If you use the search bar to find this page, then select the result whose subheading is Monitoring.

  2. In the Metric element, expand the Select a metric menu, enter networking in the filter bar, and then use the submenus to select a specific resource type and metric:
    1. In the Active resources menu, select a resource.
    2. To select a metric, use the Active metric categories and Active metrics menus. For a list of metrics, see Network Connectivity Center metrics list.
    3. Click Apply.
  3. To remove time series from the display, use the Filter element.

  4. To combine time series, use the menus on the Aggregation element. For example, to display the CPU utilization for your VMs, based on their zone, set the first menu to Mean and the second menu to zone.

    All time series are displayed when the first menu of the Aggregation element is set to Unaggregated. The default settings for the Aggregation element are determined by the metric type you selected.

  5. For quota and other metrics that report one sample per day, do the following:
    1. In the Display pane, set the Widget type to Stacked bar chart.
    2. Set the time period to at least one week.

Define custom dashboards

To create custom Monitoring dashboards over Network Connectivity Center metrics, follow these steps:

Console

  1. In the Google Cloud console, go to the Monitoring page.

    Go to Monitoring

  2. Select Dashboards, and then select Create Dashboard.

  3. Click Add Chart.

  4. Give the chart a title.

  5. Select metrics and filters. For metrics, the resource type is Connectivity Hub.

  6. Click Save.

What's next