Monitoring health and performance

Knative serving uses Cloud Monitoring, which provides performance monitoring, metrics, uptime checks, and threshold based alerts. You can also set up and use Cloud Monitoring custom metrics. Google Cloud Observability pricing applies.

For clusters on Google Cloud, Knative serving is automatically integrated with Cloud Monitoring without additional configuration. This means that the metrics for your Knative serving services are captured automatically when they are running.

For other clusters, you must first enable metrics by configuring your CloudRun custom resource.

You can view metrics either in Cloud Monitoring or in the Knative serving page in the console. Cloud Monitoring provides more charting and filtering options.

Resource types

The monitoring resource name for Knative serving is Knative serving Revision (knative_revision) .

Viewing metrics in Knative serving

To view metrics in Knative serving:

  1. Go to Knative serving in the Google Cloud console:

    Go to Knative serving

  2. Locate the service in the services list, and click on it.

  3. Click the Metrics tab to show the metrics for that revision.

Viewing metrics in Cloud Monitoring

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

  1. In the navigation panel of the Google Cloud console, select Monitoring, and then select  Metrics explorer:

    Go to Metrics explorer

  2. In the Metric element, expand the Select a metric menu, enter Knative serving Revision in the filter bar, and then use the submenus to select a specific resource type and metric:
    1. In the Active resources menu, select Knative serving Revision.
    2. To select a metric, use the Active metric categories and Active metrics menus. For a full description of the available metrics, see:
    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.

Adding Uptime checks

You can use Cloud Monitoring to keep track of your services' performance. For more information, see Verify availability of your service(uptime checks).

Adding Alerts

You can use Cloud Monitoring to send notification about certain events, such as uptime check failures. For more information, see Create and manage alerting policies for your service.