Clear network metrics

Important: By following this guide you will clear all the network metrics for all your clients. THIS IS NOT REVERSIBLE.

Currently the metrics are calculated by aggregating two factors:

  • metrics collected by Fleio

  • metrics collected by gnocchi

In order to clear all the network metrics you will have to clear the metrics collected by Fleio in the Fleio database, and the metrics collected by gnocchi.

To clear the metrics collected by Fleio you will have to clear the information gathered in the following two tables:

DELETE FROM openstack_networkportresource;
DELETE FROM openstack_networkporttraffic;

After that, you will have to clear all the information gathered by gnocchi in all the regions that you have configured ( you will have to run the following for loop in each region).

for f in `gnocchi resource list --type instance_network_interface -f value -c id`;do gnocchi resource delete $f;done

After that, just run the collect_traffic_data script available in /var/webapps/fleio/scripts on your Fleio installation. Note that it might take a while before you will actually have data in Fleio.

Important: Before Fleio will have data to work you might see errors in the metrics tab on instance page. Errors will be like the followings:

400: 'Metrics not found', 'detail': ['network.incoming.bytes']

network.incoming.bytes might be replaced with other metric related to the resource type we deleted earlier