-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
29 lines (24 loc) · 795 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
package main
import (
"os"
"github.com/dmartinol/application-exporter/pkg/config"
exp "github.com/dmartinol/application-exporter/pkg/exporter"
logger "github.com/dmartinol/application-exporter/pkg/log"
"github.com/dmartinol/application-exporter/pkg/monitor"
)
var BuildVersion = "development"
func main() {
config := config.NewConfig()
logger.InitLogger(config.RunInVM(), config.LogLevel())
logger.Infof("The version of %s is : %s\n", os.Args[0], BuildVersion)
logger.Infof("Config is %v+", config)
var exporter exp.Exporter
if config.RunAsScript() {
exporter = exp.NewExporterApp(config)
} else if config.RunAsMonitoring() {
exporter = monitor.NewExporterMetrics(config)
} else if config.RunAsService() {
exporter = exp.NewExporterService(config)
}
exporter.Start()
}