add monitoring via prometheus

This commit is contained in:
garionion 2020-12-27 16:52:31 +01:00
parent 9ed2982253
commit 3c82aa0308
5 changed files with 166 additions and 21 deletions

View file

@ -16,7 +16,7 @@ type Store struct {
sync.RWMutex
}
func NewStore(o []string, defaultDuration string, playoutScriptPath string, playoutScript string, tmpDir string) (*Store, error) {
func NewStore(o []string, defaultDuration string, playoutScriptPath string, playoutScript string, tmpDir string, prometheus string) (*Store, error) {
playouts := make(map[int]*playout.Job)
var d time.Duration
@ -25,9 +25,10 @@ func NewStore(o []string, defaultDuration string, playoutScriptPath string, play
log.Fatal("Failed to set Default Duration: ", err)
}
pcfg := playout.Config{
PlayoutScriptPath: playoutScriptPath,
PlayoutScript: playoutScript,
ProgressDir: tmpDir,
PlayoutScriptPath: playoutScriptPath,
PlayoutScript: playoutScript,
ProgressDir: tmpDir,
PrometheusPushGateway: prometheus,
}
store := &Store{Playouts: playouts, DefaultDuration: d, Outputs: o, Config: &pcfg}