forked from dodobrands/jaeger-kusto
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
47 lines (37 loc) · 1.23 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
package main
import (
"flag"
"os"
"github.com/dodopizza/jaeger-kusto/runner"
"github.com/dodopizza/jaeger-kusto/config"
"github.com/dodopizza/jaeger-kusto/store"
)
func main() {
configPath := ""
flag.StringVar(&configPath, "config", "", "The path to the plugin's configuration file")
flag.Parse()
pluginConfig, err := config.ParseConfig(configPath)
if err != nil {
os.Exit(1)
}
logger := config.NewLogger(pluginConfig)
logger.Info("plugin config", "config", pluginConfig)
if err := config.ServeDiagnosticsServer(pluginConfig, logger); err != nil {
logger.Error("error occurred while starting diagnostics server", "error", err)
os.Exit(1)
}
kustoConfig, err := config.ParseKustoConfig(pluginConfig.KustoConfigPath, pluginConfig.ReadNoTruncation, pluginConfig.ReadNoTimeout)
if err != nil {
logger.Error("error occurred while reading kusto configuration", "error", err)
os.Exit(1)
}
kustoStore, err := store.NewStore(pluginConfig, kustoConfig, logger)
if err != nil {
logger.Error("error occurred while initializing kusto storage", "error", err)
os.Exit(2)
}
if err := runner.Serve(pluginConfig, kustoStore, logger); err != nil {
logger.Error("error occurred while invoking runner", "error", err)
os.Exit(3)
}
}