support custom prometheus endpoint path (#1346)

This commit is contained in:
tomsun28
2023-11-22 15:49:39 +08:00
committed by GitHub
parent 70a93f7bf7
commit 17a9fe2c22
19 changed files with 141 additions and 92 deletions
@@ -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: 查询超时时间
@@ -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
@@ -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
@@ -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
+2
View File
@@ -80,6 +80,8 @@ excludedResource:
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui 资源
- /swagger-resources/**===get
- /v2/api-docs===get
@@ -77,6 +77,8 @@ excludedResource:
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui 资源
- /swagger-resources/**===get
- /v2/api-docs===get
@@ -77,6 +77,8 @@ excludedResource:
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui 资源
- /swagger-resources/**===get
- /v2/api-docs===get
@@ -77,6 +77,8 @@ excludedResource:
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui 资源
- /swagger-resources/**===get
- /v2/api-docs===get
@@ -214,6 +214,8 @@ data:
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui
- /swagger-resources/**===get
- /v2/api-docs===get
+2
View File
@@ -78,6 +78,8 @@ excludedResource:
- /**/*.jpg===get
- /**/*.svg===get
- /**/*.json===get
- /**/*.woff===get
- /**/*.eot===get
# swagger ui 资源
- /swagger-resources/**===get
- /v2/api-docs===get
@@ -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 }}
@@ -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>
@@ -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...';
@@ -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 = [];
}
@@ -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 }}
@@ -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>
@@ -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;
@@ -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);
@@ -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
@@ -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
@@ -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
@@ -1,24 +1,24 @@
<div #collapsed_content class="help_massage_div" id="collapsed">
<div class="level1_breabcrumb" [ngClass]="{ collapsed: isCollapsed }">
<div class="breabcrumb_massage_show">
<div class="level1_breadcrumb" [ngClass]="{ collapsed: isCollapsed }">
<div>
<div class="flex help_massage_nav">
<a [routerLink]="['/']" [queryParams]="{ app: app }">
<i nz-icon nzType="home" style="color: rgba(29, 29, 29, 0.84)"></i>
<span class="help_massage_nav_item">{{ 'menu.dashboard' | i18n }}</span>
<a class="help_massage_nav_item" [routerLink]="['/']" [queryParams]="{ app: app }">
<i class="help_link_span" nz-icon nzType="home"></i>
<span>{{ 'menu.dashboard' | i18n }}</span>
</a>
</div>
<div class="flex help_massage_nav">
<a [routerLink]="">
<i nz-icon nzType="{{ icon_name }}" style="color: rgba(29, 29, 29, 0.84)"></i>
<span class="help_massage_nav_item" *ngIf="app != undefined">{{ 'monitor.app.' + app | i18n }}</span>
<span class="help_massage_nav_item" *ngIf="app == undefined">{{ module_name | i18n }}</span>
<a class="help_massage_nav_item" [routerLink]="">
<i class="help_link_span" nz-icon nzType="{{ icon_name }}"></i>
<span *ngIf="app != undefined">{{ 'monitor.app.' + app | i18n }}</span>
<span *ngIf="app == undefined">{{ module_name | i18n }}</span>
</a>
</div>
</div>
<div class="handover_button">
<button class="handover_button_content" id="handover_button_self" (click)="handleButtonClick()">{{ collapse_expand | i18n }}</button>
<i nz-icon="" nztype="home" class="anticon anticon-home">
<i nz-icon (click)="handleButtonClick()">
<svg viewBox="64 64 896 896" focusable="false" fill="#000000" width="1.12em" height="1.12em" data-icon="alert" aria-hidden="true">
<path
d="M550.4 793.6L490.666667 853.333333l-59.733334-59.733333L256 618.666667l59.733333-59.733334 174.933334 174.933334 174.933333-174.933334 59.733333 59.733334-174.933333 174.933333zM490.666667 332.8l-174.933334 174.933333L256 448l174.933333-174.933333L490.666667 213.333333l59.733333 59.733334 174.933333 174.933333-59.733333 59.733333-174.933333-174.933333z"
@@ -29,38 +29,22 @@
</i>
</div>
</div>
<div class="collapsed_content">
<div class="collapsed_content content_bg_color">
<div #level2Message class="level2_massage_show">
<div [innerHTML]="help_massage_content"></div>
</div>
<div class="help_link_content">
<div class="flex help_link_nav">
<a [href]="'question.link' | i18n" target="_blank">
<i nz-icon="" nztype="alert" ng-reflect-nz-type="alert" class="anticon anticon-alert">
<svg viewBox="64 64 896 896" focusable="false" fill="#ffffff" width="1em" height="1em" data-icon="alert" aria-hidden="true">
<path
d="M517.119 954.878c244.589 0 442.879-198.289 442.879-442.879 0-244.594-198.289-442.879-442.879-442.879C272.524 69.12 74.24 267.404 74.24 511.999 74.24 756.588 272.524 954.878 517.119 954.878L517.119 954.878zM517.119 891.608c-209.654 0-379.612-169.955-379.612-379.609s169.957-379.612 379.612-379.612 379.609 169.957 379.609 379.612S726.773 891.608 517.119 891.608L517.119 891.608zM523.949 243.992c-54.662 0-97.177 16.705-127.547 50.112-30.367 31.885-44.795 74.402-44.795 127.547l59.98 0c0-37.202 8.35-66.052 25.055-87.31 18.222-25.055 46.312-37.202 84.272-37.202 31.885 0 56.945 8.352 74.405 26.572 16.705 16.702 25.81 40.24 25.81 70.607 0 21.26-7.59 41-22.775 59.98-4.55 6.072-13.665 15.185-25.81 27.33-41 36.445-66.055 65.295-76.685 88.075-9.11 18.98-13.665 40.995-13.665 66.05l0 17.465 60.735 0 0-17.465c0-20.5 4.56-38.725 14.43-55.425 7.59-13.665 18.98-27.335 35.68-41.755 33.405-29.612 53.91-49.352 61.5-58.462 18.98-25.055 28.85-54.665 28.85-88.83 0-45.552-14.425-81.235-42.515-107.05C611.258 256.902 572.544 243.992 523.949 243.992L523.949 243.992zM512.564 706.363c-12.907 0-23.535 3.795-32.647 12.905-9.11 8.345-12.905 18.98-12.905 31.885s3.795 23.54 12.905 32.65c9.112 8.345 19.74 12.905 32.647 12.905 12.91 0 23.535-4.56 32.645-12.905 9.11-8.355 13.665-18.985 13.665-32.65 0-12.905-4.555-23.54-12.905-31.885C536.859 710.158 525.474 706.363 512.564 706.363L512.564 706.363z"
fill="#2c2c2c"
p-id="5529"
></path>
</svg>
</i>
<span class="help_link_nav_item hover_blue">{{ 'menu.link.question' | i18n }}</span>
<a class="help_massage_nav_item" [href]="'question.link' | i18n" target="_blank">
<i class="help_link_span" nz-icon nzType="question-circle"></i>
<span class="hover_blue">{{ 'menu.link.question' | i18n }}</span>
</a>
</div>
<div class="flex help_link_nav">
<a [href]="guild_link" target="_blank">
<i nz-icon="" nztype="alert" ng-reflect-nz-type="alert" class="anticon anticon-alert">
<svg focusable="false" fill="#ffffff" width="1em" height="1em" data-icon="alert" aria-hidden="true">
<path
d="M512 0c282.773333 0 512 229.226667 512 512S794.773333 1024 512 1024 0 794.773333 0 512 229.226667 0 512 0z m0 64C264.576 64 64 264.576 64 512s200.576 448 448 448 448-200.576 448-448S759.424 64 512 64z m202.666667 554.666667a32 32 0 0 1 0 64h-405.333334a32 32 0 0 1 0-64h405.333334z m0-149.333334a32 32 0 0 1 0 64h-405.333334a32 32 0 0 1 0-64h405.333334z m-234.666667-149.333333a32 32 0 0 1 0 64h-170.666667a32 32 0 0 1 0-64h170.666667z"
fill="#2c2c2c"
p-id="8407"
></path>
</svg>
</i>
<span class="help_link_nav_item hover_blue">{{ 'menu.link.guild' | i18n }}</span>
<a class="help_massage_nav_item" [href]="guild_link" target="_blank">
<i class="help_link_span" nz-icon nzType="file-search"></i>
<span class="hover_blue">{{ 'menu.link.guild' | i18n }}</span>
</a>
</div>
</div>
@@ -3,12 +3,11 @@
width: 100%;
height: 140px;
overflow-y: hidden;
box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
box-shadow: inset 1px 4px 6px 1px rgb(0 0 0 / 0.05);
border-radius: 5px;
}
.collapsed_content{
overflow-y: hidden;
background-color: white;
height: 131.2px;
}
.help_massage_nav_item {
@@ -16,14 +15,14 @@
}
.help_link_nav_item {
color: black;
//color: black;
}
.flex {
display: flex;
}
.level1_breabcrumb {
.level1_breadcrumb {
height: 28.8px;
background-color: rgba(0, 0, 0, 0.05);
}
@@ -55,7 +54,6 @@
margin-right: 0.8%;
line-height: 28.8px;
height: 28.8px;
}
.help_massage_nav {
@@ -103,10 +101,6 @@
float: left;
}
.anticon {
margin-right: 6px;
}
.help_com_icon {
width: 13px;
height: 13px;
@@ -117,19 +111,9 @@
color: #2b4acb;
}
.help_link {
color: black;
padding-left: 10px;
}
.help_link:hover {
color: #2aa2ee;
}
.handover_button_content {
border: none;
background-color: transparent;
color: rgb(70, 70, 70);
}
.handover_button_content:hover {
@@ -137,8 +121,7 @@
}
.help_link_span {
margin-left: 13px;
margin-right: 13px;
margin-right: 6px;
}
.help_com_icon {
+8 -8
View File
@@ -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",
@@ -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",
+1 -1
View File
@@ -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}} 秒自动刷新",
+1 -1
View File
@@ -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}} 秒自動刷新",
File diff suppressed because one or more lines are too long
+4
View File
@@ -90,3 +90,7 @@
.sidebar-nav__sub-arrow::before, .sidebar-nav__sub-arrow::after {
height: 2.5px
}
.content_bg_color {
background-color: white;
}