{"id":15692,"date":"2023-08-21T10:26:03","date_gmt":"2023-08-21T03:26:03","guid":{"rendered":"https:\/\/gcloudvn.com\/?p=15692"},"modified":"2023-08-21T10:36:08","modified_gmt":"2023-08-21T03:36:08","slug":"huong-dan-su-dung-cloud-monitoring-cho-compute-engine","status":"publish","type":"post","link":"https:\/\/gcloudvn.com\/en\/kienthuc\/huong-dan-su-dung-cloud-monitoring-cho-compute-engine\/","title":{"rendered":"Instructions for using Cloud Monitoring for Compute engine"},"content":{"rendered":"<p style=\"text-align: justify;\"><i><span style=\"font-weight: 400;\">Along with Cloud Logging and Trace managed services, <\/span><\/i><b><i>Cloud monitoring<\/i><\/b><i><span style=\"font-weight: 400;\"> (formerly stackdriver monitoring) is a complete set of tools integrated in Google Cloud&#039;s operations suite to help technology engineers better manage and control system applications running on Google Cloud Compute engine.\u00a0<\/span><\/i><\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/huong-dan-su-dung-cloud-monitoring-cho-compute-engine\/#Cloud_monitoring_stackdriver_monitoring_la_gi\" >What is cloud monitoring (stackdriver monitoring)?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/huong-dan-su-dung-cloud-monitoring-cho-compute-engine\/#Huong_dan_su_dung_Monitoring_stackdriver_monitoring_cho_Compute_Engine\" >Instructions for using Monitoring (stackdriver monitoring) for Compute Engine<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/huong-dan-su-dung-cloud-monitoring-cho-compute-engine\/#Buoc_1_Tao_mot_instance_Compute_Engine_VM\" >Step 1: Create a Compute Engine VM instance\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/huong-dan-su-dung-cloud-monitoring-cho-compute-engine\/#Buoc_2_Cai_dat_mot_Apache_Web_Server\" >Step 2: Install an Apache Web Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/huong-dan-su-dung-cloud-monitoring-cho-compute-engine\/#Buoc_3_Cai_dat_va_cau_hinh_Op_Agent_cho_Apache_Web_Server\" >Step 3: Install and configure Op Agent for Apache Web Server<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/huong-dan-su-dung-cloud-monitoring-cho-compute-engine\/#Buoc_4_Tao_luu_luong_truy_cap_va_xem_so_lieu_tren_bang_dieu_khien_Apache\" >Step 4: Generate traffic and view metrics on the Apache dashboard:\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/huong-dan-su-dung-cloud-monitoring-cho-compute-engine\/#Buoc_5_Tao_chinh_sach_canh_bao\" >Step 5: Create an alert policy<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/gcloudvn.com\/en\/kienthuc\/huong-dan-su-dung-cloud-monitoring-cho-compute-engine\/#Buoc_6_Clean_up\" >Step 6: Clean up<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Cloud_monitoring_stackdriver_monitoring_la_gi\"><\/span><b>What is cloud monitoring (stackdriver monitoring)?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><b>Cloud Monitoring<\/b><span style=\"font-weight: 400;\"> Google Cloud&#039;s operations suite provides visibility into the performance, uptime, and overall health of applications running in the Cloud. At the same time, it also supports collecting data, events and metadata from services <a href=\"https:\/\/gcloudvn.com\/en\/google-cloud-platform\/\">Google Cloud GCP<\/a>, probe storage uptime, application instrumentation, and common application components.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Cloud Monitoring visualizes collected data through charts and dashboards, and generates alerts to instantly notify you when metrics fall outside expected ranges.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Through Cloud monitoring, management engineers will find answers to the following questions:\u00a0<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">What is the usage load on your service?<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Is your website responsive?<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Is your service working well?<\/span><\/li>\n<\/ul>\n<h2 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Huong_dan_su_dung_Monitoring_stackdriver_monitoring_cho_Compute_Engine\"><\/span><b>Instructions for using Monitoring (stackdriver monitoring) for Compute Engine<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">To better understand the Monitoring feature, let&#039;s look at how <\/span><span style=\"font-weight: 400;\">monitor the Apache Web Server installed on a Compute Engine virtual machine (VM) instance<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">We will follow these steps:\u00a0<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Create a Compute Engine VM instance.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Install an Apache Web Server.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Install and configure Ops Agent for Apache Web Server.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Generate traffic and view metrics on a predefined Apache dashboard.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Create an alert policy<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Clean up.<\/span><\/li>\n<\/ul>\n<h3 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Buoc_1_Tao_mot_instance_Compute_Engine_VM\"><\/span><b><i>Step 1: Create a Compute Engine VM instance\u00a0<\/i><\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">In the Google Cloud console, go to Compute and select <a href=\"https:\/\/gcloudvn.com\/en\/compute-engine\/\">Google Compute Engine<\/a>:<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Go to Compute Engine section<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To create a VM instance, click Create instance.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Fill in the instance fields as follows:<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">In Field Name, enter quickstart-vm.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Field Machine type, select Small.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Make sure that the Boost disk section is configured for Debian GNU\/Linux.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">Field Firewall, select both options Allow HTTP traffic and Allow HTTPS traffic.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"2\"><span style=\"font-weight: 400;\">The remaining fields are set to default values.<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click Create. When your VM is ready, it will appear in the list of Instances in the Instance Tab<\/span><\/li>\n<\/ul>\n<h3 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Buoc_2_Cai_dat_mot_Apache_Web_Server\"><\/span><b><i>Step 2: Install an Apache Web Server<\/i><\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">To deploy an Apache Web Server on a Compute Engine VM instance, you need to do the following:\u00a0<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To open the terminal for your Instance, in column <\/span><b>Connect<\/b><span style=\"font-weight: 400;\">, choose <\/span><b>SSH<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To update the list of packages on your Instance, run the following command: sudo apt-get update<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To install Apache2 HTTP Server, run the following command: sudo apt-get install apache2 php7.0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Open your browser and connect to the Apache2 HTTP server using the URL http:\/\/EXTERNAL_IP, where EXTERNAL_IP is your virtual machine&#039;s External IP address. You can find this address in the External IP column of the VM instance<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Apache2&#039;s default page is as follows:\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15701\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_1.jpg\" alt=\"Instructions for using Cloud Monitoring for Compute engine 1\" width=\"600\" height=\"214\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_1.jpg 602w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_1-18x6.jpg 18w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><br \/>\n<b><i><\/i><\/b><\/p>\n<h3 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Buoc_3_Cai_dat_va_cau_hinh_Op_Agent_cho_Apache_Web_Server\"><\/span><b><i>Step 3: Install and configure Op Agent for Apache Web Server<\/i><\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">To collect logs and metrics from the Apache Web Server, install Ops Agent using the terminal:<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To open a terminal for the VM instance, in column <\/span><b>Connect<\/b><span style=\"font-weight: 400;\">, click <\/span><b>SSH<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To install Ops Agent, run the following command:<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15699\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_3.jpg\" alt=\"Instructions for using Cloud Monitoring for Compute engine 2\" width=\"600\" height=\"68\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_3.jpg 602w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_3-18x2.jpg 18w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><br \/>\n<span style=\"font-weight: 400;\">You will see\u00a0 <\/span><span style=\"font-weight: 400;\">google-cloud-ops-agent installation succeeded.<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Copy the following command line, and paste it into the terminal:<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15700\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_2.jpg\" alt=\"Instructions for using Cloud Monitoring for Compute engine 3\" width=\"600\" height=\"577\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_2.jpg 602w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_2-12x12.jpg 12w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/>This command will create configuration to collect and import logs and metrics from the Apache Web Server. For more information about importing logs from Apache Web Server, see Configure Opt Agents for Apache Web Server.<\/span><\/p>\n<h3 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Buoc_4_Tao_luu_luong_truy_cap_va_xem_so_lieu_tren_bang_dieu_khien_Apache\"><\/span><b><i>Step 4: Generate traffic and view metrics on the Apache dashboard:\u00a0<\/i><\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Monitoring dashboards allow you to view and analyze metrics related to your services. In this initialization section, you create metrics on the Apache Web Server and view the data on the automatically generated Apache GCE Overview dashboard.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>To create metrics on your Apache Web Server, do the following:<\/b><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the Google Cloud Console, go to Compute Engine<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the Connect column, select SSH to open a terminal for the VM instance.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To generate traffic on the Apache Web Server, run the following command:<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15696\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_6.jpg\" alt=\"Instructions for using Cloud Monitoring for Compute engine 4\" width=\"600\" height=\"53\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_6.jpg 601w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_6-18x2.jpg 18w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/>The previous command generates traffic by sending requests to the Apache Web Server every 4 seconds.<\/span><\/p>\n<p style=\"text-align: justify;\"><b>To view the Apache GCE Overview console, do the following:<\/b><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the Google Cloud Console, select <\/span><b>Monitoring\u00a0<\/b><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the link bar, select Dashboard.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In all Dashboards, select\u00a0 <\/span><b>Apache GCE Overview dashboard<\/b><span style=\"font-weight: 400;\">. Dashboard opens.<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">In the Dashboard, there are several charts containing Apache and Compute Engine integration information:\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15697 size-full\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_5.jpg\" alt=\"H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng Cloud Monitoring cho Compute engine 5\" width=\"600\" height=\"185\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_5.jpg 600w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_5-18x6.jpg 18w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><br \/>\n<b><\/b><\/p>\n<h3 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Buoc_5_Tao_chinh_sach_canh_bao\"><\/span><em><b>Step 5: Create an alert policy<\/b><\/em><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">To create an alert policy to monitor data and send email notifications when the traffic rate on your Apache Web Server exceeds 4 KiB\/s, do the following:<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the Google Cloud console, select Monitoring\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the navigation bar, select <\/span><b>notifications Alerting<\/b><span style=\"font-weight: 400;\"> and click <\/span><b>Create policy<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select the time series to be monitored: Select the time series to be monitored:\u00a0<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click <\/span><b>Select a metric<\/b><span style=\"font-weight: 400;\"> and enter VM instance in the filter bar<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the list <\/span><b>Active metrics<\/b><span style=\"font-weight: 400;\">, select Apache.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the list <\/span><b>Active metrics, <\/b><span style=\"font-weight: 400;\">select workload\/apache.traffic.<\/span><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">A graph of Apache Traffic data will be displayed<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In section <\/span><b>Transform data section<\/b><span style=\"font-weight: 400;\">, choose the following values:<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Rolling window: 1 min<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Rolling window function: rate<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the section <\/span><b>Configure alert trigger<\/b><span style=\"font-weight: 400;\">, select the following values and click Next:<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Alert trigger: Any time series violations<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Threshold position: Above threshold<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Threshold value: 4000<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the Configure notifications and finalize alert section, select the following values:<\/span>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Notification channels: The email you want to receive alerts to.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Incident autoclose duration: 30 min<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Name the alert policy: Apache traffic above threshold<\/span><\/li>\n<\/ul>\n<\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Click Create policy. Your alert policy will now be enabled.<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><b>Test the alerting policy<\/b><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">To test the alerting policy you just created, do the following:<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the Google Cloud console, go to Compute and select Compute Engine:<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the Connect column, click SSH to open a terminal to your VM instance<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the terminal, enter the following command line:<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15696\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_6.jpg\" alt=\"H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng Cloud Monitoring cho Compute engine 6\" width=\"600\" height=\"53\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_6.jpg 601w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_6-18x2.jpg 18w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/>This command will generate traffic in your Apache Web Server.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">Once the traffic threshold value exceeds 4 KiB\/s in your Apache Web Server, a notification will be sent via email. It may take a few minutes to complete this process.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">The email notification you receive resembles the following:<\/span><\/p>\n<p style=\"text-align: justify;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15695\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_7.jpg\" alt=\"H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng Cloud Monitoring cho Compute engine 7\" width=\"600\" height=\"940\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_7.jpg 516w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_7-8x12.jpg 8w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<h3 style=\"text-align: justify;\"><span class=\"ez-toc-section\" id=\"Buoc_6_Clean_up\"><\/span><b><i>Step 6: Clean up<\/i><\/b><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">To avoid incurring charges to your Google Cloud account for resources used on this page, follow these steps.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">If you created a new Google Cloud project, delete the Google Cloud project:<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In <\/span><b>Google Cloud console<\/b><span style=\"font-weight: 400;\">, go to page <\/span><b>Manage resources<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the project list, select the project you want to delete and click <\/span><b>Delete<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">In the dialog, type project ID, and click <\/span><b>Shut down<\/b><span style=\"font-weight: 400;\"> to delete the project<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">If you create a new VM in an existing project, then delete the <\/span><b>VM instances<\/b><span style=\"font-weight: 400;\">: If you created a new VM in an existing project, then delete this VM instance:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">In the Google Cloud console, go to the VM instances page.<\/span><\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Select the checkbox for the instance you want to delete<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">To delete the instance, click <\/span><b>More actions<\/b><span style=\"font-weight: 400;\">, click <\/span><b>Delete<\/b><span style=\"font-weight: 400;\">, and follow these instructions.<\/span><\/li>\n<\/ul>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">If you are already using an existing VM Instance for quick startup, uninstall Ops Agents:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">To uninstall Ops Agent, open terminal and run the following command:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-15694\" src=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_8.jpg\" alt=\"H\u01b0\u1edbng d\u1eabn s\u1eed d\u1ee5ng Cloud Monitoring cho Compute engine 8\" width=\"600\" height=\"56\" srcset=\"https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_8.jpg 598w, https:\/\/gcloudvn.com\/wp-content\/uploads\/2023\/08\/huong_dan_su_dung_google_cloud_operations_suite_monitoring_8-18x2.jpg 18w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/>Above are detailed instructions on how to use your system data monitoring management settings with the feature <\/span><b>Cloud Monitoring<\/b><span style=\"font-weight: 400;\"> (Stackdriver Monitoring) for compute engine, hope this information will be useful to you.\u00a0<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-weight: 400;\">If you need advice on Google Cloud technical solutions, please contact Gimasys \u2013 Google Cloud Premier Partner with the following information:\u00a0<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400; text-align: justify;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Email: <\/span><b>gcp@gimasys.com<\/b><\/li>\n<li style=\"font-weight: 400; text-align: justify;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Hotline: <\/span><b>0974 417 099<\/b><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>C\u00f9ng v\u1edbi Cloud Logging v\u00e0 Trace managed service, Cloud monitoring (tr\u01b0\u1edbc kia l\u00e0 stackdriver monitoring) l\u00e0 tr\u1ecdn b\u1ed9 c\u00f4ng c\u1ee5 t\u00edch h\u1ee3p trong Google Cloud\u2019s operation suite gi\u00fap c\u00e1c k\u1ef9 s\u01b0 c\u00f4ng ngh\u1ec7 qu\u1ea3n tr\u1ecb v\u00e0 ki\u1ec3m so\u00e1t t\u1ed1t h\u01a1n&hellip;<\/p>","protected":false},"author":2,"featured_media":15693,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[1,135],"tags":[],"class_list":["post-15692","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kienthuc","category-google-cloud-platform","entry","has-media"],"_links":{"self":[{"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/posts\/15692","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/comments?post=15692"}],"version-history":[{"count":0,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/posts\/15692\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/media\/15693"}],"wp:attachment":[{"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/media?parent=15692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/categories?post=15692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gcloudvn.com\/en\/wp-json\/wp\/v2\/tags?post=15692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}