Per i cluster su Google Cloud, Knative serving è integrato automaticamente con
Cloud Monitoring senza configurazione aggiuntiva. Ciò significa che le metriche
per i tuoi servizi Knative serving vengono acquisite automaticamente quando sono
in esecuzione.
Puoi visualizzare le metriche in Cloud Monitoring o nella pagina Knative Serving della console. Cloud Monitoring offre più opzioni di grafici e filtri.
Tipi di risorse
Il nome della risorsa di monitoraggio per Knative serving è
Revisione di Knative serving (knative_revision) .
Visualizzazione delle metriche in Knative serving
Per visualizzare le metriche in Knative serving:
Vai a Knative Serving nella console Google Cloud :
Se utilizzi la barra di ricerca per trovare questa pagina, seleziona il risultato con il sottotitolo
Monitoring.
Nella barra degli strumenti della console Google Cloud , seleziona il tuo Google Cloud progetto.
Per le configurazioni di App Hub, seleziona il
progetto host di App Hub o il progetto di gestione della cartella app.
Nell'elemento Metrica, espandi il menu Seleziona una metrica,
digita Knative serving Revision
nella barra dei filtri e poi utilizza i sottomenu per selezionare un tipo di risorsa e una metrica specifici:
Nel menu Risorse attive, seleziona Revisione di Knative Serving.
Per selezionare una metrica, utilizza i menu Categorie di metriche attive e Metriche attive.
Per una descrizione completa delle metriche disponibili,
consulta:
Per rimuovere le serie temporali dalla visualizzazione, utilizza l'elemento Filtro.
Per combinare le serie temporali, utilizza i menu dell'elemento Aggregazione.
Ad esempio, per visualizzare l'utilizzo della CPU per le VM, in base alla zona, imposta
il primo menu su Media e il secondo menu su zona.
Tutte le serie temporali vengono visualizzate quando il primo menu dell'elemento Aggregazione è impostato
su Nessuna aggregazione. Le impostazioni predefinite per l'elemento Aggregazione
sono determinate dal tipo di metrica che hai selezionato.
Per la quota e altre metriche che riportano un campione al giorno, procedi nel seguente modo:
Nel riquadro Visualizzazione,
imposta Tipo di widget su Grafico a barre in pila.
Imposta il periodo di tempo su almeno una settimana.
Aggiunta di controlli di uptime
Puoi utilizzare Cloud Monitoring per monitorare le prestazioni dei tuoi servizi. Per ulteriori informazioni, consulta
Verificare la disponibilità del servizio(controlli di uptime).
Aggiungere avvisi
Puoi utilizzare Cloud Monitoring per inviare notifiche relative a determinati eventi, ad esempio errori di controllo di uptime. Per saperne di più, consulta Creare e gestire criteri di avviso per il tuo servizio.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-01 UTC."],[],[],null,["# Monitoring health and performance\n\n| **Beta**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nKnative serving uses [Cloud Monitoring](/monitoring/docs), which provides\nperformance monitoring, [metrics](/monitoring/api/metrics_gcp_p_z#gcp-run),\n[uptime checks](/monitoring/uptime-checks), and threshold based\n[alerts](/monitoring/alerts). You can also set up and use\n[Cloud Monitoring custom metrics](/monitoring/custom-metrics).\n[Google Cloud Observability pricing](/stackdriver/pricing) applies.\n\nFor clusters on Google Cloud, Knative serving is automatically integrated with\nCloud Monitoring without additional configuration. This means that the metrics\nfor your Knative serving services are captured automatically when they are\nrunning.\n\nFor other clusters, you must first enable metrics by\n[configuring your `CloudRun` custom resource](/kubernetes-engine/enterprise/knative-serving/docs/install/outside-gcp#configure_your_cloudrun_custom_resource).\n\nYou can view metrics either in Cloud Monitoring or in the Knative serving\npage in the console. Cloud Monitoring provides more charting and filtering\noptions.\n\nResource types\n--------------\n\nThe monitoring resource name for Knative serving is\n*Knative serving Revision* (`knative_revision`) .\n\nViewing metrics in Knative serving\n----------------------------------\n\nTo view metrics in Knative serving:\n\n1. Go to Knative serving in the Google Cloud console:\n\n [Go to Knative serving](https://console.cloud.google.com/kubernetes/run)\n2. Locate the service in the services list, and click on it.\n\n3. Click the *Metrics* tab to show the metrics for that revision.\n\nViewing metrics in Cloud Monitoring\n-----------------------------------\n\nTo view the metrics for a monitored resource by using the\nMetrics Explorer, do the following:\n\n1. In the Google Cloud console, go to the\n *leaderboard* **Metrics explorer** page:\n\n [Go to **Metrics explorer**](https://console.cloud.google.com/monitoring/metrics-explorer)\n\n \u003cbr /\u003e\n\n If you use the search bar to find this page, then select the result whose subheading is\n **Monitoring**.\n2. In the toolbar of the Google Cloud console, select your Google Cloud project. For [App Hub](/app-hub/docs/overview) configurations, select the App Hub host project or the app-enabled folder's management project.\n3. 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:\n 1. In the **Active resources** menu, select **Knative serving Revision**.\n 2. To select a metric, use the **Active metric categories** and **Active metrics** menus. For a full description of the available metrics, see:\n - [Monitoring Knative metrics](/monitoring/api/metrics_knative)\n - [Monitoring Kubernetes metrics](/monitoring/api/metrics_kubernetes) pages.\n 3. Click **Apply**.\n4. To remove time series from the display, use the\n [**Filter** element](/monitoring/charts/metrics-selector#filter-option).\n\n5. To combine time series, use the menus on the\n [**Aggregation** element](/monitoring/charts/metrics-selector#select_display).\n For example, to display the CPU utilization for your VMs, based on their zone, set the\n first menu to **Mean** and the second menu to **zone**.\n\n All time series are displayed when the first menu of the **Aggregation** element is set\n to **Unaggregated** . The default settings for the **Aggregation** element\n are determined by the metric type you selected.\n6. For quota and other metrics that report one sample per day, do the following:\n 1. In the **Display** pane, set the **Widget type** to **Stacked bar chart**.\n 2. Set the time period to at least one week.\n\n| **Note:** Some of the metrics listed show a sample interval of only once every 60 seconds. This means that if the underlying value of the metric changes more than once in 60 seconds, only one of the underlying values will be reported to Monitoring.\n\nAdding Uptime checks\n--------------------\n\nYou can use Cloud Monitoring to keep track of your services'\nperformance. For more information, see\n[Verify availability of your service](/monitoring/uptime-checks)(uptime checks).\n\nAdding Alerts\n-------------\n\nYou can use Cloud Monitoring to send notification about certain\nevents, such as uptime check failures. For more information, see\n[Create and manage alerting policies](/monitoring/alerts) for your service."]]