mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 02:38:17 +08:00
[FIX] fix bug
This commit is contained in:
parent
47a8174284
commit
cf621c74c0
@ -1,8 +1,9 @@
|
||||
package exector
|
||||
package monitor
|
||||
|
||||
import (
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/goodrain/rainbond/builder/discover"
|
||||
"github.com/goodrain/rainbond/builder/exector"
|
||||
)
|
||||
|
||||
// Metric name parts.
|
||||
@ -78,6 +79,6 @@ func (e *Exporter) scrape(ch chan<- prometheus.Metric) {
|
||||
}
|
||||
|
||||
ch <- prometheus.MustNewConstMetric(e.healthStatus.Desc(), prometheus.GaugeValue, val)
|
||||
ch <- prometheus.MustNewConstMetric(e.taskNum.Desc(), prometheus.GaugeValue, TaskNum)
|
||||
ch <- prometheus.MustNewConstMetric(e.taskError.Desc(), prometheus.GaugeValue, ErrorNum)
|
||||
ch <- prometheus.MustNewConstMetric(e.taskNum.Desc(), prometheus.GaugeValue, exector.TaskNum)
|
||||
ch <- prometheus.MustNewConstMetric(e.taskError.Desc(), prometheus.GaugeValue, exector.ErrorNum)
|
||||
}
|
@ -25,6 +25,7 @@ import (
|
||||
|
||||
"github.com/goodrain/rainbond/builder/discover"
|
||||
"github.com/goodrain/rainbond/builder/exector"
|
||||
"github.com/goodrain/rainbond/builder/monitor"
|
||||
"github.com/goodrain/rainbond/cmd/builder/option"
|
||||
"github.com/goodrain/rainbond/db"
|
||||
"github.com/goodrain/rainbond/db/config"
|
||||
@ -82,7 +83,7 @@ func Run(s *option.Builder) error {
|
||||
}
|
||||
defer cle.Stop()
|
||||
|
||||
exporter := exector.NewExporter()
|
||||
exporter := monitor.NewExporter()
|
||||
prometheus.MustRegister(exporter)
|
||||
r := api.APIServer()
|
||||
r.Handle(s.Config.PrometheusMetricPath, promhttp.Handler())
|
||||
|
Loading…
Reference in New Issue
Block a user