stats.output.uri configuration either to Influx Db and Graphite is not working
- 主要語言
- Java
- 星號
- 3.1k
- 分支
- 1.4k
- 平均合併
- 6 天 19 小時
- 30 天內合併 PR
- 32
描述
### problem
stats.output.uri configuration either to Influx Db and Graphite is not working
### versions
ACS 4.22 , 4.18
### The steps to reproduce the bug
Steps to reproduce the issue
Install docker on server to test Influx and Graphite
Test case with Graphite
1. Run the following command
docker run -d --name graphite --restart=always --network host graphiteapp/graphite-statsd
2. Check the UI for Graphite
3. Create a cloudstack prefix just to test
echo "cloudstack.force.test 1 $(date +%s)" | nc 127.0.0.1 2003
4. Change the global setting parameter "stats.output.uri " to
graphite://192.168.55.152:2003/cloudstack
5. Check the mgmt logs
```
2026-02-06 12:27:33,836 DEBUG [c.c.s.StatsCollector] (StatsCollector-5:[ctx-1e58bf2a]) (logid:136366d3) Sending VmStats of host Host {"id":6,"name":"kvmhost1","type":"Routing","uuid":"650ff5c6-4cf3-4d26-99a8-ce8c0b9b153f"} to graphite host 192.168.55.152:2003
2026-02-06 12:27:33,909 DEBUG [c.c.s.StatsCollector] (StatsCollector-5:[ctx-1e58bf2a]) (logid:136366d3) Sending VmStats of host Host {"id":7,"name":"kvmhost2","type":"Routing","uuid":"c30b8e0d-0a48-40fa-bb57-c2de13513ca5"} to graphite host 192.168.55.152:2003
2026-02-06 12:28:33,965 DEBUG [c.c.s.StatsCollector] (StatsCollector-2:[ctx-70dd39e3]) (logid:e4cdfe41) Sending VmStats of host Host {"id":6,"name":"kvmhost1","type":"Routing","uuid":"650ff5c6-4cf3-4d26-99a8-ce8c0b9b153f"} to graphite host 192.168.55.152:2003
2026-02-06 12:28:34,034 DEBUG [c.c.s.StatsCollector] (StatsCollector-2:[ctx-70dd39e3]) (logid:e4cdfe41) Sending VmStats of host Host {"id":7,"name":"kvmhost2","type":"Routing","uuid":"c30b8e0d-0a48-40fa-bb57-c2de13513ca5"} to graphite host 192.168.55.152:2003
2026-02-06 12:29:34,089 DEBUG [c.c.s.StatsCollector] (StatsCollector-3:[ctx-ea5b7df4]) (logid:8c734224) Sending VmStats of host Host {"id":6,"name":"kvmhost1","type":"Routing","uuid":"650ff5c6-4cf3-4d26-99a8-ce8c0b9b153f"} to graphite host 192.168.55.152:2003
2026-02-06 12:29:34,160 DEBUG [c.c.s.StatsCollector] (StatsCollector-3:[ctx-ea5b7df4]) (logid:8c734224) Sending VmStats of host Host {"id":7,"name":"kvmhost2","type":"Routing","uuid":"c30b8e0d-0a48-40fa-bb57-c2de13513ca5"} to graphite host 192.168.55.152:2003
2026-02-06 12:30:34,218 DEBUG [c.c.s.StatsCollector] (StatsCollector-5:[ctx-a0dfecab]) (logid:d48b8a46) Sending VmStats of host Host {"id":6,"name":"kvmhost1","type":"Routing","uuid":"650ff5c6-4cf3-4d26-99a8-ce8c0b9b153f"} to graphite host 192.168.55.152:2003
2026-02-06 12:30:34,284 DEBUG [c.c.s.StatsCollector] (StatsCollector-5:[ctx-a0dfecab]) (logid:d48b8a46) Sending VmStats of host Host {"id":7,"name":"kvmhost2","type":"Routing","uuid":"c30b8e0d-0a48-40fa-bb57-c2de13513ca5"} to graphite host 192.168.55.152:2003
2026-02-06 12:31:34,350 DEBUG [c.c.s.StatsCollector] (StatsCollector-2:[ctx-7de03f78]) (logid:eea8351f) Sending VmStats of host Host {"id":6,"name":"kvmhost1","type":"Routing","uuid":"650ff5c6-4cf3-4d26-99a8-ce8c0b9b153f"} to graphite host 192.168.55.152:2003
2026-02-06 12:31:34,416 DEBUG [c.c.s.StatsCollector] (StatsCollector-2:[ctx-7de03f78]) (logid:eea8351f) Sending VmStats of host Host {"id":7,"name":"kvmhost2","type":"Routing","uuid":"c30b8e0d-0a48-40fa-bb57-c2de13513ca5"} to graphite host 192.168.55.152:2003
2026-02-06 12:32:34,488 DEBUG [c.c.s.StatsCollector] (StatsCollector-4:[ctx-07ff9180]) (logid:d7d377c2) Sending VmStats of host Host {"id":6,"name":"kvmhost1","type":"Routing","uuid":"650ff5c6-4cf3-4d26-99a8-ce8c0b9b153f"} to graphite host 192.168.55.152:2003
2026-02-06 12:32:34,553 DEBUG [c.c.s.StatsCollector] (StatsCollector-4:[ctx-07ff9180]) (logid:d7d377c2) Sending VmStats of host Host {"id":7,"name":"kvmhost2","type":"Routing","uuid":"c30b8e0d-0a48-40fa-bb57-c2de13513ca5"} to graphite host 192.168.55.152:2003
```
Test case with Influxdb
1. Run influxdb container
docker run -d --name influxdb18 --network host -v influxdb_data:/var/lib/influxdb influxdb:1.8
2. Change the stats.output.uri to "influxdb://192.168.55.152:8086/cloudstack"
3. Check if the influx db is working
apt install influxdb-client
curl -X POST "http://<>:8086/query?q=CREATE+DATABASE+cloudstack"
curl "http://<>:8086/query?q=SHOW+DATABASES
4. Check the mgmt logs
Nothing related to influxdb in logs
Ref
https://cwiki.apache.org/confluence/display/CLOUDSTACK/StatsCollector+output+to+Graphite
https://github.com/apache/cloudstack/commit/840c2fda852b86f51245a31e7cd91cdb0ad4bf49#diff-4964c59e86cff76cb0ed21aaa628e05401cad03389533a13c4887b5d97ce3e2d
https://github.com/apache/cloudstack/blob/main/server/src/main/java/com/cloud/server/StatsCollector.java
https://github.com/apache/cloudstack/discussions/12065
貢獻指南
研究方向
從 server/src/main/java/com/cloud/server/StatsCollector.java 開始,將 Graphite 和 InfluxDB 路徑與連結的 commit 以及 StatsCollector 輸出文件進行比較。使用提供的容器重現這兩種設定,檢查 management-server 記錄,並驗證已設定的指標是否到達各自的後端。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- docker, java
- 領域
- backend, observability
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100