Closed ZhiXingHeYiApple closed 2 years ago
描述您遇到的bug 我们想用open-monitor整合外部已经搭建好的prometheus和alertmanager。目前文档并没有对这块有任何说明,有这方面的文档可以提供吗?
目前修改了启动脚本start.sh和monitor/conf/default.json, 然后在kubernetes容器启动时,把这两个文件挂载替换掉。但是目前open-monitor启动后总是报错,我还需要修改哪一块配置吗?。这两个文件的修改情况如下: start.sh
start.sh
monitor/conf/default.json
#!/bin/bash echo "start run" laststr=`echo ${MONITOR_HOST_IP}|awk -F '' '{print $NF}'` subnum='3' if [ $laststr ] then subnum=`expr $laststr % 5` fi sed -i "s~{{MONITOR_SERVER_PORT}}~$MONITOR_SERVER_PORT~g" alertmanager/alertmanager.yml sed -i "s~{{MONITOR_ALERT_WAIT}}~${subnum}~g" alertmanager/alertmanager.yml # 修改脚本的原因:该配置文件采用外部挂载的方式,会报类似 sed: can't move 'monitor/conf/final-config.jsonMlejAa' to 'monitor/conf/final-config.json': Resource busy 的异常。具体参考:https://lanseyujie.com/post/careful-use-i-parameter-in-sed.html cat monitor/conf/default.json | sed "s~{{MONITOR_SERVER_PORT}}~$MONITOR_SERVER_PORT~g" | \ sed "s~{{MONITOR_DB_HOST}}~$MONITOR_DB_HOST~g" | \ sed "s~{{MONITOR_DB_PORT}}~$MONITOR_DB_PORT~g" | \ sed "s~{{MONITOR_DB_USER}}~$MONITOR_DB_USER~g" | \ sed "s~{{MONITOR_DB_PWD}}~$MONITOR_DB_PWD~g" | \ sed "s~{{MONITOR_ARCHIVE_ENABLE}}~$MONITOR_ARCHIVE_ENABLE~g" | \ sed "s~{{MONITOR_ARCHIVE_MYSQL_HOST}}~$MONITOR_ARCHIVE_MYSQL_HOST~g" | \ sed "s~{{MONITOR_ARCHIVE_MYSQL_PORT}}~$MONITOR_ARCHIVE_MYSQL_PORT~g" | \ sed "s~{{MONITOR_ARCHIVE_MYSQL_USER}}~$MONITOR_ARCHIVE_MYSQL_USER~g" | \ sed "s~{{MONITOR_ARCHIVE_MYSQL_PWD}}~$MONITOR_ARCHIVE_MYSQL_PWD~g" | \ sed "s~{{MONITOR_ALARM_ALIVE_MAX_DAY}}~$MONITOR_ALARM_ALIVE_MAX_DAY~g" | \ sed "s~{{MONITOR_LOG_LEVEL}}~$MONITOR_LOG_LEVEL~g" | \ sed "s~{{MONITOR_DATASOURCE_ENV}}~$MONITOR_DATASOURCE_ENV~g" | \ sed "s~{{MONITOR_DATASOURCE_HOST}}~$MONITOR_DATASOURCE_HOST~g" > monitor/conf/final-config.json sed -i "s~{{MONITOR_DB_HOST}}~$MONITOR_DB_HOST~g" archive_mysql_tool/default.json sed -i "s~{{MONITOR_DB_PORT}}~$MONITOR_DB_PORT~g" archive_mysql_tool/default.json sed -i "s~{{MONITOR_DB_USER}}~$MONITOR_DB_USER~g" archive_mysql_tool/default.json sed -i "s~{{MONITOR_DB_PWD}}~$MONITOR_DB_PWD~g" archive_mysql_tool/default.json sed -i "s~{{MONITOR_ARCHIVE_ENABLE}}~$MONITOR_ARCHIVE_ENABLE~g" archive_mysql_tool/default.json sed -i "s~{{MONITOR_ARCHIVE_MYSQL_HOST}}~$MONITOR_ARCHIVE_MYSQL_HOST~g" archive_mysql_tool/default.json sed -i "s~{{MONITOR_ARCHIVE_MYSQL_PORT}}~$MONITOR_ARCHIVE_MYSQL_PORT~g" archive_mysql_tool/default.json sed -i "s~{{MONITOR_ARCHIVE_MYSQL_USER}}~$MONITOR_ARCHIVE_MYSQL_USER~g" archive_mysql_tool/default.json sed -i "s~{{MONITOR_ARCHIVE_MYSQL_PWD}}~$MONITOR_ARCHIVE_MYSQL_PWD~g" archive_mysql_tool/default.json if [ $GATEWAY_URL ] then sed -i "s~{{CORE_ADDR}}~$GATEWAY_URL~g" monitor/conf/final-config.json else sed -i "s~{{CORE_ADDR}}~$CORE_ADDR~g" monitor/conf/final-config.json fi sed -i "s~{{MONITOR_SERVER_IP}}~$MONITOR_HOST_IP~g" monitor/conf/final-config.json if [ $MONITOR_SESSION_ENABLE ] then sed -i "s~{{MONITOR_SESSION_ENABLE}}~true~g" monitor/conf/final-config.json else sed -i "s~{{MONITOR_SESSION_ENABLE}}~false~g" monitor/conf/final-config.json fi if [ $PLUGIN_MODE ] then sed -i "s~{{PLUGIN_MODE}}~yes~g" monitor/conf/final-config.json else sed -i "s~{{PLUGIN_MODE}}~no~g" monitor/conf/final-config.json fi cd alertmanager #mkdir -p logs #nohup ./alertmanager --config.file=alertmanager.yml --web.listen-address=":9093" --cluster.listen-address=":9094" > logs/alertmanager.log 2>&1 & #cd ../prometheus/ #mkdir -p rules #mkdir -p logs #/bin/cp -f base.yml rules/ #nohup ./prometheus --config.file=prometheus.yml --web.enable-lifecycle --storage.tsdb.retention.time=30d > logs/prometheus.log 2>&1 & cd ../agent_manager/ mkdir -p logs tar zxf exporters.tar.gz nohup ./agent_manager > logs/app.log 2>&1 & cd ../ping_exporter/ mkdir -p logs nohup ./ping_exporter > logs/app.log 2>&1 & cd ../transgateway/ mkdir -p logs mkdir -p data nohup ./transgateway -d data -m http://127.0.0.1:8080 > logs/app.log 2>&1 & cd ../archive_mysql_tool mkdir -p logs nohup ./archive_mysql_tool > logs/app.log 2>&1 & cd ../db_data_exporter mkdir -p logs nohup ./db_data_exporter > logs/app.log 2>&1 & cd ../monitor/ mkdir -p logs sleep 2 ./monitor-server -c conf/final-config.json
{ "is_plugin_mode": "{{PLUGIN_MODE}}", "http": { "port": "8080", "swagger": false, "cross": false, "return_error": true, "alive": 2591000, "ldap": { "enable": false, "server": "127.0.0.1", "port": 389, "bindDN": "%s@test.com", "baseDN": "ou=Users_Employee", "filter": "(sAMAccountName=%s)", "attributes": [ "name", "mail", "telephoneNumber" ] }, "log": { "level": "{{MONITOR_LOG_LEVEL}}", "file": "logs/open-monitor.log", "access_file": "logs/open-monitor-access.log", "archive_max_size": 64, "archive_max_backup": 10, "archive_max_day": 15, "compress": true }, "session": { "enable": {{MONITOR_SESSION_ENABLE}}, "expire": 3600, "server_enable": true, "server_token": "default-token-used-in-server-side", "redis": { "enable": false, "server": "127.0.0.1", "port": 6379, "pwd": "wecube", "db": 0, "maxIdle": 10 } }, "default_language": "en" }, "store": { "name": "default", "type": "mysql", "server": "{{MONITOR_DB_HOST}}", "port": {{MONITOR_DB_PORT}}, "user": "{{MONITOR_DB_USER}}", "pwd": "{{MONITOR_DB_PWD}}", "database": "monitor", "maxOpen": 20, "maxIdle": 10, "timeout": 60 }, "datasource": { "env": "{{MONITOR_DATASOURCE_ENV}}", "servers": [ { "id": 1, "type": "prometheus", "env": "{{MONITOR_DATASOURCE_ENV}}", "host": "{{MONITOR_DATASOURCE_HOST}}", "token": "" } ], "divide_time": 1, "wait_time": 1 }, "limitIp": [ "*" ], "dependence": [ { "name": "consul", "server": "http://127.0.0.1:8500", "username": "", "password": "", "expire": 0 }, { "name": "agent_manager", "server": "http://127.0.0.1:19999", "username": "", "password": "", "expire": 0 }, { "name": "core", "server": "{{CORE_ADDR}}", "username": "", "password": "", "expire": 0 }, { "name": "db_data_exporter", "server": "http://127.0.0.1:9192", "username": "", "password": "", "expire": 0 } ], "prometheus": { "sd_config_path": "/app/monitor/prometheus/sd_file", "rule_config_path": "/app/monitor/prometheus/rules", "config_reload": "http://{{MONITOR_DATASOURCE_HOST}}/-/reload" }, "tag_blacklist": [ "veth" ], "agent": [ { "agent_type": "host", "agent_bin": "node_exporter_new", "port": "9100" }, { "agent_type": "mysql", "agent_bin": "mysqld_exporter", "port": "9104", "user": "exporter", "password": "prom_pwd", "config_file": "my.cnf" }, { "agent_type": "redis", "agent_bin": "redis_exporter", "port": "9121", "user": "exporter", "password": "", "config_file": "" }, { "agent_type": "java", "agent_bin": "tomcat_exporter", "port": "9151", "user": "exporter", "password": "prom_pwd", "config_file": "config.yaml" }, { "agent_type": "nginx", "agent_bin": "nginx_exporter", "port": "80", "user": "exporter", "password": "prom_pwd", "config_file": "" } ], "alert": { "enable": false, "mail": { "enable": true, "protocol": "smtp", "tls": true, "sender": "open-monitor", "user": "", "password": "", "server": "", "token": "" } }, "peer": { "enable": true, "instance_host_ip": "{{MONITOR_SERVER_IP}}", "http_port": "14241", "other_server_list": [] }, "cron_job": { "enable": true, "interval": 60 }, "sd_file": { "enable": true, "path": "/app/monitor/prometheus/sd_file/" }, "archive_mysql": { "enable": "{{MONITOR_ARCHIVE_ENABLE}}", "server": "{{MONITOR_ARCHIVE_MYSQL_HOST}}", "port": "{{MONITOR_ARCHIVE_MYSQL_PORT}}", "user": "{{MONITOR_ARCHIVE_MYSQL_USER}}", "password": "{{MONITOR_ARCHIVE_MYSQL_PWD}}", "database_prefix": "prometheus_archive_", "max_open": 100, "max_idle": 10, "timeout": 60, "local_storage_max_day": 30, "five_min_start_day": 90 }, "process_check_list": [ "ping_exporter", "agent_manager" ], "default_admin_role": "SUPER_ADMIN", "alarm_alive_max_day": {{MONITOR_ALARM_ALIVE_MAX_DAY}} }
现在运行后,容器crash报错如下:
start run 2021/12/11 10:18:34 Read rsa pem file fail,open /data/certs/rsa_key: no such file or directory 2021/12/11 10:18:34 read config file: conf/final-config.json successfully 2021/12/11 10:18:34 Init core token fail,coreUrl & subSystemCode & subSystemKey can not empty 2021/12/11 10:18:34 init local time zone to UTC [GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production. - using env: export GIN_MODE=release - using code: gin.SetMode(gin.ReleaseMode) [GIN-debug] Loaded HTML Templates (2): - - index.html [GIN-debug] GET /monitor/js/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (1 handlers) [GIN-debug] HEAD /monitor/js/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (1 handlers) [GIN-debug] GET /monitor/css/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (1 handlers) [GIN-debug] HEAD /monitor/css/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (1 handlers) [GIN-debug] GET /monitor/img/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (1 handlers) [GIN-debug] HEAD /monitor/img/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (1 handlers) [GIN-debug] GET /monitor/fonts/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (1 handlers) [GIN-debug] HEAD /monitor/fonts/*filepath --> github.com/gin-gonic/gin.(*RouterGroup).createStaticHandler.func1 (1 handlers) [GIN-debug] GET /favicon.ico --> github.com/gin-gonic/gin.(*RouterGroup).StaticFile.func1 (1 handlers) [GIN-debug] HEAD /favicon.ico --> github.com/gin-gonic/gin.(*RouterGroup).StaticFile.func1 (1 handlers) [GIN-debug] GET /monitor/ --> github.com/WeBankPartners/open-monitor/monitor-server/api.InitHttpServer.func1 (1 handlers) [GIN-debug] POST /monitor/login --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/user.Login (3 handlers) [GIN-debug] POST /monitor/register --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/user.Register (3 handlers) [GIN-debug] GET /monitor/logout --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/user.Logout (3 handlers) [GIN-debug] GET /monitor/check --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/user.HealthCheck (3 handlers) [GIN-debug] GET /monitor/demo --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.DisplayWatermark (3 handlers) [GIN-debug] POST /monitor/webhook --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.AcceptAlertMsg (3 handlers) [GIN-debug] POST /monitor/openapi/alarm/send --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.OpenAlarmApi (3 handlers) [GIN-debug] POST /monitor/entities/alarm/query --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.QueryEntityAlarm (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/main --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.MainDashboard (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/panels --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.GetPanels (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/tags --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.GetTags (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/search --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.MainSearch (4 handlers) [GIN-debug] POST /monitor/api/v1/dashboard/newchart --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.GetChart (4 handlers) [GIN-debug] POST /monitor/api/v1/dashboard/chart --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard_new.GetChartData (4 handlers) [GIN-debug] POST /monitor/api/v1/dashboard/config/chart/title --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.UpdateChartsTitle (4 handlers) [GIN-debug] POST /monitor/api/v1/dashboard/pie/chart --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.GetPieChart (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/custom/list --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.ListCustomDashboard (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/custom/get --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.GetCustomDashboard (4 handlers) [GIN-debug] POST /monitor/api/v1/dashboard/custom/save --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.SaveCustomDashboard (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/custom/delete --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.DeleteCustomDashboard (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/server/chart --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.GetChartsByEndpoint (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/custom/main/get --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.GetMainPage (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/custom/main/list --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.ListMainPageRole (4 handlers) [GIN-debug] POST /monitor/api/v1/dashboard/custom/main/set --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.UpdateMainPage (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/custom/endpoint/get --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.GetEndpointsByIp (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/custom/role/get --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.GetCustomDashboardRole (4 handlers) [GIN-debug] POST /monitor/api/v1/dashboard/custom/role/save --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.SaveCustomDashboardRole (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/custom/alarm/list --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.GetCustomDashboardAlarm (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/config/metric/list --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.GetPromMetric (4 handlers) [GIN-debug] POST /monitor/api/v1/dashboard/system/add --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.ExportPanelAdd (4 handlers) [GIN-debug] POST /monitor/api/v1/dashboard/system/delete --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.ExportPanelDelete (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/recursive/get --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.GetPanelRecursive (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/recursive/endpoint_type/list --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.GetPanelRecursiveEndpointType (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/endpoint/type --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.GetEndpointTypeList (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/endpoint --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.GetEndpointList (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/endpoint/metric/list --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard.GetEndpointMetric (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/new/metric --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard_new.MetricList (4 handlers) [GIN-debug] POST /monitor/api/v1/dashboard/new/metric --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard_new.MetricCreate (4 handlers) [GIN-debug] PUT /monitor/api/v1/dashboard/new/metric --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard_new.MetricUpdate (4 handlers) [GIN-debug] DELETE /monitor/api/v1/dashboard/new/metric --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard_new.MetricDelete (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/new/panel --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard_new.PanelList (4 handlers) [GIN-debug] POST /monitor/api/v1/dashboard/new/panel/:endpointType --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard_new.PanelCreate (4 handlers) [GIN-debug] PUT /monitor/api/v1/dashboard/new/panel --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard_new.PanelUpdate (4 handlers) [GIN-debug] DELETE /monitor/api/v1/dashboard/new/panel --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard_new.PanelDelete (4 handlers) [GIN-debug] GET /monitor/api/v1/dashboard/new/chart --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard_new.ChartList (4 handlers) [GIN-debug] POST /monitor/api/v1/dashboard/new/chart --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard_new.ChartCreate (4 handlers) [GIN-debug] PUT /monitor/api/v1/dashboard/new/chart --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard_new.ChartUpdate (4 handlers) [GIN-debug] DELETE /monitor/api/v1/dashboard/new/chart --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/dashboard_new.ChartDelete (4 handlers) [GIN-debug] POST /monitor/api/v1/agent/register --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.RegisterAgentNew (4 handlers) [GIN-debug] GET /monitor/api/v1/agent/deregister --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.DeregisterAgent (4 handlers) [GIN-debug] POST /monitor/api/v1/agent/custom/endpoint/add --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.CustomRegister (4 handlers) [GIN-debug] POST /monitor/api/v1/agent/custom/metric/add --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.CustomMetricPush (4 handlers) [GIN-debug] GET /monitor/api/v1/agent/endpoint/telnet/get --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.GetEndpointTelnet (4 handlers) [GIN-debug] POST /monitor/api/v1/agent/endpoint/telnet/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.UpdateEndpointTelnet (4 handlers) [GIN-debug] POST /monitor/api/v1/agent/kubernetes/cluster/:operation --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.UpdateKubernetesCluster (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/endpoint/list --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.ListGrpEndpoint (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/endpoint/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.EditGrpEndpoint (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/process/list --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.GetEndpointProcessConfig (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/process/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.UpdateEndpointProcessConfig (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/window/get --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.GetAlertWindowList (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/window/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.UpdateAlertWindow (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/db/monitor/list --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.GetDbMonitorList (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/db/monitor/add --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.AddDbMonitor (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/db/monitor/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.UpdateDbMonitor (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/db/monitor/check --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.CheckDbMonitor (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/db/monitor/delete --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.DeleteDbMonitor (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/db/monitor/sys/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.UpdateDbMonitorSysName (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/grp/list --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.ListGrp (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/grp/add --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.AddGrp (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/grp/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.UpdateGrp (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/grp/delete --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.DeleteGrp (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/grp/role/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.UpdateGrpRole (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/grp/role/get --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.GetGrpRole (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/endpoint/grp/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.EditEndpointGrp (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/grp/export --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.ExportGrpStrategy (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/grp/import --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.ImportGrpStrategy (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/strategy/search --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.SearchObjOption (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/strategy/list --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.ListTpl (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/strategy/add --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.AddStrategy (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/strategy/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.EditStrategy (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/strategy/delete --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.DeleteStrategy (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/action/search --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.SearchUserRole (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/action/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.UpdateTplAction (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/history --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.GetHistoryAlarm (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/problem/list --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.GetProblemAlarm (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/problem/query --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.QueryProblemAlarm (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/problem/close --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.CloseAlarm (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/problem/history --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.QueryHistoryAlarm (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/problem/message --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.UpdateAlarmCustomMessage (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/log/monitor/list --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.ListLogTpl (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/log/monitor/add --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.AddLogStrategy (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/log/monitor/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.EditLogStrategy (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/log/monitor/update_path --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.EditLogPath (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/log/monitor/delete --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.DeleteLogStrategy (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/log/monitor/delete_path --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.DeleteLogPath (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/business/list --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.GetEndpointBusinessConfig (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/business/add --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.AddEndpointBusinessConfig (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/business/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.UpdateEndpointBusinessConfig (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/org/panel/get --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.GetOrganizaionList (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/org/panel/:name --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.UpdateOrgPanel (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/org/role/get --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.GetOrgPanelRole (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/org/role/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.UpdateOrgPanelRole (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/org/endpoint/get --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.GetOrgPanelEndpoint (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/org/endpoint/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.UpdateOrgPanelEndpoint (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/org/plugin --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.IsPluginMode (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/org/callback/get --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.GetOrgPanelEventList (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/org/callback/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.UpdateOrgPanelCallback (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/org/connect/get --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.GetOrgConnect (4 handlers) [GIN-debug] POST /monitor/api/v1/alarm/org/connect/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.UpdateOrgConnect (4 handlers) [GIN-debug] GET /monitor/api/v1/alarm/org/search --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/alarm.SearchSysPanelData (4 handlers) [GIN-debug] GET /monitor/api/v1/config/new/snmp --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/config_new.SnmpExporterList (4 handlers) [GIN-debug] POST /monitor/api/v1/config/new/snmp --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/config_new.SnmpExporterCreate (4 handlers) [GIN-debug] PUT /monitor/api/v1/config/new/snmp --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/config_new.SnmpExporterUpdate (4 handlers) [GIN-debug] DELETE /monitor/api/v1/config/new/snmp --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/config_new.SnmpExporterDelete (4 handlers) [GIN-debug] GET /monitor/api/v1/user/message/get --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/user.GetUserMsg (4 handlers) [GIN-debug] POST /monitor/api/v1/user/message/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/user.UpdateUserMsg (4 handlers) [GIN-debug] GET /monitor/api/v1/user/list --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/user.ListUser (4 handlers) [GIN-debug] POST /monitor/api/v1/user/role/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/user.UpdateRole (4 handlers) [GIN-debug] GET /monitor/api/v1/user/role/list --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/user.ListRole (4 handlers) [GIN-debug] POST /monitor/api/v1/user/role/user/update --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/user.UpdateRoleUser (4 handlers) [GIN-debug] POST /monitor/api/v1/agent/export/register/:name --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.ExportAgentNew (4 handlers) [GIN-debug] POST /monitor/api/v1/agent/export/deregister/:name --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.ExportAgentNew (4 handlers) [GIN-debug] POST /monitor/api/v1/agent/export/start/:name --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.AlarmControl (4 handlers) [GIN-debug] POST /monitor/api/v1/agent/export/stop/:name --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.AlarmControl (4 handlers) [GIN-debug] GET /monitor/api/v1/agent/export/ping/source --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.ExportPingSource (4 handlers) [GIN-debug] POST /monitor/api/v1/agent/export/process/:operation --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.AutoUpdateProcessMonitor (4 handlers) [GIN-debug] POST /monitor/api/v1/agent/export/log_monitor/:operation --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.AutoUpdateLogMonitor (4 handlers) [GIN-debug] POST /monitor/api/v1/agent/export/kubernetes/cluster/:action --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.PluginKubernetesCluster (4 handlers) [GIN-debug] POST /monitor/api/v1/agent/export/kubernetes/pod/:action --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.PluginKubernetesPod (4 handlers) [GIN-debug] POST /monitor/api/v1/agent/export/snmp/exporter/:action --> github.com/WeBankPartners/open-monitor/monitor-server/api/v1/config_new.PluginSnmpExporterHandle (4 handlers) [GIN-debug] Listening and serving HTTP on :8080 fatal error: unexpected signal during runtime execution [signal SIGSEGV: segmentation violation code=0x1 addr=0x47 pc=0x7f564456a1ed] runtime stack: runtime.throw(0xe2c384, 0x2a) /usr/local/go/src/runtime/panic.go:1116 +0x72 runtime.sigpanic() /usr/local/go/src/runtime/signal_unix.go:726 +0x4ac goroutine 157 [syscall]: runtime.cgocall(0xbaf530, 0xc000065dc0, 0xc000388b10) /usr/local/go/src/runtime/cgocall.go:133 +0x5b fp=0xc000065d90 sp=0xc000065d58 pc=0x4056db net._C2func_getaddrinfo(0xc00046b080, 0x0, 0xc000520360, 0xc000388b10, 0x0, 0x0, 0x0) _cgo_gotypes.go:94 +0x55 fp=0xc000065dc0 sp=0xc000065d90 pc=0x5f9b55 net.cgoLookupIPCNAME.func1(0xc00046b080, 0x26, 0x26, 0xc000520360, 0xc000388b10, 0x0, 0xc000065ea0, 0x5fd072) /usr/local/go/src/net/cgo_unix.go:161 +0xc5 fp=0xc000065e08 sp=0xc000065dc0 pc=0x5ff8c5 net.cgoLookupIPCNAME(0xe071b4, 0x3, 0xc00046b020, 0x25, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...) /usr/local/go/src/net/cgo_unix.go:161 +0x16b fp=0xc000065f18 sp=0xc000065e08 pc=0x5fb06b net.cgoIPLookup(0xc000380a20, 0xe071b4, 0x3, 0xc00046b020, 0x25) /usr/local/go/src/net/cgo_unix.go:218 +0x67 fp=0xc000065fb8 sp=0xc000065f18 pc=0x5fb7a7 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1374 +0x1 fp=0xc000065fc0 sp=0xc000065fb8 pc=0x46cfe1 created by net.cgoLookupIP /usr/local/go/src/net/cgo_unix.go:228 +0xc7 goroutine 1 [IO wait]: internal/poll.runtime_pollWait(0x7f56611f4420, 0x72, 0x0) /usr/local/go/src/runtime/netpoll.go:222 +0x55 internal/poll.(*pollDesc).wait(0xc000034618, 0x72, 0x0, 0x0, 0xe0b078) /usr/local/go/src/internal/poll/fd_poll_runtime.go:87 +0x45 internal/poll.(*pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:92 internal/poll.(*FD).Accept(0xc000034600, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) /usr/local/go/src/internal/poll/fd_unix.go:394 +0x1fc net.(*netFD).accept(0xc000034600, 0xc000383170, 0x40fed8, 0xc000100000) /usr/local/go/src/net/fd_unix.go:172 +0x45 net.(*TCPListener).accept(0xc00048fae0, 0xc0003c7b00, 0x40fed8, 0x30) /usr/local/go/src/net/tcpsock_posix.go:139 +0x32 net.(*TCPListener).Accept(0xc00048fae0, 0xd9f3c0, 0xc000383170, 0xd27dc0, 0x135cdf0) /usr/local/go/src/net/tcpsock.go:261 +0x65 net/http.(*Server).Serve(0xc0004600e0, 0xf20780, 0xc00048fae0, 0x0, 0x0) /usr/local/go/src/net/http/server.go:2937 +0x266 net/http.(*Server).ListenAndServe(0xc0004600e0, 0xc0004600e0, 0xc0003c7ce8) /usr/local/go/src/net/http/server.go:2866 +0xb7 net/http.ListenAndServe(...) /usr/local/go/src/net/http/server.go:3120 github.com/gin-gonic/gin.(*Engine).Run(0xc000426340, 0xc0003c7e70, 0x1, 0x1, 0x0, 0x0) /go/src/github.com/WeBankPartners/open-monitor/monitor-server/vendor/github.com/gin-gonic/gin/gin.go:336 +0x1b7 github.com/WeBankPartners/open-monitor/monitor-server/api.InitHttpServer() /go/src/github.com/WeBankPartners/open-monitor/monitor-server/api/api.go:255 +0x107f main.main() /go/src/github.com/WeBankPartners/open-monitor/monitor-server/main.go:45 +0x1fd goroutine 18 [chan receive]: gopkg.in/natefinch/lumberjack%2ev2.(*Logger).millRun(0xc00010e0c0) /go/src/github.com/WeBankPartners/open-monitor/monitor-server/vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go:379 +0x5d created by gopkg.in/natefinch/lumberjack%2ev2.(*Logger).mill.func1 /go/src/github.com/WeBankPartners/open-monitor/monitor-server/vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go:390 +0x75 goroutine 19 [chan receive]: gopkg.in/natefinch/lumberjack%2ev2.(*Logger).millRun(0xc00010e1e0) /go/src/github.com/WeBankPartners/open-monitor/monitor-server/vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go:379 +0x5d created by gopkg.in/natefinch/lumberjack%2ev2.(*Logger).mill.func1 /go/src/github.com/WeBankPartners/open-monitor/monitor-server/vendor/gopkg.in/natefinch/lumberjack.v2/lumberjack.go:390 +0x75 goroutine 20 [select]: database/sql.(*DB).connectionOpener(0xc0001288f0, 0xf232c0, 0xc00011c200) /usr/local/go/src/database/sql/sql.go:1126 +0xf5 created by database/sql.OpenDB /usr/local/go/src/database/sql/sql.go:740 +0x12a goroutine 21 [sleep]: time.Sleep(0xdf8475800) /usr/local/go/src/runtime/time.go:188 +0xbf github.com/WeBankPartners/open-monitor/monitor-server/services/db.keepAlive(0x3c) /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/db/xorm.go:158 +0x85 created by github.com/WeBankPartners/open-monitor/monitor-server/services/db.(*DBObj).InitXorm /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/db/xorm.go:49 +0x4c8 goroutine 22 [IO wait]: internal/poll.runtime_pollWait(0x7f56611f45f0, 0x72, 0x0) /usr/local/go/src/runtime/netpoll.go:222 +0x55 internal/poll.(*pollDesc).wait(0xc000434018, 0x72, 0x0, 0x0, 0xe0b078) /usr/local/go/src/internal/poll/fd_poll_runtime.go:87 +0x45 internal/poll.(*pollDesc).waitRead(...) /usr/local/go/src/internal/poll/fd_poll_runtime.go:92 internal/poll.(*FD).Accept(0xc000434000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) /usr/local/go/src/internal/poll/fd_unix.go:394 +0x1fc net.(*netFD).accept(0xc000434000, 0xc0005a2090, 0xc00042edb8, 0xc000066c00) /usr/local/go/src/net/fd_unix.go:172 +0x45 net.(*TCPListener).accept(0xc00036a0e0, 0xc00042edd8, 0x40fed8, 0x30) /usr/local/go/src/net/tcpsock_posix.go:139 +0x32 net.(*TCPListener).Accept(0xc00036a0e0, 0xd9f3c0, 0xc0005a2090, 0xd27dc0, 0x135cdf0) /usr/local/go/src/net/tcpsock.go:261 +0x65 net/http.(*Server).Serve(0xc000428000, 0xf20780, 0xc00036a0e0, 0x0, 0x0) /usr/local/go/src/net/http/server.go:2937 +0x266 net/http.(*Server).ListenAndServe(0xc000428000, 0xc000428000, 0xc00005ffc0) /usr/local/go/src/net/http/server.go:2866 +0xb7 net/http.ListenAndServe(...) /usr/local/go/src/net/http/server.go:3120 github.com/WeBankPartners/open-monitor/monitor-server/api.InitClusterApi() /go/src/github.com/WeBankPartners/open-monitor/monitor-server/api/api.go:306 +0x185 created by main.main /go/src/github.com/WeBankPartners/open-monitor/monitor-server/main.go:35 +0x145 goroutine 23 [select (no cases)]: github.com/WeBankPartners/open-monitor/monitor-server/services/db.InitPrometheusConfig() /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/db/prometheus.go:31 +0x43c created by main.main /go/src/github.com/WeBankPartners/open-monitor/monitor-server/main.go:36 +0x15d goroutine 26 [chan receive]: github.com/WeBankPartners/open-monitor/monitor-server/services/db.StartCheckLogKeyword() /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/db/cron.go:177 +0x4f created by main.main /go/src/github.com/WeBankPartners/open-monitor/monitor-server/main.go:39 +0x1a5 goroutine 83 [select]: github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher.func1(0xc000640000, 0xc00063c000, 0xc00063a060) /go/src/github.com/WeBankPartners/open-monitor/monitor-server/vendor/github.com/go-sql-driver/mysql/connection.go:614 +0xcd created by github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher /go/src/github.com/WeBankPartners/open-monitor/monitor-server/vendor/github.com/go-sql-driver/mysql/connection.go:611 +0xbe goroutine 29 [chan receive]: github.com/WeBankPartners/open-monitor/monitor-server/services/db.StartNotifyPingExport() /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/db/ping_exporter_ext.go:16 +0x4f created by main.main /go/src/github.com/WeBankPartners/open-monitor/monitor-server/main.go:42 +0x1ed goroutine 34 [chan receive]: github.com/WeBankPartners/open-monitor/monitor-server/services/db.StartSyncCoreJob(0x3c) /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/db/user.go:283 +0x72 created by github.com/WeBankPartners/open-monitor/monitor-server/services/db.StartCronJob /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/db/user.go:270 +0x75 goroutine 35 [chan receive]: github.com/WeBankPartners/open-monitor/monitor-server/services/prom.StartCheckPrometheusJob(0x3c) /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/prom/prometheus.go:34 +0xf5 created by github.com/WeBankPartners/open-monitor/monitor-server/services/db.StartCronJob /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/db/user.go:271 +0x97 goroutine 36 [chan receive]: github.com/WeBankPartners/open-monitor/monitor-server/services/prom.StartCheckProcessList(0x3c) /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/prom/prometheus.go:85 +0x73 created by github.com/WeBankPartners/open-monitor/monitor-server/services/db.StartCronJob /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/db/user.go:272 +0xb9 goroutine 37 [sleep]: time.Sleep(0x2cd34a85bc00) /usr/local/go/src/runtime/time.go:188 +0xbf github.com/WeBankPartners/open-monitor/monitor-server/services/db.StartCleanAlarmTable() /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/db/cron.go:392 +0x215 created by github.com/WeBankPartners/open-monitor/monitor-server/services/db.StartCronJob /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/db/user.go:274 +0xd1 goroutine 82 [chan receive]: github.com/WeBankPartners/open-monitor/monitor-server/services/prom.StartConsumeSdConfig() /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/prom/file_sd.go:24 +0x40e created by github.com/WeBankPartners/open-monitor/monitor-server/services/db.InitPrometheusConfig /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/db/prometheus.go:16 +0x4a goroutine 150 [select]: github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher.func1(0xc000404300, 0xc000162000, 0xc000416060) /go/src/github.com/WeBankPartners/open-monitor/monitor-server/vendor/github.com/go-sql-driver/mysql/connection.go:614 +0xcd created by github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher /go/src/github.com/WeBankPartners/open-monitor/monitor-server/vendor/github.com/go-sql-driver/mysql/connection.go:611 +0xbe goroutine 87 [select]: net/http.(*persistConn).readLoop(0xc000522120) /usr/local/go/src/net/http/transport.go:2161 +0x9cc created by net/http.(*Transport).dialConn /usr/local/go/src/net/http/transport.go:1708 +0xcb7 goroutine 84 [chan receive]: github.com/WeBankPartners/open-monitor/monitor-server/services/prom.StartConsumeRuleConfig() /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/prom/file_rule.go:26 +0x416 created by github.com/WeBankPartners/open-monitor/monitor-server/services/db.InitPrometheusConfig /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/db/prometheus.go:19 +0x67 goroutine 151 [sleep]: time.Sleep(0x6fc23ac00) /usr/local/go/src/runtime/time.go:188 +0xbf github.com/WeBankPartners/open-monitor/monitor-server/services/prom.InitAgentManager(0x0, 0x0, 0x0, 0xc000328b40, 0x16) /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/prom/agent_monitor.go:87 +0x5f created by github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.InitAgentManager /go/src/github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent/register.go:65 +0x305 goroutine 88 [select]: net/http.(*persistConn).writeLoop(0xc000522120) /usr/local/go/src/net/http/transport.go:2340 +0x11c created by net/http.(*Transport).dialConn /usr/local/go/src/net/http/transport.go:1709 +0xcdc goroutine 85 [select]: github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher.func1(0xc00010e420, 0xc000162120, 0xc000136180) /go/src/github.com/WeBankPartners/open-monitor/monitor-server/vendor/github.com/go-sql-driver/mysql/connection.go:614 +0xcd created by github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher /go/src/github.com/WeBankPartners/open-monitor/monitor-server/vendor/github.com/go-sql-driver/mysql/connection.go:611 +0xbe goroutine 86 [select]: github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher.func1(0xc00010e540, 0xc0003590e0, 0xc0001361e0) /go/src/github.com/WeBankPartners/open-monitor/monitor-server/vendor/github.com/go-sql-driver/mysql/connection.go:614 +0xcd created by github.com/go-sql-driver/mysql.(*mysqlConn).startWatcher /go/src/github.com/WeBankPartners/open-monitor/monitor-server/vendor/github.com/go-sql-driver/mysql/connection.go:611 +0xbe goroutine 152 [sleep]: time.Sleep(0x2cd34a85bc00) /usr/local/go/src/runtime/time.go:188 +0xbf github.com/WeBankPartners/open-monitor/monitor-server/services/prom.StartSyncAgentManagerJob(0x0, 0x0, 0x0, 0xc000328b40, 0x16) /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/prom/agent_monitor.go:111 +0x1e5 created by github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent.InitAgentManager /go/src/github.com/WeBankPartners/open-monitor/monitor-server/api/v1/agent/register.go:66 +0x353 goroutine 154 [select]: net/http.(*Transport).getConn(0xc00032c000, 0xc0004b46c0, 0x0, 0xc00010c100, 0x4, 0xc00046b020, 0x2a, 0x0, 0x0, 0x0, ...) /usr/local/go/src/net/http/transport.go:1347 +0x5ac net/http.(*Transport).roundTrip(0xc00032c000, 0xc000120700, 0xdeb0c0, 0x7f56611fa201, 0xc000120700) /usr/local/go/src/net/http/transport.go:569 +0x77c net/http.(*Transport).RoundTrip(0xc00032c000, 0xc000120700, 0xc00032c000, 0xc0653ca8a012c36a, 0x953066e2d) /usr/local/go/src/net/http/roundtrip.go:17 +0x35 net/http.send(0xc000120600, 0xf12840, 0xc00032c000, 0xc0653ca8a012c36a, 0x953066e2d, 0x13b0300, 0xc000388af8, 0xc0653ca8a012c36a, 0x1, 0x0) /usr/local/go/src/net/http/client.go:252 +0x453 net/http.(*Client).send(0xc000520210, 0xc000120600, 0xc0653ca8a012c36a, 0x953066e2d, 0x13b0300, 0xc000388af8, 0x0, 0x1, 0xc000182b28) /usr/local/go/src/net/http/client.go:176 +0xff net/http.(*Client).do(0xc000520210, 0xc000120600, 0x0, 0x0, 0x0) /usr/local/go/src/net/http/client.go:718 +0x45f net/http.(*Client).Do(...) /usr/local/go/src/net/http/client.go:586 golang.org/x/net/context/ctxhttp.Do(0xf23300, 0xc00002e0b8, 0xc000520210, 0xc000120500, 0xc0004541e8, 0x8f, 0xf12d00) /go/src/github.com/WeBankPartners/open-monitor/monitor-server/vendor/golang.org/x/net/context/ctxhttp/ctxhttp.go:27 +0x10f github.com/WeBankPartners/open-monitor/monitor-server/services/datasource.PrometheusData(0xc000477df0, 0x0, 0x0, 0x0) /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/datasource/prometheus.go:70 +0xdd6 github.com/WeBankPartners/open-monitor/monitor-server/services/db.CheckLogKeyword() /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/db/cron.go:192 +0x1d4 created by github.com/WeBankPartners/open-monitor/monitor-server/services/db.StartCheckLogKeyword /go/src/github.com/WeBankPartners/open-monitor/monitor-server/services/db/cron.go:178 +0x67 goroutine 155 [select]: net.(*Resolver).lookupIPAddr(0x13af7c0, 0xf23340, 0xc0003808a0, 0xe071b4, 0x3, 0xc00046b020, 0x25, 0x2382, 0x0, 0x0, ...) /usr/local/go/src/net/lookup.go:299 +0x685 net.(*Resolver).internetAddrList(0x13af7c0, 0xf23340, 0xc0003808a0, 0xe071b4, 0x3, 0xc00046b020, 0x2a, 0x0, 0x0, 0x0, ...) /usr/local/go/src/net/ipsock.go:280 +0x4d4 net.(*Resolver).resolveAddrList(0x13af7c0, 0xf23340, 0xc0003808a0, 0xe07996, 0x4, 0xe071b4, 0x3, 0xc00046b020, 0x2a, 0x0, ...) /usr/local/go/src/net/dial.go:221 +0x47d net.(*Dialer).DialContext(0xc0003805a0, 0xf23300, 0xc00002e0b8, 0xe071b4, 0x3, 0xc00046b020, 0x2a, 0x0, 0x0, 0x0, ...) /usr/local/go/src/net/dial.go:403 +0x22b net.(*Dialer).Dial(...) /usr/local/go/src/net/dial.go:348 net/http.(*Transport).dial(0xc00032c000, 0xf23340, 0xc000380600, 0xe071b4, 0x3, 0xc00046b020, 0x2a, 0x0, 0x0, 0x0, ...) /usr/local/go/src/net/http/transport.go:1144 +0x82 net/http.(*Transport).dialConn(0xc00032c000, 0xf23340, 0xc000380600, 0x0, 0xc00010c100, 0x4, 0xc00046b020, 0x2a, 0x0, 0xc000162480, ...) /usr/local/go/src/net/http/transport.go:1575 +0x1abb net/http.(*Transport).dialConnFor(0xc00032c000, 0xc000148370) /usr/local/go/src/net/http/transport.go:1421 +0xc6 created by net/http.(*Transport).queueForDial /usr/local/go/src/net/http/transport.go:1390 +0x40f goroutine 156 [select]: net.cgoLookupIP(0xf232c0, 0xc0004b4700, 0xe071b4, 0x3, 0xc00046b020, 0x25, 0x0, 0x0, 0x0, 0x0, ...) /usr/local/go/src/net/cgo_unix.go:229 +0x199 net.(*Resolver).lookupIP(0x13af7c0, 0xf232c0, 0xc0004b4700, 0xe071b4, 0x3, 0xc00046b020, 0x25, 0x0, 0x0, 0x0, ...) /usr/local/go/src/net/lookup_unix.go:96 +0x187 net.glob..func1(0xf232c0, 0xc0004b4700, 0xc000414ec0, 0xe071b4, 0x3, 0xc00046b020, 0x25, 0xc000380600, 0x0, 0xc00010c100, ...) /usr/local/go/src/net/hook.go:23 +0x72 net.(*Resolver).lookupIPAddr.func1(0x0, 0x0, 0x0, 0x0) /usr/local/go/src/net/lookup.go:293 +0xb9 internal/singleflight.(*Group).doCall(0x13af7d0, 0xc000804460, 0xc00046b050, 0x29, 0xc0004b4740) /usr/local/go/src/internal/singleflight/singleflight.go:95 +0x2e created by internal/singleflight.(*Group).DoChan /usr/local/go/src/internal/singleflight/singleflight.go:88 +0x2cc
如何重现
预期行为
截图
附加
抱歉,这个报错是monitor-server加载配置文件default.json的时候出错,因为default.json有些差异化变量要替换所以用了{{xx}}的方式,但有些变量是数字类型的所有json格式化错误,后续会改进,可以先注意下这种变量把它们全替换了
描述您遇到的bug
我们想用open-monitor整合外部已经搭建好的prometheus和alertmanager。目前文档并没有对这块有任何说明,有这方面的文档可以提供吗?
目前修改了启动脚本
start.sh
和monitor/conf/default.json
, 然后在kubernetes容器启动时,把这两个文件挂载替换掉。但是目前open-monitor启动后总是报错,我还需要修改哪一块配置吗?。这两个文件的修改情况如下:start.sh
monitor/conf/default.json
现在运行后,容器crash报错如下:
如何重现
预期行为
截图
附加