Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
Creation of Public Uptime Checks
3.
Create Private Uptime Checks
3.1.
Creation of the Private Network
3.2.
Create a private uptime check
4.
Manage uptime checks
4.1.
List, view, and delete all uptime checks
5.
List uptime-check server IP addresses
5.1.
List IP addresses
6.
Creation of alerts for uptime checks 
7.
Chart uptime-check metrics
8.
Validate response data
8.1.
Search for a literal substring
9.
Frequently Asked Questions
9.1.
What benefits do APIs provide in the world of cloud computing?
9.2.
What distinguishes elasticity from scalability?
9.3.
What is serverless computing?
10.
Conclusion 
Last Updated: Mar 27, 2024

Overview of uptime checks

Author Shivani Singh
0 upvote
Master Python: Predicting weather forecasts
Speaker
Ashwin Goyal
Product Manager @

Introduction

Use uptime checks to assess whether resources are accessible and operating as expected from the viewpoint of a user or external system. A request is sent to a resource to see if it replies as part of an uptime check.

Following are the elements of an uptime check:

  • The configuration you specify for uptime-check. Continuous requests from Google Cloud regions are scheduled to the target in your uptime-check setup using this configuration.
  • The following are managed by the Google Cloud's request-execution system:
  • The carrying out of programmed inspections
  • Verification of findings
  • Uptime-check metrics are written with the results.


Two different uptime checks exist:

  • Requests are sent from various locations around the globe to publicly accessible URLs or Google Cloud resources as part of public uptime testing.
  • Requests are sent to internal IP addresses of Google Cloud resources using private uptime checks.


The resources being examined are both public and private.

Creation of Public Uptime Checks

A public uptime check can send queries from different points on the globe to publicly accessible URLs or Google Cloud resources to check on their responsiveness.

The following monitoring resources can be available by performing public uptime checks:

URL for the time being VM instance App Engine program, Service for Kubernetes, an instance of Amazon Elastic Compute Cloud (EC2), Elastic load balancer from Amazon.

Step 1. In the console, click the button marked "Monitoring" or choose it.

Step 2. Choose Uptime checks from the navigation pane.

Step 3. Press Create Uptime check.

Step 4. After giving the Uptime check a suitable title, click Next.

Step 5. Identify the uptime check's target.

Step 6. Establish the necessary reaction conditions.

Step 7. Establish a protocol for alerts. An issue is formed and a notification is delivered to all notification channels associated with the alerting policy when it checks your uptime check.

Step 8. Click Test to confirm your uptime check setup.

Step 10. Press Create. When you save an uptime check and a necessary field is empty, an error message is shown. After you save your changes, the window for the newly established uptime check appears.

Get the tech career you deserve, faster!
Connect with our expert counsellors to understand how to hack your way to success
User rating 4.7/5
1:1 doubt support
95% placement record
Akash Pal
Senior Software Engineer
326% Hike After Job Bootcamp
Himanshu Gusain
Programmer Analyst
32 LPA After Job Bootcamp
After Job
Bootcamp

Create Private Uptime Checks

Private uptime checks enforce Identity and Access Management (IAM) limitations and VPC Service Controls perimeters while enabling HTTP requests into a customer's Virtual Private Cloud (VPC) network. Private uptime checks can make queries to resources like virtual machines (VMs) or internal load balancers at level 4 across a private network (ILB). A distinct Cloud project may also house the private network and its resources, such as load balancers or virtual machines. The scoping project for the uptime check's metrics does not have to include this project. The resources it encompasses do not fall under the scope of the metric even if the Service Directory service, which gathers uptime measurements, must. 

Creation of the Private Network

Step 1. Establish a secure network:

gcloud compute networks create PRIVATE_CHECK_NETWORK


Step 2. Establish a firewall rule that allows TCP ingress for private network access.

gcloud compute firewall-rules create PRIVATE_CHECK_NETWORK_HOPE_RULE \
--network="PRIVATE_CHECK_NETWORK"  \
--action=allow   --direction=ingress   --source-ranges="35.199.192.0/19" \
--rules=tcp   --project="$PROJECT_ID"


Step 3. Establish a firewall rule that permits Apache access by opening a port:

gcloud compute firewall-rules create PRIVATE_CHECK_NETWORK_APACHE_RULE \
--network PRIVATE_CHECK_NETWORK --allow tcp:80

Create a private uptime check

Private uptime check can be created in the following way: 

  1. See the console page to establish a private uptime check using the Google Cloud console.
     
  2. See the API: Scoping project tab to learn how to construct a private uptime check using the Monitoring API for a Service Directory service in the scoping project of the uptime check. The environment variables you select in the Convenience settings are used in this configuration.
     
  3. Visit the API: Monitored project tab to create a private uptime check for a Service Directory service in a project that is under the metrics scope of the uptime check.


Use the Google Cloud console to create an uptime check by performing the following:

Step 1. Select Monitoring on the console.

Step 2. Choose Uptime checks from the navigation pane.

Step 3. Press Create Uptime check.

Step 4. Type a succinct title for the uptime check, then click the Next button.

Step 5. Identify the uptime check's target: Configure the required responses:

Step 7. Establish a protocol for alerts. An issue is formed and a notification is delivered to all notification channels associated with the alerting policy when it checks your uptime check.

Step 8. Click Test to confirm your uptime check setup.

Step 10. Press Create.

Manage uptime checks

In this blog post, we'll go over how to manage your uptime checks using the client libraries, the Cloud Monitoring API, and the Google Cloud UI.

