このようなログ メッセージは、ソースリージョンから 1 つ以上の宛先リージョンにクロスリージョン トラフィックを送信したことを、クライアントが Cloud Service Mesh に報告したときに生成されます。
指標を表示する
Cloud Service Mesh は、3 つの指標(xDS API の接続ストリーム数、リクエスト数、ゾーンごとのリクエスト数)を Cloud Monitoring にエクスポートします。xDS API の接続ストリーム数は、コントロール プレーンに接続されているクライアントの数を示します。リクエスト数は、バックエンド サービスに送信されたリクエストの数を、ソース リージョン、宛先リージョン、リクエスト ステータス別にグループ化して示します。ゾーンごとのリクエスト数は、バックエンド サービスに送信されたリクエストの数を表します。これは、送信元ゾーン、宛先ゾーン、リクエスト ステータスでグループ化されています。これらの指標を表示するには、Metrics Explorer を使用します。
ユーザー指定のメッセージが追加したログに出力された場合は通知するようにアラートを構成できます。こうしたアラートにより、予期しないことが発生したときにオペレータへ通知できます。たとえば、Cloud Service Mesh の構成の変更によって API リソースの競合が発生すると、そのエラー メッセージに関するアラートを受け取ることができます。ログベースの指標に関するアラートを設定するには、グラフとアラートを構成するをご覧ください。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[],[],null,["# Control plane logging and monitoring\n====================================\n\n| **Note:** This guide only supports Cloud Service Mesh with Google Cloud APIs and does not support Istio APIs. For more information see, [Cloud Service Mesh overview](/service-mesh/v1.24/docs/overview).\n\nThis document demonstrates how to use [Cloud Logging](/logging/docs) and\n[Cloud Monitoring](/monitoring/docs) to view logs and metrics for the\nCloud Service Mesh control plane.\n\nUsing a service mesh gives you the ability to observe traffic to and from\nservices, which allows for richer monitoring and debugging without code changes\nin the service itself. Log entries can provide important information for\ntroubleshooting your service mesh, including records of successful connections\nand disconnections, error reports for misconfigured clients, and alerts\nabout API resource conflicts.\n\nUse cases\n---------\n\nThe following are three use cases for control plane logging and monitoring:\n\n- **Cloud Logging for Cloud Service Mesh control plane**: You can securely store, search, analyze, and set alerts on all of your Cloud Service Mesh logging data and events using all the built-in features of Logging. Cloud Service Mesh exports logs to Logging when an Envoy or gRPC client connects or disconnects, as well as when it detects configuration issues.\n- **Cloud Monitoring for Cloud Service Mesh control plane**: Cloud Service Mesh exports a key metric indicating the number of clients connected to the Cloud Service Mesh control plane to Monitoring. You can set up a dashboard in Monitoring and visualize this metric in real time to monitor the health of the mesh as clients connect and disconnect. This also lets you set up an SLO for your mesh.\n- **Troubleshoot issues immediately**: Cloud Service Mesh exports telemetry to Logging and Monitoring by default. No additional setup is necessary to configure logging and monitoring, enabling you to troubleshoot issues at any time, including when you are setting up the mesh for the first time.\n\nView logs\n---------\n\nTo view Cloud Service Mesh logs, use the\n[Logs Explorer](/logging/docs/view/logs-explorer-interface). The following\nsection presents an example query to view Cloud Service Mesh logs, but you can\nuse the previous link to create your own query.\n\n1. In the Google Cloud console, go to the **Logs Explorer** page.\n\n [Go to the Logs Explorer](https://console.cloud.google.com/logs/query)\n2. In the **Resource** list,\n - If you use the service routing APIs, select `Gateway Scope` or `Mesh`.\n - If you use the older APIs, select `GCE Network`.\n3. In the **Log name** list, select `trafficdirector.googleapis.com/events`.\n4. Click **Run query**.\n\n### Cloud Service Mesh log entry fields\n\n### Example log entries\n\nView metrics\n------------\n\nCloud Service Mesh exports three metrics to Cloud Monitoring:\n**xDS API Connected Streams** , **Request count** , and **Request count by zone** .\n**xDS API Connected Streams** indicates the number of clients that are\nconnected to your control plane; **Request count** indicates the number of\nrequests sent to a backend service, grouped by source region, destination\nregion, and request status. **Request count by zone** indicates the number\nof requests sent to a backend service, grouped by source zone, destination\nzone, and request status. To view these metrics, use the\n[Metrics Explorer](/monitoring/charts/metrics-explorer).\n\nTo view Cloud Service Mesh metrics, do the following:\n\n1. In the Google Cloud console, go to the **Metrics Explorer** page.\n\n [Go to the Metrics Explorer](https://console.cloud.google.com/monitoring/metrics-explorer)\n2. In the **Resource type** list, select a resource.\n - If you use the service routing APIs, select `Gateway Scope` or `Mesh`.\n - If you use the older APIs, select `Network`.\n3. In the **Metric** list, select `connected_clients`.\n4. Return to the **Resource type** list, and then select `Compute Engine Backend\n Service`.\n5. In the **Metric** list, select either `Request count` or `Request count by zone`.\n\nAlternatively, you can use a query to view the cross-region request count:\n\n1. Select **MQL**.\n2. In the field, enter the following example query: \n\n ```\n fetch gce_backend_service\n | metric 'trafficdirector.googleapis.com/xds/server/request_count'\n | filter ( ne(metric.source_region, metric.destination_region))\n | align rate(1m)\n | every 1m\n | group_by [metric.source_region, metric.destination_region, resource.backend_service_id],\n [value_request_count_aggregate: aggregate(value.request_count)]\n ```\n3. Click **Run query**.\n\nSet up logs-based metrics and alerts\n------------------------------------\n\nThe following steps require that you set up logs-based metrics. For more\ninformation about setting up logs-based metrics, see the\n[overview](/logging/docs/logs-based-metrics#viewing).\n\nYou can configure alerts to notify you when user-specified messages appear in\nyour included logs. These alerts can notify the operator when something\nunexpected occurs. For example, if a change in Cloud Service Mesh configuration\nresults in API resource conflicts, you can receive an alert on the error\nmessage. To set up alerts on your log-based metrics, see\n[Configure charts and alerts](/logging/docs/logs-based-metrics/charts-and-alerts#alert-on-lbm)."]]