|
|
@ -10,27 +10,23 @@ const {R} = require("redbean-node");
|
|
|
|
const {BeanModel} = require("redbean-node/dist/bean-model");
|
|
|
|
const {BeanModel} = require("redbean-node/dist/bean-model");
|
|
|
|
const {Notification} = require("../notification")
|
|
|
|
const {Notification} = require("../notification")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const commonLabels = [
|
|
|
|
|
|
|
|
'monitor_name',
|
|
|
|
|
|
|
|
'monitor_type',
|
|
|
|
|
|
|
|
'monitor_url',
|
|
|
|
|
|
|
|
'monitor_hostname',
|
|
|
|
|
|
|
|
'monitor_port',
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
const monitor_response_time = new Prometheus.Gauge({
|
|
|
|
const monitor_response_time = new Prometheus.Gauge({
|
|
|
|
name: 'monitor_response_time',
|
|
|
|
name: 'monitor_response_time',
|
|
|
|
help: 'Monitor Response Time (ms)',
|
|
|
|
help: 'Monitor Response Time (ms)',
|
|
|
|
labelNames: [
|
|
|
|
labelNames: commonLabels
|
|
|
|
'monitor_name',
|
|
|
|
|
|
|
|
'monitor_type',
|
|
|
|
|
|
|
|
'monitor_url',
|
|
|
|
|
|
|
|
'monitor_hostname',
|
|
|
|
|
|
|
|
'monitor_port'
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const monitor_status = new Prometheus.Gauge({
|
|
|
|
const monitor_status = new Prometheus.Gauge({
|
|
|
|
name: 'monitor_status',
|
|
|
|
name: 'monitor_status',
|
|
|
|
help: 'Monitor Status (1 = UP, 0= DOWN)',
|
|
|
|
help: 'Monitor Status (1 = UP, 0= DOWN)',
|
|
|
|
labelNames: [
|
|
|
|
labelNames: commonLabels
|
|
|
|
'monitor_name',
|
|
|
|
|
|
|
|
'monitor_type',
|
|
|
|
|
|
|
|
'monitor_url',
|
|
|
|
|
|
|
|
'monitor_hostname',
|
|
|
|
|
|
|
|
'monitor_port'
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* status:
|
|
|
|
* status:
|
|
|
|