Why do we need microservice inspection?

This article is the seventh article in the "Microservice Governance Practice" series. It introduces microservice governance + testing: based on service contract information, reducing the cost of microservice testing on the cloud. This series of articles is based on the microservice practice of Alibaba Cloud's commercial product MSE. If your team has strong microservice governance + testing capabilities, we hope that our practice and thinking behind microservice governance + testing can help you Provide some reference.

The first article: "Decryption of Microservice Governance"

Chapter 2: "Microservice Governance Practice: Service Query"

Chapter 3: "Microservice Governance Practice: Canary Release"

Chapter 4: "Microservice Governance Practice: Service Contract"

Chapter 5: "Microservice Governance Practice: Microservice Testing"

Chapter 6: "Microservice Governance Practice: The Return of Automation"

Preface


With the promotion and popularization of cloud-native technologies, more and more companies have begun to realize microservices. At the same time, the solution to ensure the reliability of online microservice interfaces is not perfect. When the online microservice interface is abnormal, it cannot To achieve real-time perception, business risks are greater. Therefore, in order to ensure the stable operation of online services, in addition to monitoring the resources of key services, it is also necessary to monitor the microservice interfaces used between services. The emergence of the microservice inspection platform just solves the above problems, allowing you to proactively detect service availability at low cost and quickly, creating inspection scenarios in 1 minute, and detecting service availability in seconds.

Before detailing the microservice inspection, let me tell you a scenario.


The above figure is a typical enterprise microservice application architecture diagram. In order to consider security, cloud applications are usually deployed in virtual local area networks on the cloud, and the services are exposed to the outside through the gateway. In this typical enterprise microservice application architecture diagram, the Product Service application provides the function of querying product lists and product details through ID, and the Business Service application provides the function of adding products to car purchases. For the students responsible for the Product Service application, if you want to verify the user's operation regularly from the business scenario of querying the product list → querying product details by ID → adding the product to the shopping cart, what should we do now?

  1. Enter the machine (ECS) or container (Pod) where the Product Service application is deployed, call the product list through the curl command, and verify whether the returned product list is not empty and contains the content of the specified product

  2. Splice the ID in the return value of the query product list into the input parameters of the curl command, call to query product details by ID, and verify whether the fields in the details meet expectations

  3. Enter the machine (ECS) or container (Pod) where the Business Service application is deployed, splicing the ID into the curl command, call to add the product to the shopping cart, and verify whether the addition is successful

  4. Repeat the above action at a specified time interval

It is not only necessary to complete multi-step human flesh verification, but also to ensure multi-time repeated operations. So far we can summarize a few problems of microservice inspection on the cloud:

  • Complex network topology on the cloud

  • Difficult to verify business link scenarios

  • Repetitive and tedious operation verification is inefficient

Obviously, I only want to simply detect service availability, but the cost is so high. Therefore, we need microservice inspections to help us solve these problems and reduce the cost of detection.

Why do we need microservice inspection



Easy to use and safe

Out of the box, there is no need to pay attention to the network topology under the private network VPC; it is safe and reliable, and has a test experience under the office network.

Imagine that for the sake of security isolation, the R&D environment, test environment, pre-release environment, and production environment are deployed in different private network VPCs. If users build their own inspection tools, they need to solve the problem of network interoperability between the inspection tools and different environments. Enterprise IT personnel clearly only want a simple inspection tool, but after going to the cloud, it is far from over to solve the complex network topology on the cloud. In order to be able to use the inspection tool on the office network, it is necessary to ensure that The inspection tool can be accessed by the office network, and at this time it is facing the test of network security. We hope that there is a safe and reliable solution that can be used out of the box, so that enterprise IT personnel who go to the cloud can have an inspection tool to test the experience on the office network.

low cost

Pulling up the press flexibly and destroying it when used up can greatly reduce the machine resources and labor costs required to construct inspection tools.

Imagine that enterprises go to the cloud to reduce costs. Application hosting has greatly reduced resource costs and operation and maintenance costs, but inspection costs have not been reduced. The self-built test and inspection tools of enterprise IT personnel need to prepare presses. This part of the machines is occupied for a long time and is idle, and the resource cost is high. In addition to resource costs, enterprise IT personnel also need to develop inspection tools. The labor and time costs are very high. Basically every enterprise needs to develop inspection tools. We hope to have a low-cost solution that not only improves the resource utilization rate of the enterprise, but also reduces the cost of enterprise IT personnel to develop and maintain inspection tools.

