apache / apache/cloudstack

stats.output.uri configuration either to Influx Db and Graphite is not working

Open
#12,604 1 comment 0 reactions 0 assignees View on GitHub
component:metrics no-issue-activity type:bug
Dominant language
Java
Stars
3.1k
Forks
1.4k
Avg merge
6d 19h
Merged PRs (30d)
32

Description

### 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

Image

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

Contributor guide

Open the contributing guide

Research direction

Start with server/src/main/java/com/cloud/server/StatsCollector.java and compare the Graphite and InfluxDB paths against the linked commit and StatsCollector output documentation. Reproduce both configurations with the provided containers, inspect management-server logs, and verify that configured metrics arrive in the respective backends.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
backend, observability
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.