Files
Rafael Weingärtner 82a768450c Feature to skip processed datapoints persistence
In some situations, we discovered that CloudKitty ends up persisting
many zero values (processed datapoints) in the storage backend, which
can have a significant impact on the usage report queries.
In some cases, this might not be a problem, but in large-scale
deployments, these extra datapoints can cause not just an extra usage of
space for the storage backend, but also make the API slow.
This patch introduces a new option called "skip_datapoints_expression",
which can be defined, globally in the "cloudkitty.conf", in the
"orchestrator" section, or in the metrics.yml definition. The expression
"skip_datapoints_expression" must be a String where python code that
will be evaluated in runtime can be used.
For instance, for somebody that wants to skip/ignore datapoints that
have quantity as zeros, the following expression can be used:
The following is the string to be used in the YML definition:

```
skip_datapoints_expression: "datapoint.get('vol', {}).get('qty') == 0"
```

Alternatively, to define it in the "cloudkitty.conf":

```
[orchestrator]
skip_datapoints_expression = "datapoint.get('vol', {}).get('qty') == 0"
```

Change-Id: Id6e44a3389f9b3eaacf0394a2ddbc0e405734722
Signed-off-by: Rafael Weingärtner <rafael@apache.org>
2025-12-22 11:12:17 -03:00
..
2019-02-04 08:42:21 +00:00
2025-11-11 22:13:46 +01:00
2020-03-04 14:23:27 -06:00
2019-04-02 11:56:06 +02:00