apache / apache/cloudstack

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

Aperta
#12,604 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
component:metrics no-issue-activity type:bug
Lingua principale
Java
Stelle
3.1k
Fork
1.4k
Merge medio
6g 19h
PR unite (30g)
32

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia da server/src/main/java/com/cloud/server/StatsCollector.java e confronta i percorsi Graphite e InfluxDB con il commit collegato e la documentazione dell'output di StatsCollector. Riproduci entrambe le configurazioni con i container forniti, esamina i log di management-server e verifica che le metriche configurate arrivino nei rispettivi backend.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
docker, java
Ambito
backend, observability
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.