[RFE] Granular metering data in neutron-metering-agent
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Undecided
|
Rafael Weingartner |
Bug Description
Problem Description
=================
Currently, when creating shared labels in Neutron metering, we only receive a total amount of accounting data for a label. This makes it hard for operators to identify what tenants and routers, where the labels were applied, are generating the traffic. Moreover, for shared labels, as they apply in all tenants, Neutron metering is using a random tenant_id, which can create confusion when used in production.
Proposed Change
===============
We propose to extend the neutron metering agent to enable/use a granular
message format. To maintain backward compatibility, this feature is enabled/disabled by the following neutron-
* ``granular_
present traffic data in a granular fashion, instead of grouping all of the
traffic data for all tenants and routers where the labels were assigned to. The default value is ``False`` for backward compatibility.
When the ``granular_
following granularities:
* label -- all of the traffic counters for a given label. One must bear in
mind that a label (shared) can be assigned to multiple routers.
* router -- all of the traffic counter for all labels that are assigned to
the router.
* tenant -- all of the traffic counters for all labels of all routers that a tenant has.
* router-label -- all of the traffic counters for a router and the given label.
* tenant-label -- all of the traffic counters for all routers of a tenant that have a given label.
Each granularity presented here is sent to the message bus with different
events types that vary according to the granularity. The mapping between
granularity and event type is presented as follows.
* ``label`` -- event type ``l3.meter.label``.
* ``router`` -- event type ``l3.meter.
* ``tenant`` -- event type ``l3.meter.
* ``router-label`` -- event type ``l3.meter.
* ``tenant-label`` -- event type ``l3.meter.
Therefore, we will change the non-granular (``granular_
{"pkts": "<the number of packets that matched the rules of the labels>",
"bytes": "<the number of bytes that matched the rules of the labels>",
"time": "<seconds between the first data collection and the last one>",
"
"
"host": "<neutron metering agent host name>",
"label_id": "<the label id>",
"tenant_id": "<the tenant id>"
}
The following will be the new event message format, which will also contain some attributes that can be found in the legacy mode such as ``bytes``, ``pkts``, ``time``, ``first_update``, ``last_update``, and ``host``. As follows we present an example of JSON message with all of the
possible attributes.
{"
"tenant_id": "f0f745d9a59c47
"
"bytes": 0,
"label_id": "00c714f1-
"label_name": "test1",
"
"host": "<hostname>",
"time": 247,
"pkts": 0,
"
}
The ``resource_id`` is a unique identifier for the "resource" being monitored. Here we consider a resource to be any of the granularities that we handle. The following is the standard for resource ID when the legacy
mode is disabled (for each granularity).
* labels -- label-<label_id>
* routers -- router-<router_id>
* tenant -- tenant-<tenant_id>
* router-label -- router-
* tenant-label -- tenant-
Changed in neutron: | |
assignee: | nobody → Rafael Weingartner (rafaelweingartner) |
status: | New → In Progress |
description: | updated |
tags: | added: rfe |
Just an FYI that there was a discussion recently at the PTG and drivers meeting about a "new" way to do metering in the l3-agent, with the potential to deprecate the metering agent, https:/ /bugs.launchpad .net/neutron/ +bug/1817881
So we should have a wider discussion on this topic. I've asked Slawek to take a look so we can get this on the drivers team agenda.