Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Energy attribution plugin

The energy-attribution plugin combines measurements related to the energy consumption of some hardware components with measurements related to the use of the hardware by the software.

It computes a value per resource per consumer, using the formula of your choice (configurable).

Requirements

To obtain hardware and software measurements, you need to enable other plugins such as rapl or procfs.

Metrics

This plugin creates new measurements based on its configuration.

NameTypeUnitDescriptionResourceResourceConsumerAttributesMore information
chosen by the configGaugeJoulesattributed energydepends on the configdepends on the configsame as the input measurements

Configuration

Here is an example of how to configure this plugin. Put the following in the configuration file of the Alumet agent (usually alumet-config.toml).

In this example, we define an attribution formula that produces a new metric attributed_energy by combining cpu_energy and cpu_usage.

[plugins.energy-attribution.formulas.attributed_energy]
# the expression used to compute the final value
expr = "cpu_energy * cpu_usage / 100.0"
# the time reference: this is a timeseries, defined by a metric (and other criteria, see below), that will not change during the transformation. Other timeseries can be interpolated in order to have the same timestamps before applying the formula.
ref = "cpu_energy"

# Timeseries related to the resources.
[plugins.energy-attribution.formulas.attributed_energy.per_resource]
# Defines the timeseries `cpu_energy` that is used in the formula, as the measurement points that have:
# - the metric `rapl_consumed_energy`,
# - and the resource kind `"local_machine"`
# - and the attribute `domain` equal to `package_total`
cpu_energy = { metric = "rapl_consumed_energy", resource_kind = "local_machine", domain = "package_total" }

# Timeseries related to the resource consumers.
[plugins.energy-attribution.formulas.attributed_energy.per_consumer]
# Defines the timeseries `cpu_usage` that is used in the formula, as the measurements points that have:
# - the metric `cpu_usage_percent`
# - the attribute `kind` equal to `total`
cpu_usage = { metric = "cpu_usage_percent", kind = "total" }

You can configure multiple formulas. Be sure to give each formula a unique name. For instance, you can have a table formulas.attributed_energy_cpu and a table formulas.attributed_energy_gpu.

More information

Here is how the interpolation used by this plugin works. Given a reference timeseries and some other timeseries, it synchronizes all the timeseries by interpolating the non-reference points at the timestamps of the reference. The reference is left untouched.

Multivariate interpolation diagram