Skip to content

Commit

Permalink
[manager]support monitor params name i18n (#184)
Browse files Browse the repository at this point in the history
* [manager]support monitor params name i18n

* [manager]support monitor params name i18n
  • Loading branch information
tomsun28 committed Jun 12, 2022
1 parent 2ed036c commit 91dfba9
Show file tree
Hide file tree
Showing 22 changed files with 436 additions and 195 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.usthe.common.entity.manager;

import com.usthe.common.entity.alerter.JsonMapAttributeConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
Expand All @@ -16,6 +17,7 @@
import javax.persistence.Table;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

import static io.swagger.annotations.ApiModelProperty.AccessMode.READ_ONLY;
import static io.swagger.annotations.ApiModelProperty.AccessMode.READ_WRITE;
Expand Down Expand Up @@ -54,10 +56,14 @@ public class ParamDefine {

/**
* Parameter field external display name
* zh-CN: 端口
* en-US: Port
* 参数字段对外显示名称
*/
@ApiModelProperty(value = "参数字段显示名称", example = "端口", accessMode = READ_WRITE, position = 2)
private String name;
@ApiModelProperty(value = "参数字段显示国际化名称", example = "{zh-CN: '端口'}", accessMode = READ_WRITE, position = 2)
@Convert(converter = JsonMapAttributeConverter.class)
@SuppressWarnings("JpaAttributeTypeInspection")
private Map<String, String> name;

/**
* Parameter Field Identifier
Expand Down
85 changes: 85 additions & 0 deletions home/blog/2022-06-01-hertzbeat-v1.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: 云监控系统 HertzBeat v1.0 正式发布啦
author: tom
author_title: tom
author_url: https://github.com/tomsun28
author_image_url: https://avatars.githubusercontent.com/u/24788200?s=400&v=4
tags: [opensource]
---

[HertzBeat 赫兹跳动](https://github.com/dromara/hertzbeat) 是由 [Dromara](https://dromara.org) 孵化,[TanCloud](https://tancloud.cn) 开源的一个支持网站,API,PING,端口,数据库,全站,操作系统,中间件等监控类型,支持阈值告警,告警通知 (邮箱,webhook,钉钉,企业微信,飞书机器人),拥有易用友好的可视化操作界面的开源监控告警项目。

**官网: [hertzbeat.com](https://hertzbeat.com) | [tancloud.cn](https://tancloud.cn)**

从v1.0-beta.1到v1.0-beat.8,经过多个版本的迭代完善,我们很高兴宣布hertzbeat v1.0正式发布。

感谢从beat.1版本以来 HertzBeat Contributors 的贡献,社区同学和用户们的支持。 此版本更新支持了Redis的监控( @gcdd1993 贡献),覆盖Redis的内存CPU等各个性能指标,全方面监控Redis。修复了多个bug进一步增强稳定性。

<table>
<tr>
<td align="center"><a href="https://github.com/tomsun28"><img src="https://avatars.githubusercontent.com/u/24788200?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tomsun28</b></sub></a><br /><a href="https://github.com/tomsun28/hertzbeat/commits?author=tomsun28" title="Code">💻</a> <a href="https://github.com/tomsun28/hertzbeat/commits?author=tomsun28" title="Documentation">📖</a> <a href="#design-tomsun28" title="Design">🎨</a></td>
<td align="center"><a href="https://github.com/wang1027-wqh"><img src="https://avatars.githubusercontent.com/u/71161318?v=4?s=100" width="100px;" alt=""/><br /><sub><b>会编程的王学长</b></sub></a><br /><a href="https://github.com/tomsun28/hertzbeat/commits?author=wang1027-wqh" title="Code">💻</a> <a href="https://github.com/tomsun28/hertzbeat/commits?author=wang1027-wqh" title="Documentation">📖</a> <a href="#design-wang1027-wqh" title="Design">🎨</a></td>
<td align="center"><a href="https://www.maxkey.top/"><img src="https://avatars.githubusercontent.com/u/1563377?v=4?s=100" width="100px;" alt=""/><br /><sub><b>MaxKey</b></sub></a><br /><a href="https://github.com/tomsun28/hertzbeat/commits?author=shimingxy" title="Code">💻</a> <a href="#design-shimingxy" title="Design">🎨</a> <a href="#ideas-shimingxy" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://blog.gcdd.top/"><img src="https://avatars.githubusercontent.com/u/26523525?v=4?s=100" width="100px;" alt=""/><br /><sub><b>观沧海</b></sub></a><br /><a href="https://github.com/tomsun28/hertzbeat/commits?author=gcdd1993" title="Code">💻</a> <a href="#design-gcdd1993" title="Design">🎨</a> <a href="https://github.com/tomsun28/hertzbeat/issues?q=author%3Agcdd1993" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/a25017012"><img src="https://avatars.githubusercontent.com/u/32265356?v=4?s=100" width="100px;" alt=""/><br /><sub><b>yuye</b></sub></a><br /><a href="https://github.com/tomsun28/hertzbeat/commits?author=a25017012" title="Code">💻</a> <a href="https://github.com/tomsun28/hertzbeat/commits?author=a25017012" title="Documentation">📖</a></td>
<td align="center"><a href="https://github.com/jx10086"><img src="https://avatars.githubusercontent.com/u/5323228?v=4?s=100" width="100px;" alt=""/><br /><sub><b>jx10086</b></sub></a><br /><a href="https://github.com/tomsun28/hertzbeat/commits?author=jx10086" title="Code">💻</a> <a href="https://github.com/tomsun28/hertzbeat/issues?q=author%3Ajx10086" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/winnerTimer"><img src="https://avatars.githubusercontent.com/u/76024658?v=4?s=100" width="100px;" alt=""/><br /><sub><b>winnerTimer</b></sub></a><br /><a href="https://github.com/tomsun28/hertzbeat/commits?author=winnerTimer" title="Code">💻</a> <a href="https://github.com/tomsun28/hertzbeat/issues?q=author%3AwinnerTimer" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/goo-kits"><img src="https://avatars.githubusercontent.com/u/13163673?v=4?s=100" width="100px;" alt=""/><br /><sub><b>goo-kits</b></sub></a><br /><a href="https://github.com/tomsun28/hertzbeat/commits?author=goo-kits" title="Code">💻</a> <a href="https://github.com/tomsun28/hertzbeat/issues?q=author%3Agoo-kits" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/brave4Time"><img src="https://avatars.githubusercontent.com/u/105094014?v=4?s=100" width="100px;" alt=""/><br /><sub><b>brave4Time</b></sub></a><br /><a href="https://github.com/tomsun28/hertzbeat/commits?author=brave4Time" title="Code">💻</a> <a href="https://github.com/tomsun28/hertzbeat/issues?q=author%3Abrave4Time" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/walkerlee-lab"><img src="https://avatars.githubusercontent.com/u/8426753?v=4?s=100" width="100px;" alt=""/><br /><sub><b>WalkerLee</b></sub></a><br /><a href="https://github.com/tomsun28/hertzbeat/commits?author=walkerlee-lab" title="Code">💻</a> <a href="https://github.com/tomsun28/hertzbeat/issues?q=author%3Awalkerlee-lab" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/fullofjoy"><img src="https://avatars.githubusercontent.com/u/30247571?v=4?s=100" width="100px;" alt=""/><br /><sub><b>jianghang</b></sub></a><br /><a href="https://github.com/tomsun28/hertzbeat/commits?author=fullofjoy" title="Code">💻</a> <a href="https://github.com/tomsun28/hertzbeat/issues?q=author%3Afullofjoy" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/ChineseTony"><img src="https://avatars.githubusercontent.com/u/24618786?v=4?s=100" width="100px;" alt=""/><br /><sub><b>ChineseTony</b></sub></a><br /><a href="https://github.com/tomsun28/hertzbeat/commits?author=ChineseTony" title="Code">💻</a></td>
</tr>
</table>

特性:

1. [[monitor] feature:支持redis监控协议 #142](https://github.com/dromara/hertzbeat/pull/142). contribute by @gcdd1993
2. Copyright & NOTICE contribute by @shimingxy
3. [[alerter]bugfix: 支持系统告警设置触发次数 #144](https://github.com/dromara/hertzbeat/pull/144).
4. [[collector]feature: redis复用单连接 #146](https://github.com/dromara/hertzbeat/pull/146).
5. [[collector]隐藏日志中IP、账号与密码等敏感信息 #159](https://github.com/dromara/hertzbeat/pull/159) idea from @goo-kits
6. [支持 zookeeper 监控帮助文档 #137](https://github.com/dromara/hertzbeat/pull/137) contributr by @wang1027-wqh

Bug修复.

1. [[monitor]bugfix: 修复resource bundle在en.HK加载资源错误问题 #131](https://github.com/dromara/hertzbeat/pull/131).
2. [[web-app]bugfix:修复当主题为dark时部分菜单不可见 #132](https://github.com/dromara/hertzbeat/pull/132).
3. [[monitor]bugfix: 修复通知策略过滤标签时只能选择一个 #140](https://github.com/dromara/hertzbeat/pull/140). issue by @daqianxiaoyao
4. [[td-engine store]bugfix: 修复tdengine入库指标数据时无table报错日志#150](https://github.com/dromara/hertzbeat/pull/150). contribute by @ChineseTony
5. [[collector]bugfix: 修复 warehouse data queue 未消费异常 #153](https://github.com/dromara/hertzbeat/pull/153). issue by @daqianxiaoyao
7. [[web-app]bugfix: 修复黑暗主题时页面输入框校验出错时不可见 #157](https://github.com/dromara/hertzbeat/pull/157). issue by @ConradWen

**Full Changelog**: https://github.com/dromara/hertzbeat/compare/v1.0-beta.8...v1.0

Online https://console.tancloud.cn.

-----------------------
Redis监控来啦:

<img width="1910" alt="2022-05-29 20 23 58" src="https://user-images.githubusercontent.com/24788200/170868079-325ccc08-165f-4d0e-9ebb-18b0b5c9db3f.png">

<img width="959" alt="2022-05-29 20 24 21" src="https://user-images.githubusercontent.com/24788200/170868094-3c4de70f-934a-4a13-ae1a-0744c30f14f3.png">


> [HertzBeat赫兹跳动](https://github.com/dromara/hertzbeat) 是由[Dromara](https://dromara.org)孵化,[TanCloud](https://tancloud.cn)开源的一个支持网站,API,PING,端口,数据库,操作系统等监控类型,拥有易用友好的可视化操作界面的开源监控告警项目。
> 当然,我们也提供了对应的[SAAS云监控版本](https://console.tancloud.cn),中小团队和个人无需再为了监控自己的网站资源,而去部署一套繁琐的监控系统,[登录即可免费开始](https://console.tancloud.cn)监控之旅。
> HertzBeat 支持自定义监控,只用通过配置YML文件我们就可以自定义需要的监控类型和指标,来满足常见的个性化需求。
> HertzBeat 模块化,`manager, collector, scheduler, warehouse, alerter` 各个模块解耦合,方便理解与定制开发。
> HertzBeat 支持更自由化的告警配置(计算表达式),支持告警通知,告警模版,邮件钉钉微信飞书等及时通知送达
> 欢迎登录 HertzBeat 的 [云环境TanCloud](https://console.tancloud.cn) 试用发现更多。
> 我们正在快速迭代中,欢迎参与加入共建项目开源生态。
> `HertzBeat` 的多类型支持,易扩展,低耦合,希望能帮助开发者和中小团队快速搭建自有监控系统。
老铁们可以通过演示视频来直观了解功能: [https://www.bilibili.com/video/BV1DY4y1i7ts](https://www.bilibili.com/video/BV1DY4y1i7ts)


**仓库地址**

[Github](https://github.com/dromara/hertzbeat) [https://github.com/dromara/hertzbeat](https://github.com/dromara/hertzbeat)

[Gitee](https://gitee.com/dromara/hertzbeat) [https://gitee.com/dromara/hertzbeat](https://gitee.com/dromara/hertzbeat)

Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ public Job getAppDefine(String app) throws IllegalArgumentException {

@Override
public Map<String, String> getI18nResources(String lang) {
Map<String, String> i18nMap = new HashMap<>(32);
Map<String, String> i18nMap = new HashMap<>(128);
for (Job job : appDefines.values()) {
// todo Todo temporarily only internationalizes the monitoring type name, after which it needs to support the indicator name
// 暂时只国际化监控类型名称 后面需要支持指标名称
// todo needs to support the indicator name
// 后面需要支持指标名称
Map<String, String> name = job.getName();
if (name != null && !name.isEmpty()) {
String i18nName = name.get(lang);
Expand All @@ -84,6 +84,19 @@ public Map<String, String> getI18nResources(String lang) {
i18nMap.put("monitor.app." + job.getApp(), i18nName);
}
}
for (Map.Entry<String, List<ParamDefine>> entry : paramDefines.entrySet()) {
String app = entry.getKey();
for (ParamDefine paramDefine : entry.getValue()) {
Map<String, String> name = paramDefine.getName();
if (name != null && !name.isEmpty()) {
String i18nName = name.get(lang);
if (i18nName == null) {
i18nName = name.values().stream().findFirst().get();
}
i18nMap.put("monitor.app." + app + ".param." + paramDefine.getField(), i18nName);
}
}
}
return i18nMap;
}

Expand Down
36 changes: 25 additions & 11 deletions manager/src/main/resources/define/param/A-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ param:
# field-字段名称标识符
- field: host
# name-参数字段显示名称
name: 主机Host
name:
zh-CN: 主机Host
en-US: Host
# type-字段类型,样式(大部分映射input标签type属性)
type: host
# 是否是必输项 true-必填 false-可选
required: true
- field: port
name: 端口
name:
zh-CN: 端口
en-US: Port
type: number
# 当type为number时,用range表示范围
range: '[0,65535]'
Expand All @@ -21,38 +25,48 @@ param:
# 参数输入框提示信息
placeholder: '请输入端口'
- field: username
name: 用户名
name:
zh-CN: 用户名
en-US: Username
type: text
# 当type为text时,用limit表示字符串限制大小
limit: 20
required: false
hide: true
- field: password
name: 密码
name:
zh-CN: 用户密码
en-US: Password
type: password
required: false
hide: true
- field: ssl
name: 启动SSL
name:
zh-CN: 启动SSL
en-US: SSL
# 当type为boolean时,前端用switch展示开关
type: boolean
required: false
- field: method
name: 请求方式
name:
zh-CN: 请求方式
en-US: Method
type: radio
required: true
# 当type为radio单选框,checkbox复选框时,option表示可选项值列表 {name1:value1,name2:value2}
options:
- label: GET请求
- label: GET
value: GET
- label: POST请求
- label: POST
value: POST
- label: PUT请求
- label: PUT
value: PUT
- label: DELETE请求
- label: DELETE
value: DELETE
- field: headers
name: 请求Headers
name:
zh-CN: 请求Headers
en-US: Headers
type: key-value
required: false
keyAlias: Header Name
Expand Down
78 changes: 46 additions & 32 deletions manager/src/main/resources/define/param/api.yml
Original file line number Diff line number Diff line change
@@ -1,97 +1,111 @@
# 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws...
app: api
# 强制固定必须参数 - host(ipv4,ipv6,域名)
param:
# field-字段名称标识符
- field: host
# name-参数字段显示名称
name: 主机Host
# type-字段类型,样式(大部分映射input标签type属性)
name:
zh-CN: 主机Host
en-US: Host
type: host
# 是否是必输项 true-必填 false-可选
required: true
- field: port
name: 端口
name:
zh-CN: 端口
en-US: Port
type: number
# 当type为number时,用range表示范围
range: '[0,65535]'
required: true
defaultValue: 80
- field: method
name: 请求方式
name:
zh-CN: 请求方式
en-US: Method
type: radio
required: true
# 当type为radio单选框,checkbox复选框时,option表示可选项值列表 {name1:value1,name2:value2}
options:
- label: GET请求
- label: GET
value: GET
- label: POST请求
- label: POST
value: POST
- label: PUT请求
- label: PUT
value: PUT
- label: DELETE请求
- label: DELETE
value: DELETE
- field: uri
name: 相对路径
name:
zh-CN: 相对路径
en-US: URI
type: text
# 当type为text时,用limit表示字符串限制大小
limit: 200
required: false
placeholder: 'API地址除IP端口外的路径 例如:/v2/book/bar'
placeholder: 'Website uri path(no ip port) EG:/v2/book/bar'
- field: ssl
name: 启用HTTPS
# 当type为boolean时,前端用switch展示开关
name:
zh-CN: 启用HTTPS
en-US: HTTPS
type: boolean
required: true
- field: headers
name: 请求Headers
name:
zh-CN: 请求Headers
en-US: Headers
type: key-value
required: false
keyAlias: Header Name
valueAlias: Header Value
- field: params
name: 查询Params
name:
zh-CN: 查询Params
en-US: Params
type: key-value
required: false
keyAlias: Param Key
valueAlias: Param Value
- field: contentType
name: Content-Type
name:
zh-CN: Content-Type
en-US: Content-Type
type: text
placeholder: '请求BODY资源类型'
placeholder: 'Request Body Type'
required: false
hide: true
- field: payload
name: 请求BODY
name:
zh-CN: 请求BODY
en-US: BODY
type: textarea
placeholder: 'POST PUT请求时有效'
placeholder: 'Available When POST PUT'
required: false
hide: true
- field: authType
name: 认证方式
name:
zh-CN: 认证方式
en-US: Auth Type
type: radio
required: false
hide: true
# 当type为radio单选框,checkbox复选框时,option表示可选项值列表 {name1:value1,name2:value2}
options:
- label: Basic Auth
value: Basic Auth
- label: Digest Auth
value: Digest Auth
- field: username
name: 用户名
name:
zh-CN: 用户名
en-US: Username
type: text
# 当type为text时,用limit表示字符串限制大小
limit: 20
required: false
hide: true
- field: password
name: 密码
name:
zh-CN: 密码
en-US: Password
type: password
required: false
hide: true
- field: keyword
name: 关键字
name:
zh-CN: 关键字
en-US: Keyword
type: text
required: false
hide: true
Loading

0 comments on commit 91dfba9

Please sign in to comment.