Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support custom prometheus endpoint path #1346

Merged
merged 4 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions manager/src/main/resources/define/app-prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ params:
# default value
defaultValue: 9091
required: true
# field-param field key
# field-变量字段标识
- field: path
# name-param field display i18n name
# name-参数字段显示名称
name:
zh-CN: 端点路径
en-US: Endpoint Path
# type-param field type(most mapping the html input type)
# type-字段类型,样式(大部分映射input标签type属性)
type: text
# 参数输入框提示信息
# param field input placeholder
placeholder: 'Exporter Url Endpoint Path'
defaultValue: "/metrics"
# required-true or false
# required-是否是必输项 true-必填 false-可选
required: true
- field: timeout
name:
zh-CN: 查询超时时间
Expand Down Expand Up @@ -125,7 +143,7 @@ params:
# when type is key-value, use valueAlias to config value alias name
# 当字段类型为key-value时, 使用valueAlias配置value的展示别名
valueAlias: Param Value
# field-param field key
# field-param field key
# field-变量字段标识
- field: contentType
# name-param field display i18n name
Expand All @@ -145,7 +163,7 @@ params:
# hide param-true or false
# 是否隐藏字段 true or false
hide: true
# field-param field key
# field-param field key
# field-变量字段标识
- field: payload
# name-param field display i18n name
Expand Down Expand Up @@ -246,7 +264,7 @@ metrics:
# http port
port: ^_^port^_^
# http path
path: '/metrics'
path: ^_^path^_^
timeout: ^_^timeout^_^
# http method: GET POST PUT DELETE PATCH
method: GET
Expand Down
2 changes: 2 additions & 0 deletions manager/src/main/resources/sureness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ excludedResource:
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui 资源
- /swagger-resources/**===get
- /v2/api-docs===get
Expand Down
2 changes: 2 additions & 0 deletions script/docker-compose/hertzbeat-mysql-iotdb/conf/sureness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ excludedResource:
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui 资源
- /swagger-resources/**===get
- /v2/api-docs===get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ excludedResource:
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui 资源
- /swagger-resources/**===get
- /v2/api-docs===get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ excludedResource:
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui 资源
- /swagger-resources/**===get
- /v2/api-docs===get
Expand Down
2 changes: 2 additions & 0 deletions script/helm/hertzbeat/templates/manager/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ data:
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui
- /swagger-resources/**===get
- /v2/api-docs===get
Expand Down
2 changes: 2 additions & 0 deletions script/sureness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ excludedResource:
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui 资源
- /swagger-resources/**===get
- /v2/api-docs===get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,15 +378,6 @@
</nz-form-control>
</nz-form-item>

<nz-form-item>
<nz-form-label nzSpan="7" nzFor="detect" [nzTooltipTitle]="'monitors.detect.tip' | i18n">
{{ 'monitors.detect' | i18n }}
</nz-form-label>
<nz-form-control nzSpan="8">
<nz-switch [(ngModel)]="detected" name="detect" id="detect"></nz-switch>
</nz-form-control>
</nz-form-item>

<nz-form-item>
<nz-form-label nzSpan="7" nzFor="tags" [nzTooltipTitle]="'tag.bind.tip' | i18n">
{{ 'tag.bind' | i18n }}
Expand Down Expand Up @@ -423,7 +414,16 @@

<div nz-row>
<div nz-col [nzXs]="{ span: 24 }" [nzLg]="{ span: 8, offset: 7 }" style="text-align: center">
<button nz-button nzType="primary" type="submit" (click)="onDetect(editForm.form)"> {{ 'common.button.detect' | i18n }} </button>
<button
nz-button
nzType="primary"
type="submit"
nz-tooltip
[nzTooltipTitle]="'monitors.detect.tip' | i18n"
(click)="onDetect(editForm.form)"
>
{{ 'common.button.detect' | i18n }}
</button>
<button nz-button nzType="primary" type="submit" (click)="onSubmit(editForm.form)"> {{ 'common.button.ok' | i18n }} </button>
<button nz-button nzType="primary" type="reset" (click)="onCancel()"> {{ 'common.button.cancel' | i18n }} </button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class MonitorEditComponent implements OnInit {
collectors!: Collector[];
collector: string = '';
profileForm: FormGroup = new FormGroup({});
detected: boolean = true;
detected: boolean = false;
passwordVisible: boolean = false;
isSpinning: boolean = false;
spinningTip: string = 'Loading...';
Expand Down Expand Up @@ -74,7 +74,7 @@ export class MonitorEditComponent implements OnInit {
this.paramValueMap.set(item.field, item);
});
}
this.detected = true;
this.detected = false;
if (this.monitor.tags == undefined) {
this.monitor.tags = [];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,15 +387,6 @@
</nz-form-control>
</nz-form-item>

<nz-form-item>
<nz-form-label nzSpan="7" nzFor="detect" [nzTooltipTitle]="'monitors.detect.tip' | i18n">
{{ 'monitors.detect' | i18n }}
</nz-form-label>
<nz-form-control nzSpan="8">
<nz-switch [(ngModel)]="detected" name="detect" id="detect"></nz-switch>
</nz-form-control>
</nz-form-item>

<nz-form-item>
<nz-form-label nzSpan="7" nzFor="tags" [nzTooltipTitle]="'tag.bind.tip' | i18n">
{{ 'tag.bind' | i18n }}
Expand Down Expand Up @@ -432,7 +423,16 @@

<div nz-row>
<div nz-col [nzXs]="{ span: 24 }" [nzLg]="{ span: 8, offset: 7 }" style="text-align: center">
<button nz-button nzType="primary" type="submit" (click)="onDetect(newForm.form)"> {{ 'common.button.detect' | i18n }} </button>
<button
nz-button
nzType="primary"
type="submit"
nz-tooltip
[nzTooltipTitle]="'monitors.detect.tip' | i18n"
(click)="onDetect(newForm.form)"
>
{{ 'common.button.detect' | i18n }}
</button>
<button nz-button nzType="primary" type="submit" (click)="onSubmit(newForm.form)"> {{ 'common.button.ok' | i18n }} </button>
<button nz-button nzType="primary" type="reset" (click)="onCancel()"> {{ 'common.button.cancel' | i18n }} </button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class MonitorNewComponent implements OnInit {
monitor!: Monitor;
collectors!: Collector[];
collector: string = '';
detected: boolean = true;
detected: boolean = false;
passwordVisible: boolean = false;
// 是否显示加载中
isSpinning: boolean = false;
Expand Down Expand Up @@ -62,7 +62,7 @@ export class MonitorNewComponent implements OnInit {
this.router.navigateByUrl('/monitors/new?app=website');
}
this.titleSvc.setTitleByI18n(`monitor.app.${this.monitor.app}`);
this.detected = true;
this.detected = false;
this.passwordVisible = false;
this.isSpinning = true;
return this.appDefineSvc.getAppParamsDefine(this.monitor.app);
Expand Down
48 changes: 48 additions & 0 deletions web-app/src/app/routes/setting/define/define.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@
>
</ul>
</li>
<li nz-submenu [nzTitle]="'menu.monitor.program' | i18n">
<ul>
<li
nz-menu-item
*ngFor="let app of appMenus['program']; let i = index"
[nzSelected]="app.selected"
routerLink="/setting/define"
[queryParams]="{ app: app.value }"
>{{ app.label }}</li
>
</ul>
</li>
<li nz-submenu [nzTitle]="'menu.monitor.db' | i18n">
<ul>
<li
Expand All @@ -33,6 +45,18 @@
>
</ul>
</li>
<li nz-submenu [nzTitle]="'menu.monitor.cache' | i18n">
<ul>
<li
nz-menu-item
*ngFor="let app of appMenus['cache']; let i = index"
[nzSelected]="app.selected"
routerLink="/setting/define"
[queryParams]="{ app: app.value }"
>{{ app.label }}</li
>
</ul>
</li>
<li nz-submenu [nzTitle]="'menu.monitor.os' | i18n">
<ul>
<li
Expand All @@ -57,6 +81,30 @@
>
</ul>
</li>
<li nz-submenu [nzTitle]="'menu.monitor.bigdata' | i18n">
<ul>
<li
nz-menu-item
*ngFor="let app of appMenus['bigdata']; let i = index"
[nzSelected]="app.selected"
routerLink="/setting/define"
[queryParams]="{ app: app.value }"
>{{ app.label }}</li
>
</ul>
</li>
<li nz-submenu [nzTitle]="'menu.monitor.webserver' | i18n">
<ul>
<li
nz-menu-item
*ngFor="let app of appMenus['webserver']; let i = index"
[nzSelected]="app.selected"
routerLink="/setting/define"
[queryParams]="{ app: app.value }"
>{{ app.label }}</li
>
</ul>
</li>
<li nz-submenu [nzTitle]="'menu.monitor.cn' | i18n">
<ul>
<li
Expand Down
16 changes: 8 additions & 8 deletions web-app/src/assets/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,13 @@
"alert.notice.sender.mail.port": "Email Port",
"alert.notice.sender.mail.ssl": "Enable SSL",
"alert.notice.sender.mail.enable": "Enable Email Configuration",
"dashboard.alerts.title": "Recently Alerts List",
"dashboard.alerts.title-no": "Recently Pending Alerts",
"dashboard.alerts.no": "No Pending Alerts",
"dashboard.alerts.enter": "Go Alert Center",
"dashboard.alerts.distribute": "The Distribution Of Alerts",
"dashboard.alerts.num": "Alerts Num",
"dashboard.alerts.deal": "Alerts Dealing",
"dashboard.alerts.title": "Recently Alarms List",
"dashboard.alerts.title-no": "Recently Pending Alarms",
"dashboard.alerts.no": "No Pending Alarms",
"dashboard.alerts.enter": "Go Alarm Center",
"dashboard.alerts.distribute": "The Distribution Of Alarms",
"dashboard.alerts.num": "Alarms Num",
"dashboard.alerts.deal": "Alarms Dealing",
"dashboard.alerts.deal-percent": "Dealing Rate",
"dashboard.monitors.total": "Monitor Total",
"dashboard.monitors.title": "Monitoring Overview",
Expand Down Expand Up @@ -370,7 +370,7 @@
"monitors.detect": "Detect",
"monitors.detect.success": "Detect Success",
"monitors.detect.failed": "Detect Failed",
"monitors.detect.tip": "Detect monitor available before apply",
"monitors.detect.tip": "Check and detect monitor available status",
"monitors.detail.time-series.unavailable": "Unable to provide historical chart, please configure time series database",
"monitors.detail": "Monitor Detail",
"monitors.detail.auto-refresh": "Auto Refresh After {{time}} s",
Expand Down
2 changes: 1 addition & 1 deletion web-app/src/assets/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@
"monitors.detect": "测试连接",
"monitors.detect.success": "测试连接成功",
"monitors.detect.failed": "测试连接失败",
"monitors.detect.tip": "新增监控前是否先探测检查监控可用性",
"monitors.detect.tip": "测试检查监控的可用性状态",
"monitors.detail": "监控详情",
"monitors.detail.auto-refresh": "自动刷新 {{time}} 秒",
"monitors.detail.config-refresh": "设置 {{time}} 秒自动刷新",
Expand Down
2 changes: 1 addition & 1 deletion web-app/src/assets/i18n/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@
"monitors.detect": "測試連接",
"monitors.detect.success": "測試連接成功",
"monitors.detect.failed": "測試連接失敗",
"monitors.detect.tip": "新增監控前是否先探測檢查監控可用性",
"monitors.detect.tip": "測試檢查監控的可用性狀態",
"monitors.detail": "監控詳情",
"monitors.detail.auto-refresh": "自動刷新 {{time}} 秒",
"monitors.detail.config-refresh": "設置 {{time}} 秒自動刷新",
Expand Down
Loading