In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Today, I will talk to you about how to use Prometheus to monitor business services. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something from this article.
Here we share a blackbox_exporter for black box monitoring, which can be used to detect http,https,tcp,dns and ICMP protocols to capture data for monitoring. But what is the use of all this for us?
Http pointer detection
We can monitor the status code of the service through blackbox_exporter. We can see what the status code returned successfully is in the code. The status code monitoring rules can be seen in the following figure.
In this way, we can judge whether the service is still working normally, whether the website is inaccessible, and monitor the service resources from the user's point of view. Of course, you can also monitor the validity period of certificates that support https. See the figure below. Certificates for two domain names still have a year and a half to expire. As long as the data is collected, we can effectively alarm through the data, and there is no need to specifically write to expand the service area to monitor the expiration time of the certificate.
DNS pointer detection
The same Blackbox_exporter can also detect the resolution of the DNS of a domain name, and try different DNS to see if there is any problem with the resolution of the domain name service, such as the effect diagram I have done here.
Similarly, blackbox_exporter, as described in Github, can do probes such as http,https,tcp,icmp,DNS, so you can collect data according to your own needs and let the data of the system speak.
Let's talk about how to achieve these data collection and monitoring: the first step is to install, prepare a blackbox_exporter Agent, and let it act as an agent to collect data for us.
First of all, we should prepare a probe module as the configuration file blackbox_exporter.yml of blackbox_exporter. Here we use HTTP and DNS modules as demonstration cases.
Once the configuration file is ready, we can start running the blackbox_exporter container.
After running, check the running logs of some containers
Suppose we have an off-the-shelf Promtheus service. We can write blackbox_exporter into the promtheus service now
If we take a closer look at the configuration file of prometheus, we will find that the check items are found through dynamic files, in which blackbox_dns.json is used to find domain names to be checked, and blackbox_http.json is used to find configuration files that are normal using http module sniffing service. Next, we need to add these two files in the same directory of prometheus configuration file.
Blackbox_dns.json
Blackbox_http.json
In this way, we have implemented a demonstration of two probe pointers for DNS,http. Let's take a look at the monitoring status of the Http module in Prometheus.
Similarly, I use Grafana here to display icons for HTTP monitoring data. Here, the ID for sharing Dashboard is 9965 and 7587.
[7587]
[9965]
After reading the above, do you have any further understanding of how to use Prometheus to monitor business services? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.