[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-19。"],[],[],null,["# Monitor Packet Mirroring\n========================\n\nPacket Mirroring exports monitoring data about mirrored traffic to\n[Cloud Monitoring](/monitoring/docs). You can use monitoring metrics to\ncheck whether traffic from a virtual machine (VM) instance is being mirrored\nas intended. For example, you can view the mirrored packet or byte count for\na particular instance.\nYou can view the monitoring metrics of mirrored VM instances or instances that are part of the collector destination (internal passthrough Network Load Balancer). For mirrored VM instances, Packet Mirroring provides metrics specific to mirrored packets, such as `/mirroring/mirrored_packets_count`, `/mirroring/mirrored_bytes_count`, and `/mirroring/dropped_packets_count`. For more information, see the [metrics list](/monitoring/api/metrics_gcp_c#gcp-compute) for Compute Engine in the Monitoring documentation.\n\nThe metrics for the collector destination provides an aggregate view of all\nmirrored traffic that it collects. However, for the individual mirrored\ninstances, you can view the number of mirrored packets that were dropped.\nMetrics for the collector destination don't include dropped packets. For more\ninformation about monitoring the collector destination, see\n[Internal passthrough Network Load Balancer logging and monitoring](/load-balancing/docs/internal/internal-logging-monitoring).\n\n\nView packet mirroring metrics in the Compute Engine console\n-----------------------------------------------------------\n\n1. Go to the **VM instances** page.\n\n [Go to the VM instances page](https://console.cloud.google.com/compute/instances)\n2. Select the project that contains the mirrored instance.\n\n3. Click the name of the mirrored instance to view its details.\n\n4. Click the **Monitoring** tab.\n\n5. View the **Mirrored Network Bytes** and **Mirrored Network Packets** charts\n to see the mirrored bytes and mirrored packets. The Mirrored Network Packets\n chart shows the number of successful and dropped mirrored packets.\n\nView the monitoring dashboard for a mirrored instance\n-----------------------------------------------------\n\nTo view the automatically created monitoring dashboard for a mirrored instance,\ndo the following:\n\n1. In the Google Cloud console, go to the **Dashboards** page:\n\n [Go to **Dashboards**](https://console.cloud.google.com/monitoring/dashboards)\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 **All Dashboards** pane, select the **Mirrored Instances**\n from the list.\n\n3. Click list **List** and then select the\n name of a mirrored instance.\n\nWhen you access the dashboard, Cloud Monitoring shows time series charts,\nsuch as the number of packets mirrored.\n\nDefine Monitoring alerts\n------------------------\n\nYou can define\n[alerts](/monitoring/alerts)\nover the packet mirroring metrics:\n\n1. In the Google Cloud console, go to the **Monitoring** page.\n\n [Go to Monitoring](https://console.cloud.google.com/monitoring)\n2. Click **Alerting**.\n\n3. Click **Create Policy**.\n\n4. Click **Add Condition** and select condition type.\n\n5. In the **Metric** tab, select a target.\n\n 1. For the resource type, **VM Instance**.\n 2. Select a [packet mirroring metric](/monitoring/api/metrics_gcp_c#gcp-compute).\n6. Click **Save Condition**.\n\n7. Enter a policy name in the **Name this policy** field and click\n **Save Policy**.\n\nDefine custom dashboards\n------------------------\n\nIn addition to the predefined dashboards in Cloud Monitoring, you can\ncreate custom dashboards, set up alert policies, and query the metrics through\nthe [Cloud Monitoring API](/monitoring/api).\n\nOn the Cloud Monitoring dashboard, **Open Incidents** are\ndriven by the alerting policies that you configure. Alerts appear as *incidents*\non the dashboard when the alert is triggered. These are general functions of\nCloud Monitoring.\n\nYou can create custom Cloud Monitoring dashboards over packet mirroring\nmetrics:\n\n1. In the Google Cloud console, go to the **Monitoring** page.\n\n [Go to Monitoring](https://console.cloud.google.com/monitoring)\n2. Click **Dashboards**.\n\n3. Click **Create Dashboard**.\n\n4. Select a chart type to create.\n\n5. Give the chart a title.\n\n6. In the **Metric** tab, select a target.\n\n 1. For the resource type, **VM Instance**.\n 2. Select a [packet mirroring metric](/monitoring/api/metrics_gcp_c#gcp-compute).\n7. Click **Save**.\n\nMetric reporting frequency and retention\n----------------------------------------\n\nMetrics for the VPC security policies are exported to\nCloud Monitoring in 1-minute granularity batches. Monitoring data is\nretained for six weeks. The dashboard provides data analysis in the following\ndefault intervals:\n\n- 1H (one hour)\n- 6H (six hours)\n- 1D (one day)\n- 1W (one week)\n- 6W (six weeks)\n\nUsing the controls in the upper-right hand corner of the Cloud Monitoring\npage, you can manually request analysis in any interval from 6W to 1 minute.\nFor more information about Cloud Monitoring, see the\n[Cloud Monitoring documentation](/monitoring/docs).\n\nWhat's next\n-----------\n\nFor more information about Cloud Monitoring, see the\n[Cloud Monitoring documentation](/monitoring/docs)."]]