|
@@ -9,6 +9,7 @@ import (
|
|
|
"github.com/coroot/coroot-node-agent/utils"
|
|
"github.com/coroot/coroot-node-agent/utils"
|
|
|
"github.com/coroot/coroot-node-agent/utils/enums"
|
|
"github.com/coroot/coroot-node-agent/utils/enums"
|
|
|
"github.com/coroot/coroot-node-agent/utils/namedpipe"
|
|
"github.com/coroot/coroot-node-agent/utils/namedpipe"
|
|
|
|
|
+ "github.com/coroot/coroot-node-agent/utils/try"
|
|
|
dto "github.com/prometheus/client_model/go"
|
|
dto "github.com/prometheus/client_model/go"
|
|
|
log "github.com/sirupsen/logrus"
|
|
log "github.com/sirupsen/logrus"
|
|
|
"io"
|
|
"io"
|
|
@@ -16,6 +17,7 @@ import (
|
|
|
_ "net/http/pprof"
|
|
_ "net/http/pprof"
|
|
|
"os"
|
|
"os"
|
|
|
"path"
|
|
"path"
|
|
|
|
|
+ "path/filepath"
|
|
|
"regexp"
|
|
"regexp"
|
|
|
"runtime"
|
|
"runtime"
|
|
|
"strconv"
|
|
"strconv"
|
|
@@ -218,6 +220,9 @@ func main() {
|
|
|
npCtl.AcceptAndDisposeMsg(cr)
|
|
npCtl.AcceptAndDisposeMsg(cr)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //heartbeat
|
|
|
|
|
+ try.GoParams(containers.DoHeartbeat, utils.CatchFn, filepath.Join(utils.GetRootPath(), "heartbeat"))
|
|
|
|
|
+
|
|
|
//profiling.Start()
|
|
//profiling.Start()
|
|
|
//defer profiling.Stop()
|
|
//defer profiling.Stop()
|
|
|
// 创建一个/metrics路由处理函数
|
|
// 创建一个/metrics路由处理函数
|