mirror of
https://github.com/ClusterCockpit/cc-metric-collector.git
synced 2025-12-19 05:36:17 +01:00
Add ccStartup
This commit is contained in:
@@ -36,10 +36,9 @@ There is a main configuration file with basic settings that point to the other c
|
||||
"collectors-file" : "collectors.json",
|
||||
"receivers-file" : "receivers.json",
|
||||
"router-file" : "router.json",
|
||||
"main": {
|
||||
"interval": "10s",
|
||||
"duration": "1s"
|
||||
}
|
||||
"startup-file": "startup.json",
|
||||
"interval": "10s",
|
||||
"duration": "1s"
|
||||
}
|
||||
```
|
||||
|
||||
@@ -51,6 +50,7 @@ See the component READMEs for their configuration:
|
||||
* [`sinks`](https://github.com/ClusterCockpit/cc-lib/blob/main/sinks/README.md)
|
||||
* [`receivers`](https://github.com/ClusterCockpit/cc-lib/blob/main/receivers/README.md)
|
||||
* [`router`](./internal/metricRouter/README.md)
|
||||
* [`startup`](https://github.com/ClusterCockpit/cc-lib/blob/main/ccStartup/README.md)
|
||||
|
||||
# Installation
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import (
|
||||
ccconf "github.com/ClusterCockpit/cc-lib/ccConfig"
|
||||
cclog "github.com/ClusterCockpit/cc-lib/ccLogger"
|
||||
lp "github.com/ClusterCockpit/cc-lib/ccMessage"
|
||||
start "github.com/ClusterCockpit/cc-lib/ccStartup"
|
||||
mr "github.com/ClusterCockpit/cc-metric-collector/internal/metricRouter"
|
||||
mct "github.com/ClusterCockpit/cc-metric-collector/pkg/multiChanTicker"
|
||||
)
|
||||
@@ -216,6 +217,14 @@ func mainFunc() int {
|
||||
return 1
|
||||
}
|
||||
|
||||
startupConf := ccconf.GetPackageConfig("startup")
|
||||
if len(collectorConf) > 0 {
|
||||
err := start.CCStartup(startupConf)
|
||||
if err != nil {
|
||||
cclog.Errorf("Sending startup topology failed: %s", err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
// Set log file
|
||||
// if logfile := rcfg.CliArgs["logfile"]; logfile != "stderr" {
|
||||
// cclog.SetOutput(logfile)
|
||||
|
||||
Reference in New Issue
Block a user