-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
34 lines (28 loc) · 770 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package main
import (
"github.com/fatih/structs"
conf "github.com/elliott-davis/solaredge-exporter/config"
"github.com/elliott-davis/solaredge-exporter/exporter"
"github.com/elliott-davis/solaredge-exporter/http"
"github.com/infinityworks/go-common/logger"
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"
)
var (
log *logrus.Logger
applicationCfg conf.Config
mets map[string]*prometheus.Desc
)
func init() {
applicationCfg = conf.Init()
mets = exporter.AddMetrics()
log = logger.Start(&applicationCfg)
}
func main() {
log.WithFields(structs.Map(applicationCfg)).Info("Starting Exporter")
exp := exporter.Exporter{
APIMetrics: mets,
Config: applicationCfg,
}
http.NewServer(exp).Start()
}