Viewing outgoing traffic usage

The bandwidth metric that can show outgoing traffic usage is not available by default. To be able to use it, you need to configure it first.

To configure the outgoing traffic metric

  1. Create a meter by using the openstack network meter create command. For example, to create the meter outgoing_traffic in the project project1 within the domain domain1, run:

    # openstack --insecure network meter create outgoing_traffic --share \
    --project project1 --project-domain domain1
  2. Create a rule that includes all outgoing network traffic by specifying the CIDR 0.0.0.0/0 and the egress traffic direction. For example:

    # openstack --insecure network meter rule create outgoing_traffic --egress \
    --include --remote-ip-prefix 0.0.0.0/0
  3. Create a rule that excludes the outgoing network traffic of your physical compute network by specifying its CIDR. For example, for the physical compute network with the CIDR 10.10.10.0/24, run:

    # openstack --insecure network meter rule create outgoing_traffic --egress \
    --exclude --remote-ip-prefix 10.10.10.0/24

Now, you can proceed to creating virtual routers and assigning floating IP addresses to virtual machines in the self-service panel. The bandwidth metric will only account outgoing VM traffic via virtual routers.

To view measures for the outgoing traffic metric

  1. Find out the resource_id for the bandwidth metric. For example:

    # gnocchi --insecure metric list | grep bandwidth
    | dce6d500-37c9<…> | low | bandwidth | B | cfc0cbb3-ff05-4b25-be7c-ab7f872e4180 |
  2. View measures for the resource. For example:

    # gnocchi --insecure measures show --resource-id cfc0cbb3-ff05-4b25-be7c-ab7f872e4180 bandwidth
    +---------------------------+-------------+---------+
    | timestamp                 | granularity |   value |
    +---------------------------+-------------+---------+
    | 2021-10-03T02:40:00+03:00 |       300.0 |  1045.0 |
    | 2021-10-03T02:50:00+03:00 |       300.0 |  1907.0 |
    | 2021-10-03T02:55:00+03:00 |       300.0 | 15932.0 |
    +---------------------------+-------------+---------+