-
Notifications
You must be signed in to change notification settings - Fork 4
SP monitoring
Panos Karkazis edited this page Jul 25, 2018
·
7 revisions
5GTANGO/SONATA service platform monitoring client is used in order to gather monitoring data from VM and containers which hosts Sonata's services and push them to the monitoring server.
Supported monitoring metrics are:
VM metrics
- cpu usage
- memory usage
- disk usage
- network traffic
Container metrics
- cnt_cpu_perc
- cnt_mem_perc
- cnt_mem_limit_MB
- cnt_mem_usage_MB
- cnt_net_rx_MB
- cnt_net_tx_MB
- cnt_block_ou_MB
- cnt_block_in_MB
- cnt_created
- cnt_status
- python 2.7
- docker-engine 1.10.2
Build container
git clone https://github.com/sonata-nfv/son-monitor-probe.git
cd son-monitor-probe
sudo docker build -f sp_mon/Dockerfile -t son-sp-mon .
Run monitoring probe as container
sudo docker run --net="host" -e "NODE_NAME=INT-SRV-1" -e "PROM_SRV=http://sp.int2.sonata-nfv.eu:9091/metrics" --privileged=true -d -v /var/run/docker.sock:/var/run/docker.sock -v /proc:/myhost/proc -v /:/rootfs:ro son-sp-mon
All metrics are exposed to the Pushgateway server.
Get last pushed value of VMs cpu usage
Request:
curl http://<pushgateway>:9091/metrics | grep vm_cpu_perc
Response:
# TYPE vm_cpu_perc gauge
vm_cpu_perc{core="cpu",id="0035703e-afc5-46fc-acbf-0b57df8019c1",instance="INT-SRV-3:0035703e-afc5-46fc-acbf-0b57df8019c1",job="vm"} 60.8 1532527257000
vm_cpu_perc{core="cpu0",id="0035703e-afc5-46fc-acbf-0b57df8019c1",instance="INT-SRV-3:0035703e-afc5-46fc-acbf-0b57df8019c1",job="vm"} 39.39 1532527257000
vm_cpu_perc{core="cpu1",id="0035703e-afc5-46fc-acbf-0b57df8019c1",instance="INT-SRV-3:0035703e-afc5-46fc-acbf-0b57df8019c1",job="vm"} 82.18 1532527257000
Get last pushed value containers memory usage
Request:
curl http://<pushgateway>:9091/metrics | grep cnt_mem_perc
Response:
# TYPE cnt_mem_perc gauge
cnt_mem_perc{id="964ca07c2c67c86b5ad141b638d0da16ff2b28dc631f8b78ac1fc5b226096f70",image="sha256:bf253c4ee5273847f5b9072ee8579ff4ba7c53022351daf45f61692d7fec8575",image_name="registry.sonata-nfv.eu:5000/son-monitor-manager",instance="INT-SRV-3:0035703e-afc5-46fc-acbf-0b57df8019c1",job="containers",name="/son-monitor-manager"} 1.99 1532527507000
cnt_mem_perc{id="9c4b56294a05ae44c60f28ecc8dee2708ddfb28f67f6a429c21d9ca2f1fefd49",image="sha256:5f90180eb9ff35e6bea6009cd632031c909c656a04b3cb78e60081d70ec0ded2",image_name="registry.sonata-nfv.eu:5000/son-monitor-ceilexp",instance="INT-SRV-3:0035703e-afc5-46fc-acbf-0b57df8019c1",job="containers",name="/son-monitor-ceilExporter"} 0.41 1532527507000
cnt_mem_perc{id="ace92a624f78e71ee05d4070b1fec5240f126dab1507e509ef9d132752b3b55f",image="sha256:07a4b7c306253f1efe58e17d2851a4ce806481522fc5fd0e3cc3e777b2a95efa",image_name="registry.sonata-nfv.eu:5000/son-monitor-prometheus",instance="INT-SRV-3:0035703e-afc5-46fc-acbf-0b57df8019c1",job="containers",name="/son-monitor-prometheus"} 9.06 1532527507000