Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the best practices for SpringCloud applications on Kubernetes

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail what the best practices of SpringCloud application on Kubernetes are, and the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

Preface

When the application is released and launched, we are most worried about the business problems caused by the bug of the code. Although we can release in batches in grayscale mode to reduce the scope of impact, if we can quickly find problems from real-time monitoring and roll back during the release process, then the time for business to be affected can be shortened. Therefore, we can see that grayscale, monitoring and rollback are the indispensable three sharp weapons in the whole release process. With these three sharp weapons, we can release at any time, so as to speed up the iteration and online speed of the business. Monitoring, as an important part of infrastructure, is an indispensable part of ensuring the stability of production environment services. At present, EDAS provides very rich monitoring capabilities. Let's introduce these monitoring capabilities in detail from different scenarios.

Construction of systematic monitoring capability

In the monitoring system, the biggest fear is that there are areas that cannot be covered. A comprehensive monitoring system should have corresponding means to cover from infrastructure to upper-level applications:

First of all, if the failure occurs, the first thing to feel is the damage to the business, such as a drop in trading volume, a drop in landing UV, and so on.

If we continue to drill down, if the business cluster is very large, we first need to locate a certain service or a certain machine. Without corresponding tools, this process is like looking for a needle in a haystack, so a distributed link-level application monitoring will be a good match for building Spring Cloud applications.

When we find the appropriate service to start location analysis, according to the type of problem (is it wrong or slow? ) next, we need to analyze the metrics of JVM, memory, CPU and other dimensions.

Finally, we may find that this problem is caused by business code, or it may be caused by infrastructure, and in K8s, Prometheus is currently the most powerful basic monitoring saber in the container domain.

As shown in the figure above, EDAS, combined with some cloud products on Aliyun, can fully meet the needs of daily operation and maintenance and help students with business development quickly locate online problems.

EDAS routine monitoring ability 1. System monitor and control

Basic monitoring information of the application instance:

The above feature provides to view the monitoring information of each instance based on the dimension of the application instance. We often need to pay attention to the monitoring information such as JVM / CPU / Load / memory. When we find that there is a high memory footprint and frequent FullGCC, we can quickly locate the problem by creating a memory snapshot for analysis. The ability of SQL analysis can also quickly help us locate slow queries for troubleshooting.

two。 Application service monitoring

Monitoring information of application service interface:

The monitoring information in terms of the interface dimension is provided here, and you can see the request information of the interface in the recent period of time. Here, we focus on the interface snapshot feature. Through the interface snapshot, we can see the request time consumed by the API and the requested TraceId. According to this TraceId, we can see the call chain and method stack of this request in detail.

Call link tracking is an indispensable tool in distributed systems, especially in troubleshooting upstream and downstream dependencies which system slows down the whole request. The call error can be traced intuitively in the method stack of the call.

3. Application business monitoring

In EDAS, we support the application of custom business monitoring, which requires our ability to enable advanced monitoring. To measure the performance and stability of applications from a business perspective, we can collect business information through customization to show business indicators in real time and help the business to further improve monitoring information. For detailed monitoring configuration, please refer to ARMS Business Monitoring.

4. Prometheus monitoring

Monitoring products have a long history, but with the continuous popularity of cloud native technology, Prometheus, as a new generation of open source monitoring system, has gradually become the de facto standard of cloud native system. ARMS, the advanced monitoring product in EDAS, has been fully integrated with the open source Prometheus ecosystem, supporting rich types of component monitoring, providing a variety of preset monitoring market for out-of-the-box use, and providing fully managed Prometheus services. For more details, please see ARMS Prometheus.

Through the above monitoring capabilities, we can greatly shorten the time from finding to positioning to solving online problems, and improve the efficiency of developers and operation and maintenance personnel in troubleshooting and solving problems.

Monitoring in EDAS Application Publishing scenario

Taking the experience of Alibaba Group as an example, more than half of the major failures occur during the release process. EDAS combines the release scenario with the capabilities of Kubernetes, and the essence of the release is summarized in three words: first, then see, and then send. The popular explanation is that you can take advantage of the batch (grayscale) release ability in EDAS, and in the release view, make sure that the relevant indicators are back to normal before starting the next batch release.

Currently, EDAS can provide metrics monitoring data in three dimensions to determine whether the publication is normal, as listed below:

1. Application business metrics

At present, EDAS provides a comparison of the total number of requests for each interface before and after publication and a diagram showing the proportion of requests in terms of the dimension of the interface, and you can also see in detail the comparison of the number of errors, response time and requests on a single machine of the API before and after publication, as shown in the following figure:

From the figure above, we can directly see whether the interface request of the application is normal after we release it, so as to judge whether it will have an impact on the business.

two。 Application exception

In the process of publishing, we also need to always pay attention to whether there are any new exceptions in the publishing process. We want to have a place where we can see the exception information and avoid logging in to the machine directly to view the business log. Our release monitoring provides the ability of log aggregation analysis, which can provide real-time display of exception log analysis during the publishing process, as shown below:

3. System index

When the new business functions are launched, we not only pay attention to some anomalies and indicators of the business itself, but also need to pay attention to the indicators of the system, which is related to whether we need to evaluate whether the existing machines can support all our traffic. Whether horizontal expansion is needed to better support the business, our release monitoring system also integrates the monitoring capability of the system to protect our release process. The detailed monitoring is shown in the following figure:

The above content shows you the complete monitoring capability provided by EDAS during the whole release process through three dimensions. Through this capability, we can make every release leisurely and have a clear idea, and every release can smoothly upgrade the business. At the same time, we also provide the function to view the release report and release the monitoring information to form a clear visual analysis report for others to share.

So much for sharing the best practices of SpringCloud applications on Kubernetes. I hope the above content can help you and learn more. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report