daemon: expose prometheus in new global.monitoring config section + document it

refs #67
This commit is contained in:
Christian Schwarz
2018-04-14 11:24:47 +02:00
parent a4da029105
commit 82ea535692
10 changed files with 71 additions and 10 deletions
+3 -4
View File
@@ -12,6 +12,7 @@ import (
)
type PrometheusJob struct {
Name string
Listen string
}
@@ -55,12 +56,10 @@ func parsePrometheusJob(c JobParsingContext, name string, i map[string]interface
if s.Listen == "" {
return nil, errors.New("must specify 'listen' attribute")
}
return &PrometheusJob{s.Listen}, nil
return &PrometheusJob{name, s.Listen}, nil
}
func (*PrometheusJob) JobName() string {
return "prometheus"
}
func (j *PrometheusJob) JobName() string { return j.Name }
func (j *PrometheusJob) JobType() JobType { return JobTypePrometheus }