diff --git a/.markdownlint-cli2.jsonc b/.markdownlint-cli2.jsonc index 01e8be79233..9dab612ab39 100644 --- a/.markdownlint-cli2.jsonc +++ b/.markdownlint-cli2.jsonc @@ -20,7 +20,11 @@ "MD001": true, "MD052": false, "MD003": false, - "MD013": false, + "MD013": { + "line_length": 600, + "code_blocks": false, + "tables": false + }, "MD024": { "siblings_only": true }, diff --git a/alerter/src/main/java/org/apache/hertzbeat/alert/reduce/AlarmConvergeReduce.java b/alerter/src/main/java/org/apache/hertzbeat/alert/reduce/AlarmConvergeReduce.java index 936cb2d8b95..8b8dbb257d9 100644 --- a/alerter/src/main/java/org/apache/hertzbeat/alert/reduce/AlarmConvergeReduce.java +++ b/alerter/src/main/java/org/apache/hertzbeat/alert/reduce/AlarmConvergeReduce.java @@ -64,17 +64,11 @@ public boolean filterConverge(Alert currentAlert) { isHasIgnore = true; tags.remove(CommonConstants.IGNORE); } - int alertHash = Objects.hash(CommonConstants.ALERT_PRIORITY_CODE_CRITICAL) - + Arrays.hashCode(tags.keySet().toArray(new String[0])) - + Arrays.hashCode(tags.values().toArray(new String[0])); + int alertHash = generateAlertHash(CommonConstants.ALERT_PRIORITY_CODE_CRITICAL, tags); converageAlertMap.remove(alertHash); - alertHash = Objects.hash(CommonConstants.ALERT_PRIORITY_CODE_EMERGENCY) - + Arrays.hashCode(tags.keySet().toArray(new String[0])) - + Arrays.hashCode(tags.values().toArray(new String[0])); + alertHash = generateAlertHash(CommonConstants.ALERT_PRIORITY_CODE_EMERGENCY, tags); converageAlertMap.remove(alertHash); - alertHash = Objects.hash(CommonConstants.ALERT_PRIORITY_CODE_WARNING) - + Arrays.hashCode(tags.keySet().toArray(new String[0])) - + Arrays.hashCode(tags.values().toArray(new String[0])); + alertHash = generateAlertHash(CommonConstants.ALERT_PRIORITY_CODE_WARNING, tags); converageAlertMap.remove(alertHash); if (isHasIgnore) { tags.put(CommonConstants.IGNORE, CommonConstants.IGNORE); @@ -132,9 +126,7 @@ public boolean filterConverge(Alert currentAlert) { if (evalInterval <= 0) { return true; } - int alertHash = Objects.hash(currentAlert.getPriority()) - + Arrays.hashCode(currentAlert.getTags().keySet().toArray(new String[0])) - + Arrays.hashCode(currentAlert.getTags().values().toArray(new String[0])); + int alertHash = generateAlertHash(currentAlert.getPriority(), currentAlert.getTags()); Alert preAlert = converageAlertMap.get(alertHash); if (preAlert == null) { currentAlert.setTimes(1); @@ -165,4 +157,12 @@ public boolean filterConverge(Alert currentAlert) { } return true; } + + private int generateAlertHash(byte priority, Map tags) { + List keyList = tags.keySet().stream().filter(Objects::nonNull).sorted().toList(); + List valueList = tags.values().stream().filter(Objects::nonNull).sorted().toList(); + return Objects.hash(priority) + + Arrays.hashCode(keyList.toArray(new String[0])) + + Arrays.hashCode(valueList.toArray(new String[0])); + } } diff --git a/home/blog/2022-06-01-hertzbeat-v1.0.md b/home/blog/2022-06-01-hertzbeat-v1.0.md index eaf32fa4a1a..9d6a003ee50 100644 --- a/home/blog/2022-06-01-hertzbeat-v1.0.md +++ b/home/blog/2022-06-01-hertzbeat-v1.0.md @@ -7,7 +7,8 @@ author_image_url: https://avatars.githubusercontent.com/u/24788200?s=400&v=4 tags: [opensource] --- -HertzBeat, incubated by Dromara and open-sourced by TanCloud, is an open-source monitoring and alerting project that supports a variety of monitoring types including websites, APIs, PING, ports, databases, full-site, operating systems, middleware, etc. It supports threshold alarms and notification alerts (email, webhook, DingTalk, WeCom, Feishu robots) and has an easy-to-use, friendly visual operation interface. +HertzBeat, incubated by Dromara and open-sourced by TanCloud, is an open-source monitoring and alerting project that supports a variety of monitoring types including websites, APIs, PING, ports, databases, full-site, operating systems, middleware, etc. +It supports threshold alarms and notification alerts (email, webhook, DingTalk, WeCom, Feishu robots) and has an easy-to-use, friendly visual operation interface. Official Website: hertzbeat.com | tancloud.cn diff --git a/home/blog/2023-08-14-hertzbeat-v1.4.0.md b/home/blog/2023-08-14-hertzbeat-v1.4.0.md index 34179eb4df7..e0fec2a10fc 100644 --- a/home/blog/2023-08-14-hertzbeat-v1.4.0.md +++ b/home/blog/2023-08-14-hertzbeat-v1.4.0.md @@ -64,7 +64,8 @@ First of all, let's take a look at what open source can bring, or why open sourc * User traffic. Open source projects are provided free of charge to users and developers, and have advantages in attracting users to use and promoting them. * User trust. Open source products are naturally easy to gain the trust and patience of users, or lower the threshold of trust for users. -* Community collaboration. Open source products can attract top contributors to contribute together, receive user feedback issues, pr contributions, etc. Driven by the community, open source projects will become better and better, and more people will participate and use them after positive feedback. Community collaboration I think this is the meaning of open source, and this is not just the contribution code collaboration between programmers, users are all collaboration objects (for example, our project has a large number of operation and maintenance friends who contribute code and documents), if it is only code Open source without community collaboration, it is better to release an installation package for others to use and download for free. +* Community collaboration. Open source products can attract top contributors to contribute together, receive user feedback issues, pr contributions, etc. +* Driven by the community, open source projects will become better and better, and more people will participate and use them after positive feedback. Community collaboration I think this is the meaning of open source, and this is not just the contribution code collaboration between programmers, users are all collaboration objects (for example, our project has a large number of operation and maintenance friends who contribute code and documents), if it is only code Open source without community collaboration, it is better to release an installation package for others to use and download for free. * Product ecology. This is required for some ecological products, such as hertzbeat, which need to support monitoring types that connect to various types of protocols, and a large number of monitoring templates. Only a good open source project ecology can attract other contributors to contribute and share, exchange what is needed in the ecology, and ultimately everyone will benefit from the ecology. This is difficult to do in closed source programs. The above points focus on community collaboration and product ecology. This is also the reason for the open source cluster version. Only open source products can be rolled into stronger product power. For example, the technical feature of cluster will naturally attract developers (and the cluster itself is The product of our community collaboration) will attract more users and contributors to use feedback and iterate together. The community drives and then positively promotes open source projects and satisfies user functional experience. diff --git a/home/blog/2023-08-28-new-committer.md b/home/blog/2023-08-28-new-committer.md index 62a9b03d7b6..f6b389f3340 100644 --- a/home/blog/2023-08-28-new-committer.md +++ b/home/blog/2023-08-28-new-committer.md @@ -10,7 +10,10 @@ keywords: [open source monitoring system, alerting system] ! [hertzBeat](/img/blog/new-committer.png) -It's great to welcome a new community `Committer`, unlike other contributors `logicz` comes from an Ops implementation position at Cyberoam rather than a development position, but the quality of the contributions, both in terms of code and documentation etc. is very high 👍. This is also our `HertzBeat` and other open source projects are not the same place, because the user group is more oriented to the operation and maintenance of the development, in our 139 contributors in the operation and maintenance engineers accounted for more than 30%, which breaks the open source project collaboration and contribution to the object are the inherent cognition of the development position, which shows that whether it is the operation and maintenance engineers and test engineers to contribute to the open source project participation is very enthusiastic! This shows that both operation and maintenance engineers and test engineers are very enthusiastic about contributing to open source projects, not just as bystanders to open source collaboration. Participation in open source projects is not exclusive to a certain group of people, but is open to all who want to participate, it may be a document, a script or a piece of code, imagine your participation in the open source project is deployed to thousands of servers to run running, to help others to be used or browse the Review discussion, git record will always be kept, this may be the significance of participation in open source projects. +It's great to welcome a new community `Committer`, unlike other contributors `logicz` comes from an Ops implementation position at Cyberoam rather than a development position, but the quality of the contributions, both in terms of code and documentation etc. is very high 👍. +This is also our `HertzBeat` and other open source projects are not the same place, because the user group is more oriented to the operation and maintenance of the development, in our 139 contributors in the operation and maintenance engineers accounted for more than 30%, which breaks the open source project collaboration and contribution to the object are the inherent cognition of the development position, which shows that whether it is the operation and maintenance engineers and test engineers to contribute to the open source project participation is very enthusiastic! +This shows that both operation and maintenance engineers and test engineers are very enthusiastic about contributing to open source projects, not just as bystanders to open source collaboration. +Participation in open source projects is not exclusive to a certain group of people, but is open to all who want to participate, it may be a document, a script or a piece of code, imagine your participation in the open source project is deployed to thousands of servers to run running, to help others to be used or browse the Review discussion, git record will always be kept, this may be the significance of participation in open source projects. > Welcome HertzBeat's newest community committer logicz, let's learn more about his open source experience! @@ -28,7 +31,8 @@ github:zqr10159 ## Getting to know Hertzbeat -In March 2023, I started to contact Hertzbeat, due to the need for a complete monitoring->alerting platform for the project, due to the deployment of the project on the intranet, the company's internal closed-source monitoring platform can not be developed to meet the needs of cross-network segment alerts. Later in the github looking for open source monitoring platform, found Hertzbeat, easy to deploy and full-featured. The most important thing is that the author tom replies to issues and updates very quickly, very much in line with my imagination of the open source community, I'm very happy to be able to participate in open source and can see their own results for everyone to use. +In March 2023, I started to contact Hertzbeat, due to the need for a complete monitoring->alerting platform for the project, due to the deployment of the project on the intranet, the company's internal closed-source monitoring platform can not be developed to meet the needs of cross-network segment alerts. +Later in the github looking for open source monitoring platform, found Hertzbeat, easy to deploy and full-featured. The most important thing is that the author tom replies to issues and updates very quickly, very much in line with my imagination of the open source community, I'm very happy to be able to participate in open source and can see their own results for everyone to use. ## Ongoing open source contributions and gains diff --git a/home/blog/2024-07-08-new-committer.md b/home/blog/2024-07-08-new-committer.md index b955e2055b0..ae9ca623da4 100644 --- a/home/blog/2024-07-08-new-committer.md +++ b/home/blog/2024-07-08-new-committer.md @@ -16,7 +16,8 @@ I first came into contact with the Apache Hertzbeat project by chance. At that t ### Start contributing -After having a preliminary understanding of the project, I found that it needed to complete the monitoring scope of the big data field, so I decided to start contributing some code. I started with supplementing big data monitoring. This not only helped me understand the project more deeply, but also gradually let other members of the community know me. I remember that the first Pull Request I submitted was to add a new Hbase cluster monitoring template. Although it seems insignificant, I was very excited when it was merged. This was a real interaction between me and the open source community and my first step towards greater contribution. +After having a preliminary understanding of the project, I found that it needed to complete the monitoring scope of the big data field, so I decided to start contributing some code. I started with supplementing big data monitoring. This not only helped me understand the project more deeply, but also gradually let other members of the community know me. +I remember that the first Pull Request I submitted was to add a new Hbase cluster monitoring template. Although it seems insignificant, I was very excited when it was merged. This was a real interaction between me and the open source community and my first step towards greater contribution. ### In-depth participation @@ -46,4 +47,5 @@ This process made me understand the importance of cooperation and made me feel t ### Conclusion -Becoming a Committer of the Apache Hertzbeat project is a challenging and rewarding journey. Through continuous learning and contribution, I have not only improved my technical ability, but also found a sense of belonging and accomplishment in the community. I hope that my experience can inspire more people to participate in the open source community and jointly promote the progress and development of technology. To borrow the words of Tom: Participating in open source should not affect everyone's work and life, otherwise it will go against the original intention. Everyone should participate in the free time after get off work. +Becoming a Committer of the Apache Hertzbeat project is a challenging and rewarding journey. Through continuous learning and contribution, I have not only improved my technical ability, but also found a sense of belonging and accomplishment in the community. +I hope that my experience can inspire more people to participate in the open source community and jointly promote the progress and development of technology. To borrow the words of Tom: Participating in open source should not affect everyone's work and life, otherwise it will go against the original intention. Everyone should participate in the free time after get off work. diff --git a/home/blog/2024-07-15-new-committer.md b/home/blog/2024-07-15-new-committer.md index 2b8ec2bb111..2cde4ec39cb 100644 --- a/home/blog/2024-07-15-new-committer.md +++ b/home/blog/2024-07-15-new-committer.md @@ -14,7 +14,8 @@ Hello everyone, I am very honored to receive an invitation from the community to ### Encounter -In my work, several physical servers are deployed, running various databases and middleware. Although we have deployed the Prometheus + Grafana monitoring combination, most services and servers require additional installation of exporters. As a result, this monitoring system does not cover the entire project. Sometimes, we only realize a service is down when it is too late. One day in April, I came across an article introducing HertzBeat. I was immediately attracted by its unique features, such as no need for agents and fully visualized configuration, along with support for one-click deployment via Docker. I quickly deployed HertzBeat and put it into use. +In my work, several physical servers are deployed, running various databases and middleware. Although we have deployed the Prometheus + Grafana monitoring combination, most services and servers require additional installation of exporters. +As a result, this monitoring system does not cover the entire project. Sometimes, we only realize a service is down when it is too late. One day in April, I came across an article introducing HertzBeat. I was immediately attracted by its unique features, such as no need for agents and fully visualized configuration, along with support for one-click deployment via Docker. I quickly deployed HertzBeat and put it into use. ### Familiarization diff --git a/home/blog/2024-07-29-new-committer.md b/home/blog/2024-07-29-new-committer.md index 55aecd3eb94..642d1fac885 100644 --- a/home/blog/2024-07-29-new-committer.md +++ b/home/blog/2024-07-29-new-committer.md @@ -18,7 +18,8 @@ In the open-source community, every contribution not only pushes the project for ## Starting from the Details: Optimizing Visuals and Interactions -I firmly believe that details determine success or failure. When I first joined the project, I began by optimizing the interface to enhance the user's visual and interactive experience. I refined the modal window layout of the monitoring selection menu to better align with user operation habits. I adjusted the header style and content layout of the monitoring details page to make information presentation clearer and more intuitive. Additionally, I unified the border-radius values of components and addressed issues such as missing internationalization translations, ensuring the consistency and completeness of the system interface. +I firmly believe that details determine success or failure. When I first joined the project, I began by optimizing the interface to enhance the user's visual and interactive experience. I refined the modal window layout of the monitoring selection menu to better align with user operation habits. +I adjusted the header style and content layout of the monitoring details page to make information presentation clearer and more intuitive. Additionally, I unified the border-radius values of components and addressed issues such as missing internationalization translations, ensuring the consistency and completeness of the system interface. These seemingly minor changes significantly enhanced the overall aesthetics and user experience of the system. Through this process, I gained a profound understanding of the importance of interface design for user experience and honed my attention to detail. diff --git a/home/blog/2024-08-18-new-committer.md b/home/blog/2024-08-18-new-committer.md index b1175b5534b..6e1f9c712dc 100644 --- a/home/blog/2024-08-18-new-committer.md +++ b/home/blog/2024-08-18-new-committer.md @@ -20,7 +20,9 @@ From my junior year to the present, I still maintain my passion for open source ## Participate in the Apache Community -[Apache Software Foundation (ASF)](https://community.apache.org/) is an American non-profit organization that aims to support various open source software projects. ASF was originally formed by a group of developers of Apache HTTP Server and was officially established on March 25, 1999. As of 2021, its total membership is approximately 1,000. The name comes from a local Indian tribe in North America. This tribe is famous for its superb military literacy and superhuman endurance. In the second half of the 19th century, it resisted the invaders who invaded their territory. In order to show respect for this Indian tribe, the name of the tribe (Apache) is used as the server name. But when it comes to this naming, there is an interesting story circulating here. Because this server is based on the NCSA HTTPd server and is the product of continuous revision and patching through the efforts of everyone, it is nicknamed "A Patchy Server" (a patch server). Here, because "A Patchy" and "Apache" are homophones, it was finally officially named "Apache Server". +[Apache Software Foundation (ASF)](https://community.apache.org/) is an American non-profit organization that aims to support various open source software projects. ASF was originally formed by a group of developers of Apache HTTP Server and was officially established on March 25, 1999. As of 2021, its total membership is approximately 1,000. The name comes from a local Indian tribe in North America. +This tribe is famous for its superb military literacy and superhuman endurance. In the second half of the 19th century, it resisted the invaders who invaded their territory. In order to show respect for this Indian tribe, the name of the tribe (Apache) is used as the server name. +But when it comes to this naming, there is an interesting story circulating here. Because this server is based on the NCSA HTTPd server and is the product of continuous revision and patching through the efforts of everyone, it is nicknamed "A Patchy Server" (a patch server). Here, because "A Patchy" and "Apache" are homophones, it was finally officially named "Apache Server". The above is an introduction to the Apache Software Foundation from Wikipedia. @@ -46,13 +48,15 @@ As the saying goes, the greater the ability, the greater the task. Becoming a pr ## How to participate in open source -Anyone who wants to do something needs an opportunity and a guide. Among the many Apache projects, there are many people who pay attention to the project's Issue List. The one time that remains fresh in my memory is: one night after writing the unit test of a tool class, I discovered a small bug. What I thought at the time was that there was too much contextual information and it was not good to write it in a PR, so I opened an Issue to record the context. How small is this bug? It was so small that I just created the Issue. After submitting the unit test and the code to fix the bug together, I refreshed the PR List again and saw a PR Title to fix the bug. +Anyone who wants to do something needs an opportunity and a guide. Among the many Apache projects, there are many people who pay attention to the project's Issue List. The one time that remains fresh in my memory is: one night after writing the unit test of a tool class, I discovered a small bug. What I thought at the time was that there was too much contextual information and it was not good to write it in a PR, so I opened an Issue to record the context. +How small is this bug? It was so small that I just created the Issue. After submitting the unit test and the code to fix the bug together, I refreshed the PR List again and saw a PR Title to fix the bug. In fact, there is no shortage of people paying attention to the project, but more of an opportunity! Opportunities to participate in projects. ### The Apache Way -[The Apache Way](https://www.apache.org/theapacheway/) pursued by the Apache Community. The community is greater than the code. A good community is often more important than excellent code. The components of the community include developers, users, etc. Users are the first users of the project code. A healthy community status is when users discover problems, then report problems, and finally solve problems during use. A more likely scenario is that a user reports a problem, switches from being a user to a developer, and solves the problem. And continue to participate in the maintenance of community projects. +[The Apache Way](https://www.apache.org/theapacheway/) pursued by the Apache Community. The community is greater than the code. A good community is often more important than excellent code. The components of the community include developers, users, etc. Users are the first users of the project code. A healthy community status is when users discover problems, then report problems, and finally solve problems during use. +A more likely scenario is that a user reports a problem, switches from being a user to a developer, and solves the problem. And continue to participate in the maintenance of community projects. ### Paths to participate in open source diff --git a/home/docs/community/how-to-release.md b/home/docs/community/how-to-release.md index 94c919d30f0..46ab8a2bc86 100644 --- a/home/docs/community/how-to-release.md +++ b/home/docs/community/how-to-release.md @@ -307,7 +307,9 @@ svn co --depth empty https://dist.apache.org/repos/dist/dev/incubator/hertzbeat - Copy the material package to the dev directory -Create a version number directory and name it in the form of ${release_version}-${RC_version}. RC_version starts from 1, that is, the candidate version starts from RC1. During the release process, there is a problem that causes the vote to fail. If it needs to be corrected, it needs to iterate the RC version , the RC version number needs to be +1. For example: Vote for version 1.6.0-RC1. If the vote passes without any problems, the RC1 version material will be released as the final version material. If there is a problem (when the hertzbeat/incubator community votes, the voters will strictly check various release requirements and compliance issues) and need to be corrected, then re-initiate the vote after the correction, and the candidate version for the next vote is 1.6.0- RC2. +Create a version number directory and name it in the form of ${release_version}-${RC_version}. RC_version starts from 1, that is, the candidate version starts from RC1. During the release process, there is a problem that causes the vote to fail. +If it needs to be corrected, it needs to iterate the RC version , the RC version number needs to be +1. For example: Vote for version 1.6.0-RC1. If the vote passes without any problems, the RC1 version material will be released as the final version material. +If there is a problem (when the hertzbeat/incubator community votes, the voters will strictly check various release requirements and compliance issues) and need to be corrected, then re-initiate the vote after the correction, and the candidate version for the next vote is 1.6.0- RC2. ```shell mkdir -p svn/dev/1.6.0-RC1 diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.4.x/help/ntp.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/version-v1.4.x/help/ntp.md deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/home/versioned_docs/version-v1.5.x/community/how-to-release.md b/home/versioned_docs/version-v1.5.x/community/how-to-release.md index 94c919d30f0..46ab8a2bc86 100644 --- a/home/versioned_docs/version-v1.5.x/community/how-to-release.md +++ b/home/versioned_docs/version-v1.5.x/community/how-to-release.md @@ -307,7 +307,9 @@ svn co --depth empty https://dist.apache.org/repos/dist/dev/incubator/hertzbeat - Copy the material package to the dev directory -Create a version number directory and name it in the form of ${release_version}-${RC_version}. RC_version starts from 1, that is, the candidate version starts from RC1. During the release process, there is a problem that causes the vote to fail. If it needs to be corrected, it needs to iterate the RC version , the RC version number needs to be +1. For example: Vote for version 1.6.0-RC1. If the vote passes without any problems, the RC1 version material will be released as the final version material. If there is a problem (when the hertzbeat/incubator community votes, the voters will strictly check various release requirements and compliance issues) and need to be corrected, then re-initiate the vote after the correction, and the candidate version for the next vote is 1.6.0- RC2. +Create a version number directory and name it in the form of ${release_version}-${RC_version}. RC_version starts from 1, that is, the candidate version starts from RC1. During the release process, there is a problem that causes the vote to fail. +If it needs to be corrected, it needs to iterate the RC version , the RC version number needs to be +1. For example: Vote for version 1.6.0-RC1. If the vote passes without any problems, the RC1 version material will be released as the final version material. +If there is a problem (when the hertzbeat/incubator community votes, the voters will strictly check various release requirements and compliance issues) and need to be corrected, then re-initiate the vote after the correction, and the candidate version for the next vote is 1.6.0- RC2. ```shell mkdir -p svn/dev/1.6.0-RC1 diff --git a/home/versioned_docs/version-v1.5.x/template.md b/home/versioned_docs/version-v1.5.x/template.md index 2359a43e51f..f4b2743be26 100644 --- a/home/versioned_docs/version-v1.5.x/template.md +++ b/home/versioned_docs/version-v1.5.x/template.md @@ -13,7 +13,8 @@ Here is the architecture. ![hertzBeat](/img/docs/hertzbeat-arch.png) -**We define all monitoring collection types (mysql, website, jvm, k8s) as yml templates, and users can import these templates into the hertzbeat system to support corresponding types of monitoring, which is very convenient!** +**We define all monitoring collection types (mysql, website, jvm, k8s) as yml templates** +**Users can import these templates into the hertzbeat system to support corresponding types of monitoring, which is very convenient!** ![](/img/docs/advanced/extend-point-1.png) diff --git a/script/checkstyle/checkstyle.xml b/script/checkstyle/checkstyle.xml index 91a4d9b97a2..fc1623a3585 100644 --- a/script/checkstyle/checkstyle.xml +++ b/script/checkstyle/checkstyle.xml @@ -296,15 +296,18 @@ value="Redundant import {0}."/> - + + + <!– This ensures that static imports go first. –> - + -->