From 593c21c0c1fb8625ce220ceaab55e129affe0a90 Mon Sep 17 00:00:00 2001 From: Wangjunqi123 Date: Wed, 1 Nov 2023 09:55:31 +0800 Subject: [PATCH] define prometheus configuration --- conf/config_server.yaml.templete | 11 ++++++++--- server/conf/config.go | 20 ++++++++++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/conf/config_server.yaml.templete b/conf/config_server.yaml.templete index 4525f75..e65faa1 100644 --- a/conf/config_server.yaml.templete +++ b/conf/config_server.yaml.templete @@ -1,7 +1,8 @@ topo: server_addr: "localhost:9991" + use: true agent_port: "9992" - database: "neo4j" + graphDB: "neo4j" period: 5 PilotGo: http_addr: "localhost:8888" @@ -12,7 +13,11 @@ log: max_file: 1 max_size: 10485760 neo4j: - addr: "bolt://10.41.121.1:7687" + addr: "bolt://localhost:7687" username: "" password: "" - DB: "neo4j" \ No newline at end of file + DB: "neo4j" +prometheus: + use: false + addr: "http://localhost:9090" + period: 5 \ No newline at end of file diff --git a/server/conf/config.go b/server/conf/config.go index a0084e6..dcb62f4 100644 --- a/server/conf/config.go +++ b/server/conf/config.go @@ -8,8 +8,9 @@ import ( type TopoConf struct { Server_addr string `yaml:"server_addr"` + Use bool `yaml:"use"` Agent_port string `yaml:"agent_port"` - Database string `yaml:"database"` + GraphDB string `yaml:"graphDB"` Period int64 `yaml:"period"` } @@ -29,12 +30,19 @@ type Neo4jConf struct { DB string `yaml:"DB"` } +type PrometheusConf struct { + Use bool `yaml:"use"` + Addr string `yaml:"addr"` + Period int64 `yaml:"period"` +} + type ServerConfig struct { - Topo *TopoConf `yaml:"topo"` - PilotGo *PilotGoConf `yaml:"PilotGo"` - Logopts *logger.LogOpts `yaml:"log"` - Arangodb *ArangodbConf `yaml:"arangodb"` - Neo4j *Neo4jConf `yaml:"neo4j"` + Topo *TopoConf `yaml:"topo"` + PilotGo *PilotGoConf `yaml:"PilotGo"` + Logopts *logger.LogOpts `yaml:"log"` + Arangodb *ArangodbConf `yaml:"arangodb"` + Neo4j *Neo4jConf `yaml:"neo4j"` + Prometheus *PrometheusConf `yaml:"prometheus"` } const config_type = "config_server.yaml" -- Gitee