Microservice ecology

A large number of microservice products have been provided on the cloud, which solves the problem of hosting, managing, and diagnosing microservice applications, as well as microservice testing to complement the microservice capabilities.

Imagine how to test a microservice interface. You need to understand the input and output parameters of the interface. If you are a research and development student-service provider, you may be familiar with the interface. If you are a testing student or even other research and development students, you may need documentation. Even word of mouth, microservice governance has visualized the service contract information of the application, combined with the service contract information, just according to the inspection needs, select Application -> Framework -> Service -> Method, configure the inspection parameters, and then the inspection can be carried out. It reduces the cost of service contract synchronization.

MSE Microservice Inspection Practice


Prerequisite: Microservice application has been connected to MSE

Let's experience how to use the ability of microservice inspection on MSE.

Task creation

  • Log in to the MSE console of the microservice engine. In the navigation bar at the top of the page, select the region, such as North China 2 (Shanghai).

  • In the left navigation bar, click Microservice Governance Center .

  • In the drop-down options on the Microservice Governance Center page, click Microservice Test .

  • In the drop-down options on the microservice test page, click Service Inspection .

  • On the service inspection page, click Create Task .

  • Select the corresponding task information and inspection content to complete the creation of the inspection task.

Note : It is forbidden to create a patrol task with the same name.


Task run

For the task that has just been created in the default suspended state, it needs to be started actively.

  1. Log in to the MSE console of the microservice engine. In the navigation bar at the top of the page, select the region, such as North China 2 (Shanghai).

  2. In the left navigation bar, click Microservice Governance Center .

  3. In the drop-down options on the Microservice Governance Center page, click Microservice Test .

  4. In the drop-down options on the microservice test page, click Service Inspection .

  5. Enter the name of the inspection task to find the specified task, and click Start .

Update configuration

If you want to change the patrol configuration parameters of the task, the steps are as follows:

  1. Log in to the MSE console of the microservice engine. In the navigation bar at the top of the page, select the region, such as North China 2 (Shanghai).

  2. In the left navigation bar, click Microservice Governance Center .

  3. In the drop-down options on the Microservice Governance Center page, click Microservice Test .

  4. In the drop-down options on the microservice test page, click Service Inspection .

  5. Enter the name of the inspection task to find the specified task, and click Details.

  6. Update the inspection configuration parameters in the pop-up page, and click OK .

Note: The update configuration only supports the configuration update of the inspection parameters. If the inspection interface needs to be changed, it cannot be achieved by updating the configuration. You can only recreate the inspection task and consider deleting the inspection task.

Service Unavailable

  • Log in to the MSE console of the microservice engine. In the navigation bar at the top of the page, select the region, such as North China 2 (Shanghai).

  • In the left navigation bar, click Microservice Governance Center .

  • In the drop-down options on the Microservice Governance Center page, click Microservice Test .

  • In the drop-down options on the microservice test page, click Service Inspection .

  • Enter the name of the inspection task to find the specified task, and click Pause .

View failure details

  • Log in to the MSE console of the microservice engine. In the navigation bar at the top of the page, select the region, such as North China 2 (Shanghai).

  • In the left navigation bar, click Microservice Governance Center .

  • In the drop-down options on the Microservice Governance Center page, click Microservice Test .

  • In the drop-down options on the microservice test page, click Service Inspection .

  • Enter the name of the inspection task to find the specified task, and click the failure details .



More than just microservice inspections


This article introduces the ability of microservice inspection under microservice governance. Under microservice governance, it also provides the capabilities of service testing, automated regression, and service stress testing, helping your application to easily complete test verification at a lower cost. Welcome to experience . In addition to MSE (Micro Service Engine), the micro service inspection capability is also integrated by EDAS (Enterprise Distributed Application) and will be integrated by SAE cloud products.

Microservice testing exchange group

If you have any questions during the microservice inspection process of the microservice engine MSE, you are welcome to use Dingding to scan the QR code below or search for the Dingding group number 31180380 to join the Dingding group for feedback.

Let the robot respond faster! Alibaba Cloud ARMS helps Shenhui intelligent system to reduce response time by 50%

It took so long to configure the center, but I don’t know what long polling is?

In the game operation industry, how does functional computing solve the pain points of data collection and analysis?

Click one to see, let more people see

Guess you like

Origin blog.csdn.net/weixin_39860915/article/details/113696256