mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
bump prerelease
This commit is contained in:
15 files changed
+36
-40
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { hostname } from 'os';
|
||||
import { AggregatorRegistry, Metric } from 'prom-client';
|
||||
import {
|
||||
Context, Handler, superagent, SystemModel,
|
||||
Context, Handler, Schema, superagent, SystemModel,
|
||||
} from 'hydrooj';
|
||||
import { createRegistry } from './metrics';
|
||||
|
||||
@@ -43,6 +43,14 @@ class MetricsHandler extends Handler {
|
||||
}
|
||||
|
||||
export function apply(ctx: Context) {
|
||||
ctx.setting.SystemSetting(Schema.object({
|
||||
'prom-client': Schema.object({
|
||||
name: Schema.string().description('basic auth username while requesting metrics').default('admin'),
|
||||
password: Schema.string().role('password').description('basic auth password while requesting metrics').default('admin'),
|
||||
gateway: Schema.string().role('gateway').description('Leave blank to disable push gateway').default(''),
|
||||
collect_rate: Schema.number().role('collect_rate').default(1).description('Collect rate'),
|
||||
}),
|
||||
}));
|
||||
if (process.env.HYDRO_CLI) return;
|
||||
const registry = createRegistry(ctx);
|
||||
ctx.on('metrics', (id, metrics) => { instances[id] = metrics; });
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/prom-client",
|
||||
"version": "0.1.10",
|
||||
"version": "0.2.0-alpha.0",
|
||||
"main": "index.ts",
|
||||
"dependencies": {
|
||||
"prom-client": "^15.1.3"
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
name:
|
||||
type: text
|
||||
name: Auth Username
|
||||
desc: basic auth username while requesting metrics
|
||||
default: admin
|
||||
password:
|
||||
type: password
|
||||
name: Auth Password
|
||||
desc: basic auth password while requesting metrics
|
||||
default: admin
|
||||
collect_rate:
|
||||
type: number
|
||||
name: Collect Rate
|
||||
desc: The collect rate scale (default:1)
|
||||
default: 1
|
||||
gateway:
|
||||
type: text
|
||||
name: Push gateway endpoint
|
||||
desc: Leave blank to disable push gateway
|
||||
default: ""
|
||||
Reference in new issue
Block a user