Compare commits

...
Author SHA1 Message Date
tomsun28 b889785c10 fix
Signed-off-by: tomsun28 <tomsun28@outlook.com>
2025-10-28 22:21:46 +08:00
tomsun28 69e60bc636 fix
Signed-off-by: tomsun28 <tomsun28@outlook.com>
2025-10-28 21:20:05 +08:00
Tomsun28 9a2e85b089 Merge branch 'master' into new-startup 2025-10-27 23:50:19 +08:00
tomsun28 a71f5102dd fix
Signed-off-by: tomsun28 <tomsun28@outlook.com>
2025-10-27 23:36:25 +08:00
tomsun28 293d446505 fix
Signed-off-by: tomsun28 <tomsun28@outlook.com>
2025-10-27 21:26:44 +08:00
tomsun28 c415b9373a fix
Signed-off-by: tomsun28 <tomsun28@outlook.com>
2025-10-26 23:25:20 +08:00
tomsun28 e3075bab8a fix
Signed-off-by: tomsun28 <tomsun28@outlook.com>
2025-10-26 00:30:57 +08:00
tomsun28 b51a7fbcdb fix build
Signed-off-by: tomsun28 <tomsun28@outlook.com>
2025-10-25 16:55:07 +08:00
tomsun28 6ecfbc60a0 move log mcp server to mcp-servers
Signed-off-by: tomsun28 <tomsun28@outlook.com>
2025-10-25 16:27:17 +08:00
tomsun28 82334a31a1 refactor ai-agent name to ai
Signed-off-by: tomsun28 <tomsun28@outlook.com>
2025-10-25 16:16:34 +08:00
tomsun28 93a8e8fa74 move some to startup
Signed-off-by: tomsun28 <tomsun28@outlook.com>
2025-10-25 16:07:23 +08:00
Tomsun28 9014f117d3 docs: update contributors page (#3827)
Signed-off-by: tomsun28 <tomsun28@outlook.com>
2025-10-25 13:53:35 +08:00
116 changed files with 14067 additions and 10290 deletions
+74 -7
View File
@@ -1274,11 +1274,7 @@
"avatar_url": "https://avatars.githubusercontent.com/u/105542329?v=4",
"profile": "https://github.com/lynx009",
"contributions": [
"code",
"doc",
"blog",
"bug",
"design"
"doc"
]
},
{
@@ -2588,8 +2584,7 @@
"avatar_url": "https://avatars.githubusercontent.com/u/95274591?v=4",
"profile": "https://github.com/tuzuy",
"contributions": [
"code",
"design"
"code"
]
},
{
@@ -2600,6 +2595,78 @@
"contributions": [
"code"
]
},
{
"login": "cxhello",
"name": "cxhello",
"avatar_url": "https://avatars.githubusercontent.com/u/49056040?v=4",
"profile": "https://cxhello.top/",
"contributions": [
"doc"
]
},
{
"login": "jl15988",
"name": "会功夫的李白",
"avatar_url": "https://avatars.githubusercontent.com/u/70638770?v=4",
"profile": "https://github.com/jl15988",
"contributions": [
"code"
]
},
{
"login": "AlbertYang0801",
"name": "Albert.Yang",
"avatar_url": "https://avatars.githubusercontent.com/u/37127008?v=4",
"profile": "https://blog.aytop.cloud/",
"contributions": [
"code"
]
},
{
"login": "mengnankkkk",
"name": "zhou yong kang",
"avatar_url": "https://avatars.githubusercontent.com/u/150590575?v=4",
"profile": "https://blog.tokenlen.top/",
"contributions": [
"code"
]
},
{
"login": "warrobe",
"name": "warrobe",
"avatar_url": "https://avatars.githubusercontent.com/u/89446159?v=4",
"profile": "https://github.com/warrobe",
"contributions": [
"code"
]
},
{
"login": "Jetiaime",
"name": "TeAmo",
"avatar_url": "https://avatars.githubusercontent.com/u/93769000?v=4",
"profile": "https://github.com/Jetiaime",
"contributions": [
"code"
]
},
{
"login": "pentium100",
"name": "pentium100",
"avatar_url": "https://avatars.githubusercontent.com/u/27917?v=4",
"profile": "https://github.com/pentium100",
"contributions": [
"code"
]
},
{
"login": "dedyks",
"name": "Dedy Kurniawan Santoso",
"avatar_url": "https://avatars.githubusercontent.com/u/23741665?v=4",
"profile": "https://github.com/dedyks",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
-1
View File
@@ -15,7 +15,6 @@
"customizations": {
"vscode": {
"settings": {},
// same extensions as Gitpod, should match /.gitpod.yml
"extensions": [
"vscjava.vscode-java-pack",
"editorconfig.editorconfig",
+10 -14
View File
@@ -44,19 +44,17 @@ Even small corrections to typos are very welcome :)
#### Frontend start
1. Need `Node Yarn` Environment, Make sure `Node.js >= 18`
1. Need `Node pnpm` Environment, Make sure `Node.js >= 18`
2. Cd to the `web-app` directory: `cd web-app`
3. Install yarn if not existed `npm install -g yarn`
3. Install pnpm if not existed `npm install -g pnpm`
4. Install Dependencies: `yarn install` or `yarn install --registry=https://registry.npmmirror.com` in `web-app`
4. Install Dependencies: `pnpm install` or `pnpm install --registry=https://registry.npmmirror.com` in `web-app`
5. Install angular-cli globally: `yarn global add @angular/cli@15` or `yarn global add @angular/cli@15 --registry=https://registry.npmmirror.com`
5. After the local backend is started, start the local frontend in the web-app directory: `pnpm start`
6. After the local backend is started, start the local frontend in the web-app directory: `ng serve --open`
7. Browser access to localhost:4200 to start, default account/password is *admin/hertzbeat*
6. Browser access to localhost:4200 to start, default account/password is *admin/hertzbeat*
### Find tasks
@@ -198,19 +196,17 @@ Add WeChat account `ahertzbeat` to pull you into the WeChat group.
#### 前端启动
1. 需要 `nodejs yarn` 环境, Make sure `Node.js >= 18`
1. 需要 `nodejs pnpm` 环境, Make sure `Node.js >= 18`
2. 进入 `web-app` 目录: `cd web-app`
3. 安装yarn: `npm install -g yarn`
3. 安装pnpm: `npm install -g pnpm`
4. 在前端工程目录 `web-app` 下执行: `yarn install` or `yarn install --registry=https://registry.npmmirror.com` in `web-app`
4. 在前端工程目录 `web-app` 下执行: `pnpm install` or `pnpm install --registry=https://registry.npmmirror.com` in `web-app`
5. 全局安装 `angular-cli`: `yarn global add @angular/cli@15` or `yarn global add @angular/cli@15 --registry=https://registry.npmmirror.com`
5. 待本地后端启动后,在web-app目录下启动本地前端 `pnpm start`
6. 待本地后端启动后,在web-app目录下启动本地前端 `ng serve --open`
7. 浏览器访问 localhost:4200 即可开始,默认账号密码 *admin/hertzbeat*
6. 浏览器访问 localhost:4200 即可开始,默认账号密码 *admin/hertzbeat*
### 寻找任务
+12 -2
View File
@@ -361,7 +361,7 @@ Thanks to these wonderful people, welcome to join us:
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lisongning"><img src="https://avatars.githubusercontent.com/u/93140178?v=4?s=100" width="100px;" alt="lisongning"/><br /><sub><b>lisongning</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=lisongning" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/YutingNie"><img src="https://avatars.githubusercontent.com/u/104416402?v=4?s=100" width="100px;" alt="YutingNie"/><br /><sub><b>YutingNie</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=YutingNie" title="Code">💻</a> <a href="https://github.com/apache/hertzbeat/commits?author=YutingNie" title="Documentation">📖</a> <a href="#design-YutingNie" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mikezzb"><img src="https://avatars.githubusercontent.com/u/23418428?v=4?s=100" width="100px;" alt="Mike Zhou"/><br /><sub><b>Mike Zhou</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=mikezzb" title="Code">💻</a> <a href="https://github.com/apache/hertzbeat/commits?author=mikezzb" title="Documentation">📖</a> <a href="#design-mikezzb" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lynx009"><img src="https://avatars.githubusercontent.com/u/105542329?v=4?s=100" width="100px;" alt="lynx009"/><br /><sub><b>lynx009</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=lynx009" title="Code">💻</a> <a href="https://github.com/apache/hertzbeat/commits?author=lynx009" title="Documentation">📖</a> <a href="#blog-lynx009" title="Blogposts">📝</a> <a href="https://github.com/apache/hertzbeat/issues?q=author%3Alynx009" title="Bug reports">🐛</a> <a href="#design-lynx009" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lynx009"><img src="https://avatars.githubusercontent.com/u/105542329?v=4?s=100" width="100px;" alt="lynx009"/><br /><sub><b>lynx009</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=lynx009" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/littlezhongzer"><img src="https://avatars.githubusercontent.com/u/33685289?v=4?s=100" width="100px;" alt="littlezhongzer"/><br /><sub><b>littlezhongzer</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=littlezhongzer" title="Code">💻</a></td>
@@ -537,8 +537,18 @@ Thanks to these wonderful people, welcome to join us:
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/chingjustwe"><img src="https://avatars.githubusercontent.com/u/13643747?v=4?s=100" width="100px;" alt="Rocky, Chi"/><br /><sub><b>Rocky, Chi</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=chingjustwe" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rowankid"><img src="https://avatars.githubusercontent.com/u/18652781?v=4?s=100" width="100px;" alt="Wenqi Luo"/><br /><sub><b>Wenqi Luo</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/issues?q=author%3Arowankid" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tuzuy"><img src="https://avatars.githubusercontent.com/u/95274591?v=4?s=100" width="100px;" alt="tuzuy"/><br /><sub><b>tuzuy</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=tuzuy" title="Code">💻</a> <a href="#design-tuzuy" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tuzuy"><img src="https://avatars.githubusercontent.com/u/95274591?v=4?s=100" width="100px;" alt="tuzuy"/><br /><sub><b>tuzuy</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=tuzuy" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/carlpinto25"><img src="https://avatars.githubusercontent.com/u/117299909?v=4?s=100" width="100px;" alt="carl pinto"/><br /><sub><b>carl pinto</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=carlpinto25" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://cxhello.top/"><img src="https://avatars.githubusercontent.com/u/49056040?v=4?s=100" width="100px;" alt="cxhello"/><br /><sub><b>cxhello</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=cxhello" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jl15988"><img src="https://avatars.githubusercontent.com/u/70638770?v=4?s=100" width="100px;" alt="会功夫的李白"/><br /><sub><b>会功夫的李白</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=jl15988" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://blog.aytop.cloud/"><img src="https://avatars.githubusercontent.com/u/37127008?v=4?s=100" width="100px;" alt="Albert.Yang"/><br /><sub><b>Albert.Yang</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=AlbertYang0801" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://blog.tokenlen.top/"><img src="https://avatars.githubusercontent.com/u/150590575?v=4?s=100" width="100px;" alt="zhou yong kang"/><br /><sub><b>zhou yong kang</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=mengnankkkk" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/warrobe"><img src="https://avatars.githubusercontent.com/u/89446159?v=4?s=100" width="100px;" alt="warrobe"/><br /><sub><b>warrobe</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=warrobe" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Jetiaime"><img src="https://avatars.githubusercontent.com/u/93769000?v=4?s=100" width="100px;" alt="TeAmo"/><br /><sub><b>TeAmo</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=Jetiaime" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/pentium100"><img src="https://avatars.githubusercontent.com/u/27917?v=4?s=100" width="100px;" alt="pentium100"/><br /><sub><b>pentium100</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=pentium100" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/dedyks"><img src="https://avatars.githubusercontent.com/u/23741665?v=4?s=100" width="100px;" alt="Dedy Kurniawan Santoso"/><br /><sub><b>Dedy Kurniawan Santoso</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=dedyks" title="Code">💻</a></td>
</tr>
</tbody>
</table>
+12 -2
View File
@@ -359,7 +359,7 @@ Thanks these wonderful people, welcome to join us:
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lisongning"><img src="https://avatars.githubusercontent.com/u/93140178?v=4?s=100" width="100px;" alt="lisongning"/><br /><sub><b>lisongning</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=lisongning" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/YutingNie"><img src="https://avatars.githubusercontent.com/u/104416402?v=4?s=100" width="100px;" alt="YutingNie"/><br /><sub><b>YutingNie</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=YutingNie" title="Code">💻</a> <a href="https://github.com/apache/hertzbeat/commits?author=YutingNie" title="Documentation">📖</a> <a href="#design-YutingNie" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mikezzb"><img src="https://avatars.githubusercontent.com/u/23418428?v=4?s=100" width="100px;" alt="Mike Zhou"/><br /><sub><b>Mike Zhou</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=mikezzb" title="Code">💻</a> <a href="https://github.com/apache/hertzbeat/commits?author=mikezzb" title="Documentation">📖</a> <a href="#design-mikezzb" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lynx009"><img src="https://avatars.githubusercontent.com/u/105542329?v=4?s=100" width="100px;" alt="lynx009"/><br /><sub><b>lynx009</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=lynx009" title="Code">💻</a> <a href="https://github.com/apache/hertzbeat/commits?author=lynx009" title="Documentation">📖</a> <a href="#blog-lynx009" title="Blogposts">📝</a> <a href="https://github.com/apache/hertzbeat/issues?q=author%3Alynx009" title="Bug reports">🐛</a> <a href="#design-lynx009" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lynx009"><img src="https://avatars.githubusercontent.com/u/105542329?v=4?s=100" width="100px;" alt="lynx009"/><br /><sub><b>lynx009</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=lynx009" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/littlezhongzer"><img src="https://avatars.githubusercontent.com/u/33685289?v=4?s=100" width="100px;" alt="littlezhongzer"/><br /><sub><b>littlezhongzer</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=littlezhongzer" title="Code">💻</a></td>
@@ -535,8 +535,18 @@ Thanks these wonderful people, welcome to join us:
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/chingjustwe"><img src="https://avatars.githubusercontent.com/u/13643747?v=4?s=100" width="100px;" alt="Rocky, Chi"/><br /><sub><b>Rocky, Chi</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=chingjustwe" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rowankid"><img src="https://avatars.githubusercontent.com/u/18652781?v=4?s=100" width="100px;" alt="Wenqi Luo"/><br /><sub><b>Wenqi Luo</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/issues?q=author%3Arowankid" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tuzuy"><img src="https://avatars.githubusercontent.com/u/95274591?v=4?s=100" width="100px;" alt="tuzuy"/><br /><sub><b>tuzuy</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=tuzuy" title="Code">💻</a> <a href="#design-tuzuy" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tuzuy"><img src="https://avatars.githubusercontent.com/u/95274591?v=4?s=100" width="100px;" alt="tuzuy"/><br /><sub><b>tuzuy</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=tuzuy" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/carlpinto25"><img src="https://avatars.githubusercontent.com/u/117299909?v=4?s=100" width="100px;" alt="carl pinto"/><br /><sub><b>carl pinto</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=carlpinto25" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://cxhello.top/"><img src="https://avatars.githubusercontent.com/u/49056040?v=4?s=100" width="100px;" alt="cxhello"/><br /><sub><b>cxhello</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=cxhello" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jl15988"><img src="https://avatars.githubusercontent.com/u/70638770?v=4?s=100" width="100px;" alt="会功夫的李白"/><br /><sub><b>会功夫的李白</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=jl15988" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://blog.aytop.cloud/"><img src="https://avatars.githubusercontent.com/u/37127008?v=4?s=100" width="100px;" alt="Albert.Yang"/><br /><sub><b>Albert.Yang</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=AlbertYang0801" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://blog.tokenlen.top/"><img src="https://avatars.githubusercontent.com/u/150590575?v=4?s=100" width="100px;" alt="zhou yong kang"/><br /><sub><b>zhou yong kang</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=mengnankkkk" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/warrobe"><img src="https://avatars.githubusercontent.com/u/89446159?v=4?s=100" width="100px;" alt="warrobe"/><br /><sub><b>warrobe</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=warrobe" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Jetiaime"><img src="https://avatars.githubusercontent.com/u/93769000?v=4?s=100" width="100px;" alt="TeAmo"/><br /><sub><b>TeAmo</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=Jetiaime" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/pentium100"><img src="https://avatars.githubusercontent.com/u/27917?v=4?s=100" width="100px;" alt="pentium100"/><br /><sub><b>pentium100</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=pentium100" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/dedyks"><img src="https://avatars.githubusercontent.com/u/23741665?v=4?s=100" width="100px;" alt="Dedy Kurniawan Santoso"/><br /><sub><b>Dedy Kurniawan Santoso</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=dedyks" title="Code">💻</a></td>
</tr>
</tbody>
</table>
+12 -2
View File
@@ -363,7 +363,7 @@ Thanks these wonderful people, welcome to join us:
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lisongning"><img src="https://avatars.githubusercontent.com/u/93140178?v=4?s=100" width="100px;" alt="lisongning"/><br /><sub><b>lisongning</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=lisongning" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/YutingNie"><img src="https://avatars.githubusercontent.com/u/104416402?v=4?s=100" width="100px;" alt="YutingNie"/><br /><sub><b>YutingNie</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=YutingNie" title="Code">💻</a> <a href="https://github.com/apache/hertzbeat/commits?author=YutingNie" title="Documentation">📖</a> <a href="#design-YutingNie" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mikezzb"><img src="https://avatars.githubusercontent.com/u/23418428?v=4?s=100" width="100px;" alt="Mike Zhou"/><br /><sub><b>Mike Zhou</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=mikezzb" title="Code">💻</a> <a href="https://github.com/apache/hertzbeat/commits?author=mikezzb" title="Documentation">📖</a> <a href="#design-mikezzb" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lynx009"><img src="https://avatars.githubusercontent.com/u/105542329?v=4?s=100" width="100px;" alt="lynx009"/><br /><sub><b>lynx009</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=lynx009" title="Code">💻</a> <a href="https://github.com/apache/hertzbeat/commits?author=lynx009" title="Documentation">📖</a> <a href="#blog-lynx009" title="Blogposts">📝</a> <a href="https://github.com/apache/hertzbeat/issues?q=author%3Alynx009" title="Bug reports">🐛</a> <a href="#design-lynx009" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lynx009"><img src="https://avatars.githubusercontent.com/u/105542329?v=4?s=100" width="100px;" alt="lynx009"/><br /><sub><b>lynx009</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=lynx009" title="Documentation">📖</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/littlezhongzer"><img src="https://avatars.githubusercontent.com/u/33685289?v=4?s=100" width="100px;" alt="littlezhongzer"/><br /><sub><b>littlezhongzer</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=littlezhongzer" title="Code">💻</a></td>
@@ -539,8 +539,18 @@ Thanks these wonderful people, welcome to join us:
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/chingjustwe"><img src="https://avatars.githubusercontent.com/u/13643747?v=4?s=100" width="100px;" alt="Rocky, Chi"/><br /><sub><b>Rocky, Chi</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=chingjustwe" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rowankid"><img src="https://avatars.githubusercontent.com/u/18652781?v=4?s=100" width="100px;" alt="Wenqi Luo"/><br /><sub><b>Wenqi Luo</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/issues?q=author%3Arowankid" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tuzuy"><img src="https://avatars.githubusercontent.com/u/95274591?v=4?s=100" width="100px;" alt="tuzuy"/><br /><sub><b>tuzuy</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=tuzuy" title="Code">💻</a> <a href="#design-tuzuy" title="Design">🎨</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tuzuy"><img src="https://avatars.githubusercontent.com/u/95274591?v=4?s=100" width="100px;" alt="tuzuy"/><br /><sub><b>tuzuy</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=tuzuy" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/carlpinto25"><img src="https://avatars.githubusercontent.com/u/117299909?v=4?s=100" width="100px;" alt="carl pinto"/><br /><sub><b>carl pinto</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=carlpinto25" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://cxhello.top/"><img src="https://avatars.githubusercontent.com/u/49056040?v=4?s=100" width="100px;" alt="cxhello"/><br /><sub><b>cxhello</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=cxhello" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jl15988"><img src="https://avatars.githubusercontent.com/u/70638770?v=4?s=100" width="100px;" alt="会功夫的李白"/><br /><sub><b>会功夫的李白</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=jl15988" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://blog.aytop.cloud/"><img src="https://avatars.githubusercontent.com/u/37127008?v=4?s=100" width="100px;" alt="Albert.Yang"/><br /><sub><b>Albert.Yang</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=AlbertYang0801" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://blog.tokenlen.top/"><img src="https://avatars.githubusercontent.com/u/150590575?v=4?s=100" width="100px;" alt="zhou yong kang"/><br /><sub><b>zhou yong kang</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=mengnankkkk" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/warrobe"><img src="https://avatars.githubusercontent.com/u/89446159?v=4?s=100" width="100px;" alt="warrobe"/><br /><sub><b>warrobe</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=warrobe" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Jetiaime"><img src="https://avatars.githubusercontent.com/u/93769000?v=4?s=100" width="100px;" alt="TeAmo"/><br /><sub><b>TeAmo</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=Jetiaime" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/pentium100"><img src="https://avatars.githubusercontent.com/u/27917?v=4?s=100" width="100px;" alt="pentium100"/><br /><sub><b>pentium100</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=pentium100" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/dedyks"><img src="https://avatars.githubusercontent.com/u/23741665?v=4?s=100" width="100px;" alt="Dedy Kurniawan Santoso"/><br /><sub><b>Dedy Kurniawan Santoso</b></sub></a><br /><a href="https://github.com/apache/hertzbeat/commits?author=dedyks" title="Code">💻</a></td>
</tr>
</tbody>
</table>
@@ -23,7 +23,7 @@
<artifactId>hertzbeat</artifactId>
<version>2.0-SNAPSHOT</version>
</parent>
<artifactId>hertzbeat-ai-agent</artifactId>
<artifactId>hertzbeat-ai</artifactId>
<version>${hertzbeat.version}</version>
<properties>
<spring-ai.version>1.0.3</spring-ai.version>
@@ -15,9 +15,9 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.adapters;
package org.apache.hertzbeat.ai.adapters;
import org.apache.hertzbeat.ai.agent.pojo.dto.Hierarchy;
import org.apache.hertzbeat.ai.pojo.dto.Hierarchy;
import org.apache.hertzbeat.common.entity.alerter.AlertDefine;
import org.springframework.data.domain.Page;
@@ -78,4 +78,4 @@ public interface AlertDefineServiceAdapter {
*/
List<Hierarchy> getAppHierarchy(String app, String lang);
}
}
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.adapters;
package org.apache.hertzbeat.ai.adapters;
import org.apache.hertzbeat.alert.dto.AlertSummary;
import org.apache.hertzbeat.common.entity.alerter.GroupAlert;
@@ -57,4 +57,4 @@ public interface AlertServiceAdapter {
* @return Alert summary information
*/
AlertSummary getAlertsSummary();
}
}
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.adapters;
package org.apache.hertzbeat.ai.adapters;
import org.apache.hertzbeat.common.entity.dto.MetricsData;
import org.apache.hertzbeat.common.entity.dto.MetricsHistoryData;
@@ -52,4 +52,4 @@ public interface MetricsServiceAdapter {
* @return Historical metrics data
*/
MetricsHistoryData getMetricHistoryData(Long monitorId, String app, String metrics, String metric, String label, String history, Boolean interval);
}
}
@@ -16,7 +16,7 @@
*/
package org.apache.hertzbeat.ai.agent.adapters;
package org.apache.hertzbeat.ai.adapters;
import org.springframework.data.domain.Page;
import org.apache.hertzbeat.common.entity.manager.Monitor;
@@ -15,14 +15,14 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.adapters.impl;
package org.apache.hertzbeat.ai.adapters.impl;
import com.usthe.sureness.subject.SubjectSum;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.ai.agent.adapters.AlertDefineServiceAdapter;
import org.apache.hertzbeat.ai.agent.config.McpContextHolder;
import org.apache.hertzbeat.ai.agent.pojo.dto.Hierarchy;
import org.apache.hertzbeat.ai.agent.utils.UtilityClass;
import org.apache.hertzbeat.ai.adapters.AlertDefineServiceAdapter;
import org.apache.hertzbeat.ai.config.McpContextHolder;
import org.apache.hertzbeat.ai.pojo.dto.Hierarchy;
import org.apache.hertzbeat.ai.utils.UtilityClass;
import org.apache.hertzbeat.common.entity.alerter.AlertDefine;
import org.apache.hertzbeat.common.support.SpringContextHolder;
import org.springframework.data.domain.Page;
@@ -254,4 +254,4 @@ public class AlertDefineServiceAdapterImpl implements AlertDefineServiceAdapter
}
}
}
}
@@ -15,12 +15,12 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.adapters.impl;
package org.apache.hertzbeat.ai.adapters.impl;
import com.usthe.sureness.subject.SubjectSum;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.ai.agent.adapters.AlertServiceAdapter;
import org.apache.hertzbeat.ai.agent.config.McpContextHolder;
import org.apache.hertzbeat.ai.adapters.AlertServiceAdapter;
import org.apache.hertzbeat.ai.config.McpContextHolder;
import org.apache.hertzbeat.alert.dto.AlertSummary;
import org.apache.hertzbeat.common.entity.alerter.GroupAlert;
import org.apache.hertzbeat.common.entity.alerter.SingleAlert;
@@ -138,4 +138,4 @@ public class AlertServiceAdapterImpl implements AlertServiceAdapter {
throw new RuntimeException("Failed to invoke getAlertsSummary via adapter: " + e.getMessage(), e);
}
}
}
}
@@ -15,12 +15,12 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.adapters.impl;
package org.apache.hertzbeat.ai.adapters.impl;
import com.usthe.sureness.subject.SubjectSum;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.ai.agent.adapters.MetricsServiceAdapter;
import org.apache.hertzbeat.ai.agent.config.McpContextHolder;
import org.apache.hertzbeat.ai.adapters.MetricsServiceAdapter;
import org.apache.hertzbeat.ai.config.McpContextHolder;
import org.apache.hertzbeat.common.entity.dto.MetricsData;
import org.apache.hertzbeat.common.entity.dto.MetricsHistoryData;
import org.apache.hertzbeat.common.support.SpringContextHolder;
@@ -133,4 +133,4 @@ public class MetricsServiceAdapterImpl implements MetricsServiceAdapter {
throw new RuntimeException("Failed to invoke getMetricHistoryData via adapter: " + e.getMessage(), e);
}
}
}
}
@@ -16,12 +16,12 @@
*/
package org.apache.hertzbeat.ai.agent.adapters.impl;
package org.apache.hertzbeat.ai.adapters.impl;
import com.usthe.sureness.subject.SubjectSum;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.ai.agent.adapters.MonitorServiceAdapter;
import org.apache.hertzbeat.ai.agent.config.McpContextHolder;
import org.apache.hertzbeat.ai.adapters.MonitorServiceAdapter;
import org.apache.hertzbeat.ai.config.McpContextHolder;
import org.springframework.data.domain.Page;
import org.apache.hertzbeat.common.entity.manager.Monitor;
import org.apache.hertzbeat.common.entity.manager.Param;
@@ -211,4 +211,4 @@ public class MonitorServiceAdapterImpl implements MonitorServiceAdapter {
throw new RuntimeException("Failed to invoke getAppParamDefines via adapter: " + e.getMessage(), e);
}
}
}
}
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.config;
package org.apache.hertzbeat.ai.config;
import com.fasterxml.jackson.core.type.TypeReference;
@@ -15,10 +15,10 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.config;
package org.apache.hertzbeat.ai.config;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.ai.agent.pojo.dto.ModelProviderConfig;
import org.apache.hertzbeat.ai.pojo.dto.ModelProviderConfig;
import org.apache.hertzbeat.base.dao.GeneralConfigDao;
import org.apache.hertzbeat.common.entity.manager.GeneralConfig;
import org.apache.hertzbeat.common.util.JsonUtil;
@@ -16,11 +16,11 @@
*/
package org.apache.hertzbeat.ai.agent.config;
package org.apache.hertzbeat.ai.config;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.common.support.event.AiProviderConfigChangeEvent;
import org.apache.hertzbeat.ai.agent.pojo.dto.ModelProviderConfig;
import org.apache.hertzbeat.ai.pojo.dto.ModelProviderConfig;
import org.apache.hertzbeat.base.dao.GeneralConfigDao;
import org.apache.hertzbeat.common.entity.manager.GeneralConfig;
import org.apache.hertzbeat.common.util.JsonUtil;
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.config;
package org.apache.hertzbeat.ai.config;
import com.usthe.sureness.subject.SubjectSum;
import org.springframework.core.NamedInheritableThreadLocal;
@@ -16,7 +16,7 @@
*/
package org.apache.hertzbeat.ai.agent.config;
package org.apache.hertzbeat.ai.config;
import org.springframework.stereotype.Component;
@@ -179,4 +179,4 @@ public class PromptProvider {
Keep responses focused on monitoring topics and HertzBeat's comprehensive capabilities.
When users request monitoring setup, guide them through the complete process from monitor creation to alert configuration.
""";
}
}
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.controller;
package org.apache.hertzbeat.ai.controller;
import com.usthe.sureness.subject.SubjectSum;
import com.usthe.sureness.util.SurenessContextHolder;
@@ -23,11 +23,11 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.ai.agent.config.McpContextHolder;
import org.apache.hertzbeat.ai.agent.pojo.dto.ChatRequestContext;
import org.apache.hertzbeat.ai.agent.pojo.dto.ChatResponseDto;
import org.apache.hertzbeat.ai.agent.pojo.dto.ConversationDto;
import org.apache.hertzbeat.ai.agent.service.ConversationService;
import org.apache.hertzbeat.ai.config.McpContextHolder;
import org.apache.hertzbeat.ai.pojo.dto.ChatRequestContext;
import org.apache.hertzbeat.ai.pojo.dto.ChatResponseDto;
import org.apache.hertzbeat.ai.pojo.dto.ConversationDto;
import org.apache.hertzbeat.ai.service.ConversationService;
import org.apache.hertzbeat.common.entity.dto.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
@@ -194,4 +194,4 @@ public class ChatController {
}
}
}
}
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.entity;
package org.apache.hertzbeat.ai.entity;
import static io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_ONLY;
import static io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_WRITE;
@@ -77,4 +77,4 @@ public class OpenAiConfig {
@Schema(title = "Record the latest modification time (timestamp in milliseconds)", accessMode = READ_ONLY)
@LastModifiedDate
private LocalDateTime gmtUpdate;
}
}
@@ -16,7 +16,7 @@
*/
package org.apache.hertzbeat.ai.agent.pojo.dto;
package org.apache.hertzbeat.ai.pojo.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -46,4 +46,4 @@ public class ChatRequestContext {
* Conversation history messages for context
*/
private List<MessageDto> conversationHistory;
}
}
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.pojo.dto;
package org.apache.hertzbeat.ai.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
@@ -44,4 +44,4 @@ public class ChatResponseDto {
@Schema(description = "Assistant message ID", example = "msg-assistant-123")
private String assistantMessageId;
}
}
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.pojo.dto;
package org.apache.hertzbeat.ai.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
@@ -50,4 +50,4 @@ public class ConversationDto {
@Schema(description = "Message count")
private Integer messageCount;
}
}
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.pojo.dto;
package org.apache.hertzbeat.ai.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.pojo.dto;
package org.apache.hertzbeat.ai.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
@@ -49,4 +49,4 @@ public class MessageDto {
@Schema(description = "Message timestamp")
private LocalDateTime timestamp;
}
}
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.pojo.dto;
package org.apache.hertzbeat.ai.pojo.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.service;
package org.apache.hertzbeat.ai.service;
/**
* Ai Configuration Service
@@ -16,9 +16,9 @@
*/
package org.apache.hertzbeat.ai.agent.service;
package org.apache.hertzbeat.ai.service;
import org.apache.hertzbeat.ai.agent.pojo.dto.ChatRequestContext;
import org.apache.hertzbeat.ai.pojo.dto.ChatRequestContext;
import reactor.core.publisher.Flux;
/**
@@ -16,10 +16,10 @@
*/
package org.apache.hertzbeat.ai.agent.service;
package org.apache.hertzbeat.ai.service;
import org.apache.hertzbeat.ai.agent.pojo.dto.ChatResponseDto;
import org.apache.hertzbeat.ai.agent.pojo.dto.ConversationDto;
import org.apache.hertzbeat.ai.pojo.dto.ChatResponseDto;
import org.apache.hertzbeat.ai.pojo.dto.ConversationDto;
import org.springframework.http.codec.ServerSentEvent;
import reactor.core.publisher.Flux;
@@ -77,4 +77,4 @@ public interface ConversationService {
* @return true if conversation exists, false otherwise
*/
boolean conversationExists(String conversationId);
}
}
@@ -16,10 +16,10 @@
*/
package org.apache.hertzbeat.ai.agent.service;
package org.apache.hertzbeat.ai.service;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.hertzbeat.ai.agent.config.CustomSseServerTransport;
import org.apache.hertzbeat.ai.config.CustomSseServerTransport;
import org.springframework.ai.mcp.server.autoconfigure.McpServerProperties;
import org.springframework.ai.tool.ToolCallbackProvider;
import org.springframework.web.servlet.function.RouterFunction;
@@ -15,10 +15,10 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.service.impl;
package org.apache.hertzbeat.ai.service.impl;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.ai.agent.service.AiConfigService;
import org.apache.hertzbeat.ai.service.AiConfigService;
import org.apache.hertzbeat.base.dao.GeneralConfigDao;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
@@ -16,18 +16,18 @@
*/
package org.apache.hertzbeat.ai.agent.service.impl;
package org.apache.hertzbeat.ai.service.impl;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.ai.agent.config.PromptProvider;
import org.apache.hertzbeat.ai.agent.pojo.dto.MessageDto;
import org.apache.hertzbeat.ai.agent.pojo.dto.ModelProviderConfig;
import org.apache.hertzbeat.ai.agent.service.ChatClientProviderService;
import org.apache.hertzbeat.ai.config.PromptProvider;
import org.apache.hertzbeat.ai.pojo.dto.MessageDto;
import org.apache.hertzbeat.ai.pojo.dto.ModelProviderConfig;
import org.apache.hertzbeat.ai.service.ChatClientProviderService;
import org.apache.hertzbeat.base.dao.GeneralConfigDao;
import org.apache.hertzbeat.common.entity.manager.GeneralConfig;
import org.apache.hertzbeat.common.util.JsonUtil;
import org.springframework.stereotype.Service;
import org.apache.hertzbeat.ai.agent.pojo.dto.ChatRequestContext;
import org.apache.hertzbeat.ai.pojo.dto.ChatRequestContext;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.messages.AssistantMessage;
import org.springframework.ai.chat.messages.Message;
@@ -15,15 +15,15 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.service.impl;
package org.apache.hertzbeat.ai.service.impl;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.ai.agent.pojo.dto.ChatRequestContext;
import org.apache.hertzbeat.ai.agent.pojo.dto.ChatResponseDto;
import org.apache.hertzbeat.ai.agent.pojo.dto.ConversationDto;
import org.apache.hertzbeat.ai.agent.pojo.dto.MessageDto;
import org.apache.hertzbeat.ai.agent.service.ChatClientProviderService;
import org.apache.hertzbeat.ai.agent.service.ConversationService;
import org.apache.hertzbeat.ai.pojo.dto.ChatRequestContext;
import org.apache.hertzbeat.ai.pojo.dto.ChatResponseDto;
import org.apache.hertzbeat.ai.pojo.dto.ConversationDto;
import org.apache.hertzbeat.ai.pojo.dto.MessageDto;
import org.apache.hertzbeat.ai.service.ChatClientProviderService;
import org.apache.hertzbeat.ai.service.ConversationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.codec.ServerSentEvent;
import org.springframework.stereotype.Service;
@@ -16,14 +16,14 @@
*/
package org.apache.hertzbeat.ai.agent.service.impl;
package org.apache.hertzbeat.ai.service.impl;
import org.apache.hertzbeat.ai.agent.config.CustomSseServerTransport;
import org.apache.hertzbeat.ai.agent.service.McpServerService;
import org.apache.hertzbeat.ai.agent.tools.AlertDefineTools;
import org.apache.hertzbeat.ai.agent.tools.AlertTools;
import org.apache.hertzbeat.ai.agent.tools.MetricsTools;
import org.apache.hertzbeat.ai.agent.tools.MonitorTools;
import org.apache.hertzbeat.ai.config.CustomSseServerTransport;
import org.apache.hertzbeat.ai.service.McpServerService;
import org.apache.hertzbeat.ai.tools.AlertDefineTools;
import org.apache.hertzbeat.ai.tools.AlertTools;
import org.apache.hertzbeat.ai.tools.MetricsTools;
import org.apache.hertzbeat.ai.tools.MonitorTools;
import org.springframework.ai.mcp.server.autoconfigure.McpServerProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.tools;
package org.apache.hertzbeat.ai.tools;
/**
* Tools for alert definition and threshold configuration operations
@@ -88,4 +88,4 @@ public interface AlertDefineTools {
* @return Result message indicating success or failure
*/
String bindMonitorsToAlertRule(Long ruleId, String monitorIds);
}
}
@@ -16,7 +16,7 @@
*/
package org.apache.hertzbeat.ai.agent.tools;
package org.apache.hertzbeat.ai.tools;
/**
* Tools for alert operations and alarm data queries
@@ -16,7 +16,7 @@
*/
package org.apache.hertzbeat.ai.agent.tools;
package org.apache.hertzbeat.ai.tools;
/**
* Tools for metrics data operations and queries
@@ -16,7 +16,7 @@
*/
package org.apache.hertzbeat.ai.agent.tools;
package org.apache.hertzbeat.ai.tools;
import java.util.List;
@@ -94,4 +94,4 @@ public interface MonitorTools {
* @return Formatted string with parameter definitions including field names, types, and requirements
*/
String getMonitorAdditionalParams(String app);
}
}
@@ -15,18 +15,18 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.tools.impl;
package org.apache.hertzbeat.ai.tools.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.usthe.sureness.subject.SubjectSum;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.ai.agent.adapters.AlertDefineServiceAdapter;
import org.apache.hertzbeat.ai.agent.pojo.dto.Hierarchy;
import org.apache.hertzbeat.ai.agent.config.McpContextHolder;
import org.apache.hertzbeat.ai.agent.tools.AlertDefineTools;
import org.apache.hertzbeat.ai.agent.utils.UtilityClass;
import org.apache.hertzbeat.ai.adapters.AlertDefineServiceAdapter;
import org.apache.hertzbeat.ai.pojo.dto.Hierarchy;
import org.apache.hertzbeat.ai.config.McpContextHolder;
import org.apache.hertzbeat.ai.tools.AlertDefineTools;
import org.apache.hertzbeat.ai.utils.UtilityClass;
import org.apache.hertzbeat.common.entity.alerter.AlertDefine;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
@@ -662,4 +662,4 @@ public class AlertDefineToolsImpl implements AlertDefineTools {
}
}
}
}
@@ -16,14 +16,14 @@
*/
package org.apache.hertzbeat.ai.agent.tools.impl;
package org.apache.hertzbeat.ai.tools.impl;
import com.usthe.sureness.subject.SubjectSum;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.ai.agent.adapters.AlertServiceAdapter;
import org.apache.hertzbeat.ai.agent.config.McpContextHolder;
import org.apache.hertzbeat.ai.agent.tools.AlertTools;
import org.apache.hertzbeat.ai.agent.utils.UtilityClass;
import org.apache.hertzbeat.ai.adapters.AlertServiceAdapter;
import org.apache.hertzbeat.ai.config.McpContextHolder;
import org.apache.hertzbeat.ai.tools.AlertTools;
import org.apache.hertzbeat.ai.utils.UtilityClass;
import org.apache.hertzbeat.alert.dto.AlertSummary;
import org.apache.hertzbeat.common.entity.alerter.GroupAlert;
import org.apache.hertzbeat.common.entity.alerter.SingleAlert;
@@ -16,14 +16,14 @@
*/
package org.apache.hertzbeat.ai.agent.tools.impl;
package org.apache.hertzbeat.ai.tools.impl;
import com.usthe.sureness.subject.SubjectSum;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.ai.agent.adapters.MetricsServiceAdapter;
import org.apache.hertzbeat.ai.agent.adapters.MonitorServiceAdapter;
import org.apache.hertzbeat.ai.agent.config.McpContextHolder;
import org.apache.hertzbeat.ai.agent.tools.MetricsTools;
import org.apache.hertzbeat.ai.adapters.MetricsServiceAdapter;
import org.apache.hertzbeat.ai.adapters.MonitorServiceAdapter;
import org.apache.hertzbeat.ai.config.McpContextHolder;
import org.apache.hertzbeat.ai.tools.MetricsTools;
import org.apache.hertzbeat.common.entity.dto.Field;
import org.apache.hertzbeat.common.entity.dto.MetricsData;
import org.apache.hertzbeat.common.entity.dto.MetricsHistoryData;
@@ -260,4 +260,4 @@ public class MetricsToolsImpl implements MetricsTools {
}
}
}
}
@@ -15,17 +15,17 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.tools.impl;
package org.apache.hertzbeat.ai.tools.impl;
import com.usthe.sureness.subject.SubjectSum;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.ai.agent.adapters.MonitorServiceAdapter;
import org.apache.hertzbeat.ai.agent.config.McpContextHolder;
import org.apache.hertzbeat.ai.agent.utils.UtilityClass;
import org.apache.hertzbeat.ai.adapters.MonitorServiceAdapter;
import org.apache.hertzbeat.ai.config.McpContextHolder;
import org.apache.hertzbeat.ai.utils.UtilityClass;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import org.apache.hertzbeat.ai.agent.tools.MonitorTools;
import org.apache.hertzbeat.ai.tools.MonitorTools;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.hertzbeat.common.entity.manager.Monitor;
@@ -15,14 +15,14 @@
* limitations under the License.
*/
package org.apache.hertzbeat.ai.agent.utils;
package org.apache.hertzbeat.ai.utils;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import lombok.extern.slf4j.Slf4j;
import org.apache.hertzbeat.ai.agent.pojo.dto.Hierarchy;
import org.apache.hertzbeat.ai.pojo.dto.Hierarchy;
import java.lang.reflect.Method;
import java.time.Instant;
@@ -105,19 +105,19 @@ class AlertDefineServiceTest {
@Test
void addAlertDefine() {
assertDoesNotThrow(() -> alertDefineService.addAlertDefine(alertDefine));
assertDoesNotThrow(() -> this.alertDefineService.addAlertDefine(alertDefine));
when(alertDefineDao.saveAndFlush(alertDefine)).thenThrow(new RuntimeException());
assertThrows(RuntimeException.class, () -> alertDefineService.addAlertDefine(alertDefine));
assertThrows(RuntimeException.class, () -> this.alertDefineService.addAlertDefine(alertDefine));
}
@Test
void modifyAlertDefine() {
AlertDefine alertDefine = AlertDefine.builder().id(1L).build();
when(alertDefineDao.saveAndFlush(alertDefine)).thenReturn(alertDefine);
assertDoesNotThrow(() -> alertDefineService.modifyAlertDefine(alertDefine));
assertDoesNotThrow(() -> this.alertDefineService.modifyAlertDefine(alertDefine));
reset();
when(alertDefineDao.saveAndFlush(alertDefine)).thenThrow(new RuntimeException());
assertThrows(RuntimeException.class, () -> alertDefineService.modifyAlertDefine(alertDefine));
assertThrows(RuntimeException.class, () -> this.alertDefineService.modifyAlertDefine(alertDefine));
}
@Test
@@ -42,6 +42,8 @@ public interface ConfigConstants {
*/
interface FunctionModuleConstants {
String MANAGER = "manager";
String ALERT = "alert";
String ALERTER = "alerter";
+6 -57
View File
@@ -40,6 +40,12 @@
<dependencies>
<!-- HertzBeat modules -->
<dependency>
<groupId>org.apache.hertzbeat</groupId>
<artifactId>hertzbeat-startup</artifactId>
<version>${hertzbeat.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.hertzbeat</groupId>
<artifactId>hertzbeat-manager</artifactId>
@@ -100,61 +106,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Copy manager resources to test classpath -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven.dependency.plugin.version}</version>
<executions>
<execution>
<id>unpack-manager-resources</id>
<phase>generate-test-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.hertzbeat</groupId>
<artifactId>hertzbeat-manager</artifactId>
<version>${hertzbeat.version}</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.testOutputDirectory}</outputDirectory>
<includes>
define/**,
db/**,
templates/**,
grafana/**,
*.yml,
*.xml,
*.txt
</includes>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!-- Ensure test resources are processed -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven.resources.plugin.version}</version>
<executions>
<execution>
<id>copy-test-resources</id>
<phase>generate-test-resources</phase>
<goals>
<goal>testResources</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@@ -58,7 +58,7 @@ import static org.mockito.Mockito.doAnswer;
/**
* E2E tests for periodic log alert processing.
*/
@SpringBootTest(classes = org.apache.hertzbeat.manager.Manager.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(classes = org.apache.hertzbeat.startup.HertzBeatApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Slf4j
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class LogPeriodicAlertE2eTest {
@@ -55,7 +55,7 @@ import static org.mockito.Mockito.doAnswer;
/**
* E2E tests for real-time log alert processing.
*/
@SpringBootTest(classes = org.apache.hertzbeat.manager.Manager.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(classes = org.apache.hertzbeat.startup.HertzBeatApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Slf4j
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class LogRealTimeAlertE2eTest {
@@ -44,7 +44,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
/**
* E2E tests for log ingestion.
*/
@SpringBootTest(classes = org.apache.hertzbeat.manager.Manager.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(classes = org.apache.hertzbeat.startup.HertzBeatApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Slf4j
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class LogIngestionE2eTest {
@@ -47,7 +47,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
/**
* E2E tests for GreptimeDB log storage.
*/
@SpringBootTest(classes = org.apache.hertzbeat.manager.Manager.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(classes = org.apache.hertzbeat.startup.HertzBeatApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Slf4j
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class GreptimeLogStorageE2eTest {
+1 -1
View File
@@ -70,7 +70,7 @@
</dependency>
<dependency>
<groupId>org.apache.hertzbeat</groupId>
<artifactId>hertzbeat-manager</artifactId>
<artifactId>hertzbeat-startup</artifactId>
<version>${hertzbeat.version}</version>
<scope>test</scope>
</dependency>
+2 -218
View File
@@ -27,10 +27,7 @@
<name>${project.artifactId}</name>
<packaging>jar</packaging>
<properties>
<maven.install.skip>true</maven.install.skip>
</properties>
<dependencies>
<!-- common -->
<dependency>
@@ -217,7 +214,7 @@
</dependency>
<dependency>
<groupId>org.apache.hertzbeat</groupId>
<artifactId>hertzbeat-ai-agent</artifactId>
<artifactId>hertzbeat-ai</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
@@ -226,217 +223,4 @@
</dependency>
</dependencies>
<build>
<finalName>apache-hertzbeat-${hzb.version}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>*.yml</include>
<include>*.properties</include>
<include>*.xml</include>
<include>banner.txt</include>
<include>define/**</include>
<include>db/**</include>
<include>templates/**</include>
<include>**/*.html</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration>
<classesDirectory>target/classes/</classesDirectory>
<archive>
<!--Exclude maven descriptors from generated JAR-->
<addMavenDescriptor>false</addMavenDescriptor>
<manifest>
<!--Main class of the project-->
<mainClass>org.apache.hertzbeat.manager.Manager</mainClass>
<useUniqueVersions>false</useUniqueVersions>
<!--Add third-party JARs to the classpath using maven-dependency-plugin-->
<addClasspath>true</addClasspath>
<!--Location of external dependency JARs-->
<classpathPrefix>lib/</classpathPrefix>
</manifest>
<manifestEntries>
<Class-Path>. config</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<!--Critical plugin, assembly plugin provided by maven, should be placed last-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<executions>
<execution>
<id>make-zip</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<outputDirectory>../dist</outputDirectory>
<descriptors>
<descriptor>../script/assembly/server/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>make-docker-zip</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<outputDirectory>../dist</outputDirectory>
<descriptors>
<descriptor>../script/assembly/server/assembly-docker.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>make-docker-compose-script</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<outputDirectory>../dist</outputDirectory>
<descriptors>
<descriptor>../script/assembly/server/assembly-docker-compose.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>runtime</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<executions>
<execution>
<id>make-macos-arm64</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-macos-arm64.xml</descriptor>
</descriptors>
<outputDirectory>../dist</outputDirectory>
</configuration>
</execution>
<execution>
<id>make-macos-amd64</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-macos-amd64.xml</descriptor>
</descriptors>
<outputDirectory>../dist</outputDirectory>
</configuration>
</execution>
<execution>
<id>make-linux-arm64</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-linux-arm64.xml</descriptor>
</descriptors>
<outputDirectory>../dist</outputDirectory>
</configuration>
</execution>
<execution>
<id>make-linux-amd64</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-linux-amd64.xml</descriptor>
</descriptors>
<outputDirectory>../dist</outputDirectory>
</configuration>
</execution>
<execution>
<id>make-windows-64</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-windows-64.xml</descriptor>
</descriptors>
<outputDirectory>../dist</outputDirectory>
</configuration>
</execution>
<execution>
<id>make-docker-compose-script</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-docker-compose.xml</descriptor>
</descriptors>
<outputDirectory>../dist</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
@@ -0,0 +1,34 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hertzbeat.manager.config;
import org.apache.hertzbeat.common.constants.ConfigConstants;
import org.apache.hertzbeat.common.constants.SignConstants;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
/**
* Manager auto configuration.
*/
@AutoConfiguration
@ComponentScan(basePackages = ConfigConstants.PkgConstant.PKG
+ SignConstants.DOT
+ ConfigConstants.FunctionModuleConstants.MANAGER)
public class ManagerAutoConfiguration {
}
@@ -20,7 +20,7 @@ package org.apache.hertzbeat.manager.service.impl;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.lang.reflect.Type;
import org.apache.hertzbeat.ai.agent.pojo.dto.ModelProviderConfig;
import org.apache.hertzbeat.ai.pojo.dto.ModelProviderConfig;
import org.apache.hertzbeat.base.dao.GeneralConfigDao;
import org.apache.hertzbeat.common.constants.GeneralConfigTypeEnum;
import org.apache.hertzbeat.common.support.event.AiProviderConfigChangeEvent;
@@ -0,0 +1,16 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
org.apache.hertzbeat.manager.config.ManagerAutoConfiguration
@@ -1,123 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hertzbeat.manager.service;
import org.apache.hertzbeat.alert.dao.AlertDefineDao;
import org.apache.hertzbeat.alert.service.AlertDefineService;
import org.apache.hertzbeat.common.entity.alerter.AlertDefine;
import org.apache.hertzbeat.manager.AbstractSpringIntegrationTest;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
/**
* Test case for {@link AlertDefineService}
*/
public class AlertDefineServiceIntegrationTest extends AbstractSpringIntegrationTest {
@Autowired
private AlertDefineService alertDefineService;
@Autowired
private AlertDefineDao alertDefineDao;
private List<Long> createdIds = new ArrayList<>();
@BeforeEach
void setUp() {
createdIds.clear();
}
@AfterEach
void tearDown() {
for (Long id : createdIds) {
if (alertDefineDao.existsById(id)) {
alertDefineDao.deleteById(id);
}
}
}
@Test
void testAddAlertDefine() {
AlertDefine alertDefine = AlertDefine.builder()
.name("test-cpu-alert")
.expr("usage > 80")
.times(3)
.type("periodic")
.enable(true)
.period(10)
.template("CPU usage is excessively high: ${usage}%")
.creator("integration-test")
.modifier("integration-test")
.gmtCreate(LocalDateTime.now())
.gmtUpdate(LocalDateTime.now())
.build();
assertNull(alertDefine.getId());
assertDoesNotThrow(() -> alertDefineService.addAlertDefine(alertDefine));
assertNotNull(alertDefine.getId());
assertTrue(alertDefine.getId() > 0);
createdIds.add(alertDefine.getId());
AlertDefine savedAlertDefine = alertDefineDao.findById(alertDefine.getId()).orElse(null);
assertNotNull(savedAlertDefine);
assertEquals("usage > 80", savedAlertDefine.getExpr());
assertEquals("integration-test", savedAlertDefine.getCreator());
}
@Test
void testModifyAlertDefine() {
AlertDefine alertDefine = AlertDefine.builder()
.name("test-cpu-alert")
.expr("usage > 80")
.times(3)
.type("periodic")
.enable(true)
.period(10)
.template("CPU usage is excessively high: ${usage}%")
.creator("integration-test")
.modifier("integration-test")
.gmtCreate(LocalDateTime.now())
.gmtUpdate(LocalDateTime.now())
.build();
assertNull(alertDefine.getId());
assertDoesNotThrow(() -> alertDefineService.modifyAlertDefine(alertDefine));
assertNotNull(alertDefine.getId());
assertTrue(alertDefine.getId() > 0);
createdIds.add(alertDefine.getId());
AlertDefine savedAlertDefine = alertDefineDao.findById(alertDefine.getId()).orElse(null);
assertNotNull(savedAlertDefine);
assertEquals("usage > 80", savedAlertDefine.getExpr());
assertEquals("integration-test", savedAlertDefine.getCreator());
}
}
@@ -0,0 +1,136 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
## -- sureness.yml account source -- ##
# config the resource restful api that need auth protection, base rbac
# rule: api===method===role
# eg: /api/v1/source1===get===[admin] means /api/v2/host===post support role[admin] access.
# eg: /api/v1/source2===get===[] means /api/v1/source2===get can not access by any role.
resourceRole:
- /api/account/auth/refresh===post===[admin,user,guest]
- /api/apps/**===get===[admin,user,guest]
- /api/monitor/**===get===[admin,user,guest]
- /api/monitor/**===post===[admin,user]
- /api/monitor/**===put===[admin,user]
- /api/monitor/**===delete==[admin]
- /api/monitors/**===get===[admin,user,guest]
- /api/monitors/**===post===[admin,user]
- /api/monitors/**===put===[admin,user]
- /api/monitors/**===delete===[admin]
- /api/alert/**===get===[admin,user,guest]
- /api/alert/**===post===[admin,user]
- /api/alert/**===put===[admin,user]
- /api/alert/**===delete===[admin]
- /api/alerts/**===get===[admin,user,guest]
- /api/alerts/**===post===[admin,user]
- /api/alerts/**===put===[admin,user]
- /api/alerts/**===delete===[admin]
- /api/notice/**===get===[admin,user,guest]
- /api/notice/**===post===[admin,user]
- /api/notice/**===put===[admin,user]
- /api/notice/**===delete===[admin]
- /api/tag/**===get===[admin,user,guest]
- /api/tag/**===post===[admin,user]
- /api/tag/**===put===[admin,user]
- /api/tag/**===delete===[admin]
- /api/summary/**===get===[admin,user,guest]
- /api/summary/**===post===[admin,user]
- /api/summary/**===put===[admin,user]
- /api/summary/**===delete===[admin]
- /api/collector/**===get===[admin,user,guest]
- /api/collector/**===post===[admin,user]
- /api/collector/**===put===[admin,user]
- /api/collector/**===delete===[admin]
- /api/status/page/**===get===[admin,user,guest]
- /api/status/page/**===post===[admin,user]
- /api/status/page/**===put===[admin,user]
- /api/status/page/**===delete===[admin]
- /api/grafana/**===get===[admin,user,guest]
- /api/grafana/**===post===[admin,user]
- /api/grafana/**===put===[admin,user]
- /api/grafana/**===delete===[admin]
- /api/bulletin/**===get===[admin,user,guest]
- /api/bulletin/**===post===[admin,user]
- /api/bulletin/**===put===[admin,user]
- /api/bulletin/**===delete===[admin]
- /api/sse/**===get===[admin,user]
- /api/sse/**===post===[admin,user]
- /api/chat/**===get===[admin,user]
- /api/chat/**===post===[admin,user]
- /api/logs/ingest/**===post===[admin,user]
# config the resource restful api that need bypass auth protection
# rule: api===method
# eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth.
excludedResource:
- /api/alert/sse/**===*
- /api/logs/sse/**===*
- /api/account/auth/**===*
- /api/i18n/**===get
- /api/apps/hierarchy===get
- /api/push/**===*
- /api/status/page/public/**===*
- /api/manager/sse/**===*
# web ui resource
- /===get
- /assets/**===get
- /dashboard/**===get
- /monitors/**===get
- /alert/**===get
- /account/**===get
- /setting/**===get
- /passport/**===get
- /status/**===get
- /**/*.html===get
- /**/*.js===get
- /**/*.css===get
- /**/*.ico===get
- /**/*.ttf===get
- /**/*.png===get
- /**/*.gif===get
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui resource
- /swagger-resources/**===get
- /v2/api-docs===get
- /v3/api-docs===get
# h2 database
- /h2-console/**===*
# account info config
# eg: admin has role [admin,user], password is hertzbeat
# eg: tom has role [user], password is hertzbeat
# eg: lili has role [guest], plain password is lili, salt is 123, salted password is 1A676730B0C7F54654B0E09184448289
account:
- appId: admin
credential: hertzbeat
role: [admin]
- appId: tom
credential: hertzbeat
role: [user]
- appId: guest
credential: hertzbeat
role: [guest]
- appId: lili
# credential = MD5(password + salt)
# plain password: hertzbeat
# attention: digest authentication does not support salted encrypted password accounts
credential: 94C6B34E7A199A9F9D4E1F208093B489
salt: 123
role: [user]
+135
View File
@@ -0,0 +1,135 @@
# HertzBeat Startup Module
## 概述
`hertzbeat-startup` 模块是为了实现 HertzBeat 项目的模块化重构而创建的启动模块。该模块专门负责应用的启动和初始化任务,将原本由 `hertzbeat-manager` 模块承担的启动职责分离出来,实现更好的关注点分离。
## 模块职责
该启动模块主要负责以下启动任务:
1. **主应用启动** - 通过 `HertzBeatApplication` 类作为主入口点
2. **系统配置初始化** - 通过 `SystemConfigInitializer` 初始化系统配置、JWT密钥、AES密钥等
3. **调度系统初始化** - 通过 `SchedulerSystemInitializer` 初始化收集器状态和监控任务
4. **Netty服务器启动** - 通过 `NettyServerInitializer` 启动集群通信服务器
## 架构设计
### 原有架构问题
- `manager` 模块既负责业务逻辑又负责启动,职责不够清晰
- 启动代码散布在多个文件中,不利于维护
### 重构后的架构
```
hertzbeat-startup/
├── src/main/java/org/apache/hertzbeat/startup/
│ ├── HertzBeatApplication.java # 主启动类
│ ├── config/
│ │ └── SystemConfigInitializer.java # 系统配置初始化
│ └── scheduler/
│ ├── SchedulerSystemInitializer.java # 调度系统初始化
│ └── NettyServerInitializer.java # Netty服务器初始化
└── pom.xml
```
## 使用方式
### 主入口点
```java
// 原来的启动方式
public static void main(String[] args) {
SpringApplication.run(Manager.class, args);
}
// 现在的启动方式
public static void main(String[] args) {
SpringApplication.run(HertzBeatApplication.class, args);
}
```
### 启动顺序
1. `HertzBeatApplication` 作为主启动类启动Spring Boot应用
2. `SystemConfigInitializer` (最高优先级 +2) 初始化系统配置
3. `SchedulerSystemInitializer` (最低优先级 -1) 初始化调度系统
4. `NettyServerInitializer` (最低优先级) 启动Netty服务器
## 迁移说明
### 从 Manager 模块迁移的组件
1. **启动主类** - `Manager.java``HertzBeatApplication.java`
2. **配置初始化** - `ConfigInitializer.java``SystemConfigInitializer.java`
3. **调度初始化** - `SchedulerInit.java``SchedulerSystemInitializer.java`
4. **Netty服务器** - `ManageServer.java``NettyServerInitializer.java`
### Manager 模块的变化
- 移除了所有启动相关的代码
- 保留 `Manager.java` 作为 Spring Boot 配置类
- 专注于业务逻辑处理
## 资源文件迁移
### 迁移到 startup 模块的资源
- **应用配置文件** - `application*.yml`(包含dev、test、mysql、pg等配置)
- **数据库迁移脚本** - `db/migration/`(支持H2、MySQL、PostgreSQL
- **启动横幅** - `banner.txt`
- **安全配置** - `sureness.yml`
### 保留在 manager 模块的资源
- **监控应用定义** - `define/app-*.yml`(各种监控应用的定义文件)
- **告警模板** - `templates/`(告警通知模板文件)
## 依赖关系
### 当前依赖
- `spring-boot-starter` - Spring Boot核心
- `spring-boot-starter-web` - Web应用支持
- `spring-boot-starter-data-jpa` - 数据持久化
- `flyway-core` - 数据库迁移核心
- `flyway-mysql` - MySQL数据库迁移支持
- `flyway-database-postgresql` - PostgreSQL数据库迁移支持
- `h2database` - H2数据库(默认)
- `hertzbeat-common` - 通用组件
- `hertzbeat-base` - 基础组件
- `hertzbeat-warehouse` - 数据仓库
- `hertzbeat-alerter` - 告警模块
- `hertzbeat-remoting` - 远程通信
- `hertzbeat-manager` - 管理模块(业务逻辑)
### 注意事项
由于启动模块需要访问管理模块的服务和配置,存在对 `hertzbeat-manager` 的依赖。在实际部署时,需要确保依赖的正确性。
## 配置属性
### 系统配置相关
- `sureness.jwt.secret` - JWT密钥配置
- `common.secret` - AES密钥配置
### 调度器相关
- `scheduler.server.enabled` - 是否启用Netty服务器
- `scheduler.server.port` - Netty服务器端口
- `scheduler.server.idleStateEventTriggerTime` - 空闲状态触发时间
## 优势
1. **职责分离** - 启动逻辑与业务逻辑分离,模块职责更加清晰
2. **易于维护** - 所有启动相关代码集中在一个模块中
3. **可扩展性** - 新的启动功能可以轻松添加到启动模块
4. **向后兼容** - 保持了原有的配置和功能不变
## 注意事项
1. **依赖管理** - 需要正确处理启动模块与业务模块之间的依赖关系
2. **启动顺序** - 确保各个初始化组件按照正确的顺序执行
3. **配置传递** - 启动模块需要能够访问业务模块的配置和服务
4. **测试验证** - 重构后需要充分测试启动流程的正确性
## 总结
通过创建 `hertzbeat-startup` 模块,我们成功地将启动职责从业务模块中分离出来,实现了更清晰的模块划分。这种设计使得:
- 启动逻辑更加集中和易于维护
- 业务模块可以专注于业务逻辑
- 整体架构更加模块化和可扩展
- 保持了原有功能的完整性和稳定性
这是一个典型的关注点分离重构实践,提高了代码的可维护性和可扩展性。
+364
View File
@@ -0,0 +1,364 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.hertzbeat</groupId>
<artifactId>hertzbeat</artifactId>
<version>2.0-SNAPSHOT</version>
</parent>
<artifactId>hertzbeat-startup</artifactId>
<packaging>jar</packaging>
<name>hertzbeat-startup</name>
<description>Apache HertzBeat startup module</description>
<dependencies>
<!-- Spring Boot Starter -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!-- Spring Boot JPA -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<!-- Spring Boot Web -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- HertzBeat manager -->
<dependency>
<groupId>org.apache.hertzbeat</groupId>
<artifactId>hertzbeat-manager</artifactId>
</dependency>
<!-- HertzBeat common -->
<dependency>
<groupId>org.apache.hertzbeat</groupId>
<artifactId>hertzbeat-common</artifactId>
</dependency>
<!-- HertzBeat base -->
<dependency>
<groupId>org.apache.hertzbeat</groupId>
<artifactId>hertzbeat-base</artifactId>
</dependency>
<!-- HertzBeat warehouse -->
<dependency>
<groupId>org.apache.hertzbeat</groupId>
<artifactId>hertzbeat-warehouse</artifactId>
</dependency>
<!-- HertzBeat alerter -->
<dependency>
<groupId>org.apache.hertzbeat</groupId>
<artifactId>hertzbeat-alerter</artifactId>
</dependency>
<!-- HertzBeat remoting -->
<dependency>
<groupId>org.apache.hertzbeat</groupId>
<artifactId>hertzbeat-remoting</artifactId>
</dependency>
<!-- Jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<!-- Commons Lang3 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<!-- Sureness for security -->
<dependency>
<groupId>com.usthe.sureness</groupId>
<artifactId>spring-boot3-starter-sureness</artifactId>
</dependency>
<!-- Netty -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</dependency>
<!-- Database Migration - Flyway -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-mysql</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-postgresql</artifactId>
</dependency>
<!-- H2 Database (default) -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<!-- Lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<!-- Test dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<finalName>apache-hertzbeat-${hzb.version}</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>*.yml</include>
<include>*.properties</include>
<include>*.xml</include>
<include>banner.txt</include>
<include>define/**</include>
<include>db/**</include>
<include>templates/**</include>
<include>**/*.html</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration>
<classesDirectory>target/classes/</classesDirectory>
<archive>
<!--Exclude maven descriptors from generated JAR-->
<addMavenDescriptor>false</addMavenDescriptor>
<manifest>
<!--Main class of the project-->
<mainClass>org.apache.hertzbeat.startup.HertzBeatApplication</mainClass>
<useUniqueVersions>false</useUniqueVersions>
<!--Add third-party JARs to the classpath using maven-dependency-plugin-->
<addClasspath>true</addClasspath>
<!--Location of external dependency JARs-->
<classpathPrefix>lib/</classpathPrefix>
</manifest>
<manifestEntries>
<Class-Path>. config</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<!--Critical plugin, assembly plugin provided by maven, should be placed last-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<executions>
<execution>
<id>make-zip</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<outputDirectory>../dist</outputDirectory>
<descriptors>
<descriptor>../script/assembly/server/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>make-docker-zip</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<outputDirectory>../dist</outputDirectory>
<descriptors>
<descriptor>../script/assembly/server/assembly-docker.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>make-docker-compose-script</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<outputDirectory>../dist</outputDirectory>
<descriptors>
<descriptor>../script/assembly/server/assembly-docker-compose.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>runtime</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>${maven-assembly-plugin.version}</version>
<executions>
<execution>
<id>make-macos-arm64</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-macos-arm64.xml</descriptor>
</descriptors>
<outputDirectory>../dist</outputDirectory>
</configuration>
</execution>
<execution>
<id>make-macos-amd64</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-macos-amd64.xml</descriptor>
</descriptors>
<outputDirectory>../dist</outputDirectory>
</configuration>
</execution>
<execution>
<id>make-linux-arm64</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-linux-arm64.xml</descriptor>
</descriptors>
<outputDirectory>../dist</outputDirectory>
</configuration>
</execution>
<execution>
<id>make-linux-amd64</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-linux-amd64.xml</descriptor>
</descriptors>
<outputDirectory>../dist</outputDirectory>
</configuration>
</execution>
<execution>
<id>make-windows-64</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-windows-64.xml</descriptor>
</descriptors>
<outputDirectory>../dist</outputDirectory>
</configuration>
</execution>
<execution>
<id>make-docker-compose-script</id>
<!--Bound maven operation-->
<phase>package</phase>
<!--Run once-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>../script/assembly/server/assembly-docker-compose.xml</descriptor>
</descriptors>
<outputDirectory>../dist</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.manager;
package org.apache.hertzbeat.startup;
import javax.annotation.PostConstruct;
import org.apache.hertzbeat.manager.nativex.HertzbeatRuntimeHintsRegistrar;
@@ -31,9 +31,9 @@ import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* start up class.
* HertzBeat main application startup class.
* This class replaces the original Manager class as the main entry point for HertzBeat application.
*/
@SpringBootApplication
@EnableJpaAuditing
@EnableJpaRepositories(basePackages = {"org.apache.hertzbeat"})
@@ -43,13 +43,15 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@ImportRuntimeHints(HertzbeatRuntimeHintsRegistrar.class)
@EnableAsync
@EnableScheduling
public class Manager {
public class HertzBeatApplication {
public static void main(String[] args) {
SpringApplication.run(Manager.class, args);
SpringApplication.run(HertzBeatApplication.class, args);
}
@PostConstruct
public void init() {
// Set JNDI object factory filter for security
System.setProperty("jdk.jndi.object.factoriesFilter", "!com.zaxxer.hikari.HikariJNDIFactory");
}
}
}
@@ -0,0 +1,136 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
## -- sureness.yml account source -- ##
# config the resource restful api that need auth protection, base rbac
# rule: api===method===role
# eg: /api/v1/source1===get===[admin] means /api/v2/host===post support role[admin] access.
# eg: /api/v1/source2===get===[] means /api/v1/source2===get can not access by any role.
resourceRole:
- /api/account/auth/refresh===post===[admin,user,guest]
- /api/apps/**===get===[admin,user,guest]
- /api/monitor/**===get===[admin,user,guest]
- /api/monitor/**===post===[admin,user]
- /api/monitor/**===put===[admin,user]
- /api/monitor/**===delete==[admin]
- /api/monitors/**===get===[admin,user,guest]
- /api/monitors/**===post===[admin,user]
- /api/monitors/**===put===[admin,user]
- /api/monitors/**===delete===[admin]
- /api/alert/**===get===[admin,user,guest]
- /api/alert/**===post===[admin,user]
- /api/alert/**===put===[admin,user]
- /api/alert/**===delete===[admin]
- /api/alerts/**===get===[admin,user,guest]
- /api/alerts/**===post===[admin,user]
- /api/alerts/**===put===[admin,user]
- /api/alerts/**===delete===[admin]
- /api/notice/**===get===[admin,user,guest]
- /api/notice/**===post===[admin,user]
- /api/notice/**===put===[admin,user]
- /api/notice/**===delete===[admin]
- /api/tag/**===get===[admin,user,guest]
- /api/tag/**===post===[admin,user]
- /api/tag/**===put===[admin,user]
- /api/tag/**===delete===[admin]
- /api/summary/**===get===[admin,user,guest]
- /api/summary/**===post===[admin,user]
- /api/summary/**===put===[admin,user]
- /api/summary/**===delete===[admin]
- /api/collector/**===get===[admin,user,guest]
- /api/collector/**===post===[admin,user]
- /api/collector/**===put===[admin,user]
- /api/collector/**===delete===[admin]
- /api/status/page/**===get===[admin,user,guest]
- /api/status/page/**===post===[admin,user]
- /api/status/page/**===put===[admin,user]
- /api/status/page/**===delete===[admin]
- /api/grafana/**===get===[admin,user,guest]
- /api/grafana/**===post===[admin,user]
- /api/grafana/**===put===[admin,user]
- /api/grafana/**===delete===[admin]
- /api/bulletin/**===get===[admin,user,guest]
- /api/bulletin/**===post===[admin,user]
- /api/bulletin/**===put===[admin,user]
- /api/bulletin/**===delete===[admin]
- /api/sse/**===get===[admin,user]
- /api/sse/**===post===[admin,user]
- /api/chat/**===get===[admin,user]
- /api/chat/**===post===[admin,user]
- /api/logs/ingest/**===post===[admin,user]
# config the resource restful api that need bypass auth protection
# rule: api===method
# eg: /api/v1/source3===get means /api/v1/source3===get can be access by anyone, no need auth.
excludedResource:
- /api/alert/sse/**===*
- /api/logs/sse/**===*
- /api/account/auth/**===*
- /api/i18n/**===get
- /api/apps/hierarchy===get
- /api/push/**===*
- /api/status/page/public/**===*
- /api/manager/sse/**===*
# web ui resource
- /===get
- /assets/**===get
- /dashboard/**===get
- /monitors/**===get
- /alert/**===get
- /account/**===get
- /setting/**===get
- /passport/**===get
- /status/**===get
- /**/*.html===get
- /**/*.js===get
- /**/*.css===get
- /**/*.ico===get
- /**/*.ttf===get
- /**/*.png===get
- /**/*.gif===get
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui resource
- /swagger-resources/**===get
- /v2/api-docs===get
- /v3/api-docs===get
# h2 database
- /h2-console/**===*
# account info config
# eg: admin has role [admin,user], password is hertzbeat
# eg: tom has role [user], password is hertzbeat
# eg: lili has role [guest], plain password is lili, salt is 123, salted password is 1A676730B0C7F54654B0E09184448289
account:
- appId: admin
credential: hertzbeat
role: [admin]
- appId: tom
credential: hertzbeat
role: [user]
- appId: guest
credential: hertzbeat
role: [guest]
- appId: lili
# credential = MD5(password + salt)
# plain password: hertzbeat
# attention: digest authentication does not support salted encrypted password accounts
credential: 94C6B34E7A199A9F9D4E1F208093B489
salt: 123
role: [user]
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.manager;
package org.apache.hertzbeat.startup;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
@@ -24,7 +24,7 @@ import org.springframework.test.context.ActiveProfiles;
* Abstract Integration Test for Spring.
*/
@ActiveProfiles("test")
@SpringBootTest(classes = Manager.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@SpringBootTest(classes = HertzBeatApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class AbstractSpringIntegrationTest {
}
@@ -15,12 +15,11 @@
* limitations under the License.
*/
package org.apache.hertzbeat.manager;
package org.apache.hertzbeat.startup;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import javax.annotation.Resource;
import javax.naming.NamingException;
import org.apache.hertzbeat.alert.AlerterProperties;
import org.apache.hertzbeat.alert.AlerterWorkerPool;
import org.apache.hertzbeat.alert.calculate.realtime.MetricsRealTimeAlertCalculator;
@@ -59,7 +58,7 @@ import org.springframework.context.ApplicationContext;
*
* @version 2.1
*/
class ManagerTest extends AbstractSpringIntegrationTest {
class ContextTest extends AbstractSpringIntegrationTest {
@Resource
private ApplicationContext ctx;
@@ -107,13 +106,5 @@ class ManagerTest extends AbstractSpringIntegrationTest {
assertNotNull(ctx.getBean(MetricsDataController.class));
}
@Test
void testJndi() throws NamingException {
//System.setProperty("jdk.jndi.object.factoriesFilter", "!com.zaxxer.hikari.HikariJNDIFactory");
// for CI
//InitialContext initialContext = new InitialContext();
//initialContext.lookup("rmi://localhost:1099/Exploit");
}
}
@@ -15,14 +15,15 @@
* limitations under the License.
*/
package org.apache.hertzbeat.manager.dao;
package org.apache.hertzbeat.startup.dao;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import javax.annotation.Resource;
import org.apache.hertzbeat.common.entity.manager.Collector;
import org.apache.hertzbeat.manager.AbstractSpringIntegrationTest;
import org.apache.hertzbeat.manager.dao.CollectorDao;
import org.apache.hertzbeat.startup.AbstractSpringIntegrationTest;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.manager.dao;
package org.apache.hertzbeat.startup.dao;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -27,7 +27,8 @@ import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.hertzbeat.common.entity.manager.Label;
import org.apache.hertzbeat.manager.AbstractSpringIntegrationTest;
import org.apache.hertzbeat.manager.dao.LabelDao;
import org.apache.hertzbeat.startup.AbstractSpringIntegrationTest;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -15,11 +15,12 @@
* limitations under the License.
*/
package org.apache.hertzbeat.manager.dao;
package org.apache.hertzbeat.startup.dao;
import jakarta.annotation.Resource;
import org.apache.hertzbeat.common.entity.manager.MetricsFavorite;
import org.apache.hertzbeat.manager.AbstractSpringIntegrationTest;
import org.apache.hertzbeat.manager.dao.MetricsFavoriteDao;
import org.apache.hertzbeat.startup.AbstractSpringIntegrationTest;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.test.annotation.DirtiesContext;
@@ -206,4 +207,4 @@ class MetricsFavoriteDaoTest extends AbstractSpringIntegrationTest {
metricsFavoriteDao.saveAndFlush(duplicate);
});
}
}
}
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.manager.dao;
package org.apache.hertzbeat.startup.dao;
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -29,8 +29,9 @@ import java.util.List;
import java.util.Optional;
import java.util.Set;
import org.apache.hertzbeat.common.entity.manager.Monitor;
import org.apache.hertzbeat.manager.AbstractSpringIntegrationTest;
import org.apache.hertzbeat.manager.dao.MonitorDao;
import org.apache.hertzbeat.manager.pojo.dto.AppCount;
import org.apache.hertzbeat.startup.AbstractSpringIntegrationTest;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.manager.dao;
package org.apache.hertzbeat.startup.dao;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -24,7 +24,7 @@ import java.time.LocalDateTime;
import java.util.List;
import org.apache.hertzbeat.alert.dao.NoticeRuleDao;
import org.apache.hertzbeat.common.entity.alerter.NoticeRule;
import org.apache.hertzbeat.manager.AbstractSpringIntegrationTest;
import org.apache.hertzbeat.startup.AbstractSpringIntegrationTest;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.manager.dao;
package org.apache.hertzbeat.startup.dao;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -25,7 +25,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.apache.hertzbeat.common.entity.manager.Param;
import org.apache.hertzbeat.manager.AbstractSpringIntegrationTest;
import org.apache.hertzbeat.manager.dao.ParamDao;
import org.apache.hertzbeat.startup.AbstractSpringIntegrationTest;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.hertzbeat.manager.dao;
package org.apache.hertzbeat.startup.dao;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -24,7 +24,8 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import org.apache.hertzbeat.common.entity.manager.ParamDefine;
import org.apache.hertzbeat.manager.AbstractSpringIntegrationTest;
import org.apache.hertzbeat.manager.dao.ParamDefineDao;
import org.apache.hertzbeat.startup.AbstractSpringIntegrationTest;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+12 -12
View File
@@ -5,22 +5,22 @@ This website is built with [Docusaurus](https://docusaurus.io/).
## Installation
```shell
yarn install
## yarn install --registry=https://registry.npmmirror.com
pnpm install
## pnpm install --registry=https://registry.npmmirror.com
```
## I18N
```console
yarn write-translations --locale zh-cn
pnpm write-translations --locale zh-cn
yarn write-translations --locale en
pnpm write-translations --locale en
```
## Local Development
```console
yarn start
pnpm start
```
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
@@ -36,7 +36,7 @@ Update the member information in `src/pages/team/data/member.json` File.
Please refer to the [All Contributors](https://allcontributors.org/) to auto add contributor.
```console
yarn all-contributors generate
pnpm all-contributors generate
```
Use generate to read the contributors list from `.all-contributorsrc` file and update the contributor tables specified by the files key.
@@ -44,7 +44,7 @@ Use generate to read the contributors list from `.all-contributorsrc` file and u
### Avatar
```console
yarn github-avatar
pnpm github-avatar
```
This command will fetch the base64 string of the GitHub avatar from file `src/pages/team/data/member.json` and `.all-contributorsrc`, and store the result in the `src/pages/team/data/` directory. The operation might take a little while.
@@ -52,7 +52,7 @@ This command will fetch the base64 string of the GitHub avatar from file `src/pa
## Build
```console
yarn build
pnpm build
```
This command generates static content into the `build` directory and can be served using any static contents hosting service.
@@ -60,9 +60,9 @@ This command generates static content into the `build` directory and can be serv
## Deployment
```console
GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy
GIT_USER=<Your GitHub username> USE_SSH=true pnpm deploy
OR
USE_SSH=true yarn deploy
USE_SSH=true pnpm deploy
```
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
@@ -70,13 +70,13 @@ If you are using GitHub pages for hosting, this command is a convenient way to b
### Deployment to Gitee
```console
GITHUB_HOST=gitee.com USE_SSH=true yarn deploy
GITHUB_HOST=gitee.com USE_SSH=true pnpm deploy
```
### Archive Version
```shell
yarn docusaurus docs:version v1.5.x
pnpm docusaurus docs:version v1.5.x
```
## Directory Structure
+4 -4
View File
@@ -60,15 +60,15 @@ Even small corrections to typos are very welcome :)
#### Frontend start
1. Need `Node Yarn` Environment, Make sure `Node.js >= 18`
1. Need `Node pnpm` Environment, Make sure `Node.js >= 18`
2. Cd to the `web-app` directory: `cd web-app`
3. Install yarn if not existed `npm install -g yarn`
3. Install pnpm if not existed `npm install -g pnpm`
4. Install Dependencies: `yarn install` or `yarn install --registry=https://registry.npmmirror.com` in `web-app`
4. Install Dependencies: `pnpm install` or `pnpm install --registry=https://registry.npmmirror.com` in `web-app`
5. After the local backend is started, start the local frontend in the web-app directory: `yarn start`
5. After the local backend is started, start the local frontend in the web-app directory: `pnpm start`
6. Browser access to localhost:4200 to start, default account/password is *admin/hertzbeat*
+9 -9
View File
@@ -20,33 +20,33 @@ sidebar_label: Development
### Frontend start
1. Need `Node Yarn` Environment, Make sure `Node.js >= 18`
1. Need `Node pnpm` Environment, Make sure `Node.js >= 18`
2. Cd to the `web-app` directory: `cd web-app`
3. Install yarn if not existed `npm install -g yarn`
3. Install pnpm if not existed `npm install -g pnpm`
4. Install Dependencies: `yarn install` or `yarn install --registry=https://registry.npmmirror.com` in `web-app`
4. Install Dependencies: `pnpm install` or `pnpm install --registry=https://registry.npmmirror.com` in `web-app`
5. After the local backend is started, start the local frontend in the web-app directory: `yarn start`
5. After the local backend is started, start the local frontend in the web-app directory: `pnpm start`
6. Browser access to localhost:4200 to start, default account/password is *admin/hertzbeat*
## Build HertzBeat binary package
> Requires `maven3+`, `java17`, `node` and `yarn` environments.
> Requires `maven3+`, `java17`, `node` and `pnpm` environments.
### Frontend build
1. Need `Node Yarn` Environment, Make sure `Node.js >= 18`
1. Need `Node pnpm` Environment, Make sure `Node.js >= 18`
2. Cd to the `web-app` directory: `cd web-app`
3. Install yarn if not existed `npm install -g yarn`
3. Install pnpm if not existed `npm install -g pnpm`
4. Install Dependencies: `yarn install` or `yarn install --registry=https://registry.npmmirror.com` in `web-app`
4. Install Dependencies: `pnpm install` or `pnpm install --registry=https://registry.npmmirror.com` in `web-app`
5. Build web-app: `yarn package`
5. Build web-app: `pnpm package`
### Backend build
+4 -4
View File
@@ -51,12 +51,12 @@ In Apache Hertzbeat, all MD articles have to pass MD's [CI](https://github.com/a
After you have written an MD article, you can execute the following command locally to check whether the content of the MD article meets the requirements, so as to reduce the workload of review and save your time:
```shell
cd home && yarn
cd home && pnpm install
yarn md-lint
pnpm md-lint
# If the documentation is wrong, you can use yarn md-lint-fix to fix it.
yarn md-lint-fix
# If the documentation is wrong, you can use pnpm md-lint-fix to fix it.
pnpm md-lint-fix
```
For formatting rules for MD articles you can refer to: [Markdown-lint-rules](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md)
+3 -3
View File
@@ -11,7 +11,7 @@ This tutorial describes in detail how to release Apache HertzBeat™, take the r
This release process is operated in the UbuntuOS(Windows,Mac), and the following tools are required:
- JDK 17
- Node18 Yarn
- Node18 pnpm
- Apache Maven 3.x
- GnuPG 2.x
- Git
@@ -188,9 +188,9 @@ git checkout release-1.7.3-rc1
> Build HertzBeat server binary, run script in `web-app`
```shell
yarn install
pnpm install
yarn package
pnpm package
```
> run script in root
@@ -64,15 +64,15 @@ limitations under the License.
#### 前端启动
1. 需要 `nodejs yarn` 环境, 确保 `Node.js >= 18`
1. 需要 `nodejs pnpm` 环境, 确保 `Node.js >= 18`
2. 进入 `web-app` 目录: `cd web-app`
3. 安装 yarn: `npm install -g yarn`
3. 安装 pnpm: `npm install -g pnpm`
4. 在前端工程目录 `web-app` 下执行: `yarn install` or `yarn install --registry=https://registry.npmmirror.com` in `web-app`
4. 在前端工程目录 `web-app` 下执行: `pnpm install` or `pnpm install --registry=https://registry.npmmirror.com` in `web-app`
5. 待本地后端启动后,在 web-app 目录下启动本地前端 `yarn start`
5. 待本地后端启动后,在 web-app 目录下启动本地前端 `pnpm start`
6. 浏览器访问 localhost:4200 即可开始,默认账号密码 **admin/hertzbeat**
@@ -23,33 +23,33 @@ sidebar_label: 运行编译
### 前端启动
1. 需要 `nodejs yarn` 环境, 版本要求 `Node.js >= 18`
1. 需要 `nodejs pnpm` 环境, 版本要求 `Node.js >= 18`
2. 进入 `web-app` 目录: `cd web-app`
3. 安装yarn: `npm install -g yarn`
3. 安装pnpm: `npm install -g pnpm`
4. 在前端工程目录 `web-app` 下执行: `yarn install` 或者 `yarn install --registry=https://registry.npmmirror.com`
4. 在前端工程目录 `web-app` 下执行: `pnpm install` 或者 `pnpm install --registry=https://registry.npmmirror.com`
5. 待本地后端启动后,在web-app目录下启动本地前端 `yarn start`
5. 待本地后端启动后,在web-app目录下启动本地前端 `pnpm start`
6. 浏览器访问 localhost:4200 即可开始,默认账号密码 admin/hertzbeat
## 生成二进制包
> 需要 `maven3+`, `java17`, `node` 和 `yarn` 环境.
> 需要 `maven3+`, `java17`, `node` 和 `pnpm` 环境.
### 前端打包
1. 需要 `Node Yarn` 环境, 版本要求 `Node.js >= 18`
1. 需要 `Node pnpm` 环境, 版本要求 `Node.js >= 18`
2. 切换到 `web-app` 目录: `cd web-app`
3. 安装 yarn: `npm install -g yarn`
3. 安装 pnpm: `npm install -g pnpm`
4. 安装本项目依赖: `yarn install``yarn install --registry=https://registry.npmmirror.com`
4. 安装本项目依赖: `pnpm install``pnpm install --registry=https://registry.npmmirror.com`
5. 打包: `yarn package`
5. 打包: `pnpm package`
### 后端打包
@@ -51,12 +51,12 @@ git clone git@github.com:<your-github-user-name>/hertzbeat.git
在您编写了相关 MD 文章之后,您可以在本地执行以下命令,预先检查 MD 的文章内容是否符合要求,减少 review 的工作量,节省您的时间:
```shell
cd home && yarn
cd home && pnpm install
yarn md-lint
pnpm md-lint
# 如果文档错误,您可以使用 yarn md-lint-fix 修复
yarn md-lint-fix
# 如果文档错误,您可以使用 pnpm md-lint-fix 修复
pnpm md-lint-fix
```
MD 文章的相关格式规则您可以参考:[Markdown-lint-rules](https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md)

Some files were not shown because too many files have changed in this diff Show More