List, view, and delete all uptime checks

To list all uptime checks, do the following:

Step 1. Select Monitoring on the console.

Step 2. Choose Uptime checks from the navigation pane.

Step 3. (Optional) Add filters to limit the list of uptime checks.
 

To view details of an uptime check, do the following:

Step 1. Select Monitoring on the console.

Step 2. Choose Uptime checks from the navigation pane.

Step 3. Find and click the name of the uptime check you wish to view.
 

To delete an uptime check, do the following:

Step 1. Select Monitoring on the console.

Step 2. Choose Uptime checks from the navigation pane.

Step 3. Find the uptime check you want to update, then choose from one of the options.

Step 4. Select Delete by clicking More more_vert.

View the details of the uptime check, then click Delete.

List uptime-check server IP addresses

In this blog section, we'll go over how to find a list of the IP addresses that uptime-check servers employ as well as how to spot traffic coming from them in your logs.

List IP addresses

Follow these steps to obtain these IP addresses:

Step 1. In the console, click the button marked "Monitoring" or choose it.

Step 2. Choose Uptime checks from the navigation pane.

Step 3. Select Download from the Uptime checks menu. The IP addresses are downloaded in the uptime-source-ips.txt file.

Any IP address may do an uptime check, but only one address from each location is used for each time interval.

Creation of alerts for uptime checks 

We'll demonstrate how to develop an alerting policy in this part that alerts you when an uptime check fails.

Step 1. Click Monitoring in the console. 

Step 2. Click Uptime checks in the navigation pane.

Step 3. Select Add alert policy by clicking more vert More after finding the uptime check you wish to monitor.

Step 4. To see the Configure alert trigger window, click Next.

Step 5. Type the condition's name in the box provided, then click Next.

Step 6. To go to the Configure notifications and complete the alert pane, click Next.

Step 7. Choose one or more channels for receiving notifications, and then click OK.

Step 8. (Optional) Add any details you want to appear in a notification message by clicking Documentation and then clicking Add.

Step 9. Give the policy a name. In your Google Cloud project's list of alerting policies, the name you enter is displayed.

Step 10. Press Next to proceed.

Step 11. Click save. 

Chart uptime-check metrics

Chart the latency metric of an uptime check to comprehend the responsiveness of the service being monitored. Chart the status statistic of an uptime check to see which areas are successfully responding to an uptime check.

Step 1. Open the Metrics Explorer page under Monitoring in the Google Cloud dashboard.

Step 2. Choose the Explorer tab from the toolbar.

Step 3. Choose the tab for configuration.

Step 4. To pick a particular resource type and metric, expand the Select a metric menu, type Check passed in the filter bar, and then use the submenus:

Step 5. Optional: Add filters and use the Group By, Aggregator, and chart-type choices to customize how the data is shown.

Step 6. Optional: Modify the settings for the graph.

Uptime-check latency charts can be created using the Monitoring uptime check/request latency metric as a foundation. You can make several charts depending on the aggregator fields you select.

Validate response data

This section explains how to set up an uptime check to verify the response information provided by a resource being tested. The response data isn't validated by default. For the uptime check to be successful, you can, however, define a value that the response data must or must not contain.

Make the following adjustments to implement an uptime check that verifies the response data:

Step 1. Select Monitoring on the console.

Step 2. Choose Uptime checks from the navigation pane.

Step 3. Press Create uptime check.

Step 4. Type a Title and click the Next button.

Step 5. Add the Target and then select Next.

Step 6. Make sure Content matching is enabled in the Response validation section, then fill out the columns for response validation.

Step 7. Finish setting up the uptime check by clicking Next.

Search for a literal substring

Use the following parameters to set up the uptime check to succeed when the response data contains a literal substring:

Step 1. From the Response content match type option, choose Contains.

Step 2. Fill out the Response content area with the literal substring.

Step  3. Click Test to confirm the configuration.
 

Use the following parameters to set up the uptime check to fail when the response data contains a literal substring:

Step 1. From the Response content match type option, choose Does not contain.

Step 2. Fill out the Response content area with the literal substring.

Step 3. Click Test to confirm the configuration.

Frequently Asked Questions

What benefits do APIs provide in the world of cloud computing?

The API has the following key advantages over the cloud domain:

The complete software need not be written by you. From one app to the next, communication is simple. Making apps and integrating them with cloud services is simple. It firmly connects two various applications.

What distinguishes elasticity from scalability?

Cloud computing's ability to scale allows it to increase resource capacity in response to increasing workloads. When traffic increases and more resources are required, the architecture uses scalability to meet the demand. Elasticity, on the other hand, is a feature that makes it possible to dynamically commission and decommission vast amounts of resources. It is dependent on the extent of resource availability and the duration of utilization.

What is serverless computing?

The cloud service provider will have a server in the cloud that operates and controls the resource allocation dynamically in serverless computing. In order for the user to work without being concerned about their gear, the supplier supplies the infrastructure required. Users are required to pay for the resources they consume.

Conclusion 

To conclude this blog, we discussed the creation of public and private uptime checks, and how to manage all the uptime checks. We also discussed listing uptime check server IP addresses, creating alerts for uptime checks, charting uptime check metrics, and lastly, we discussed validating response data.

For more content, Refer to our guided paths on Coding Ninjas Studio to upskill yourself.

Do upvote our blogs if you find them helpful and engaging!

Happy Learning!

 

Previous article
Managing the Monitoring Agent
Next article
Introduction to alerting Part-1
Live masterclass