Monitor Packet Mirroring
Packet Mirroring exports monitoring data about mirrored traffic to Cloud Monitoring . You can use monitoring metrics to check whether traffic from a VM instance is being mirrored as intended. For example, you can view the mirrored packet or byte count for a particular instance.
You 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
for Compute Engine in the Monitoring
documentation.
The metrics for the collector destination provides an aggregate view of all mirrored traffic that it collects. However, for the individual mirrored instances, you can view the number of mirrored packets that were dropped. Metrics for the collector destination don't include dropped packets. For more information about monitoring the collector destination, see Internal TCP/UDP Load Balancing monitoring .
View packet mirroring metrics in the Compute Engine console
- Go to the VM instancespage.
- Select the project that contains the mirrored instance.
- Click the name of the mirrored instance to view its details.
- Click the Monitoringtab.
- View the Mirrored Network Bytesand Mirrored Network Packetscharts to see the mirrored bytes and mirrored packets. The Mirrored Network Packets chart shows the number of successful and dropped mirrored packets.
View the monitoring dashboard for a mirrored instance
- Go to Monitoringin the Google Cloud console.
Go to Monitoring - Select Resources > Instances.
- Click the name of a mirrored instance.
When you access the dashboard, Cloud Monitoring shows time series charts, such as the number of packets mirrored.
Define Monitoring alerts
You can define alerts over the packet mirroring metrics:
- Go to Monitoringin the Google Cloud console.
Go to Monitoring - Click Alerting.
- Click Create Policy.
- Click Add Conditionand select condition type.
-
In the Metrictab, select a target.
- For the resource type, VM Instance.
- Select a packet mirroring metric .
-
Click Save Condition.
-
Enter a policy name in the Name this policyfield and click Save Policy.
Define custom dashboards
In addition to the predefined dashboards in Cloud Monitoring, you can create custom dashboards, set up alert policies, and query the metrics through the Cloud Monitoring API .
On the Cloud Monitoring dashboard, Open Incidentsare driven by the alerting policies that you configure. Alerts appear as incidents on the dashboard when the alert is triggered. These are general functions of Cloud Monitoring.
You can create custom Cloud Monitoring dashboards over packet mirroring metrics:
- Go to Monitoringin the Google Cloud console.
Go to Monitoring - Click Dashboards.
- Click Create Dashboard.
- Select a chart type to create.
- Give the chart a title.
-
In the Metrictab, select a target.
- For the resource type, VM Instance.
- Select a packet mirroring metric .
-
Click Save.
Metric reporting frequency and retention
Metrics for the VPC security policies are exported to Cloud Monitoring in 1-minute granularity batches. Monitoring data is retained for six weeks. The dashboard provides data analysis in the following default intervals:
- 1H (one hour)
- 6H (six hours)
- 1D (one day)
- 1W (one week)
- 6W (six weeks)
Using the controls in the upper-right hand corner of the Cloud Monitoring page, you can manually request analysis in any interval from 6W to 1 minute.
What's next
For more information about Cloud Monitoring, see the Cloud Monitoring documentation .