Custom Metrics
3 minute read
A custom metric is a reusable, named value computed from your existing cost fields and variables with a formula. Once defined, the metric becomes a new column that billing rulesets can use, for example, a discounted cost, a marked-up rate, or a value blended from several fields.
The Custom Metrics page is a shared library for these definitions: edit a metric once here, and every ruleset that references it picks up the change on the next pipeline run. The page provides:
- Metric definitions: Create named, reusable calculations from cost fields, variables, and other metrics.
- Conditional logic: Apply different formulas to different cost rows using conditional branches.
- Assignment tracking: See at a glance which billing rulesets use each metric.
- Consistency: Standardize how key measures are calculated everywhere they are used.
Access the Custom Metrics page
- Log in to the CloudBolt Platform.
- In the sidebar, select Settings.
- Select Custom Metrics.
Custom Metrics overview
The page lists every custom metric defined for your tenant.
| Column | Description |
|---|---|
| Custom Metric Name | The name used to reference the metric in formulas and rulesets. |
| Type | The kind of value the metric produces: Number or Text. |
| Assignments | How many billing rulesets reference the metric. Select the count to see which rulesets use it. |
| Actions | View details, Edit, and Delete controls for each metric. |
Create a custom metric
- Select New Custom Metric.
- Enter a Custom Metric Name (required), choose a Type, and optionally add a Description.
- Build the Calculation from one or more conditional branches (see below).
- Save the metric. It is now available to assign in any billing ruleset.
A calculation is a series of conditional branches evaluated in order. Each branch has:
- Conditions: One or more checks, each a Field, an operator, and a Value, joined with AND/OR.
- Formula: The expression to compute when the branch’s conditions match.
For each cost row, the first branch whose conditions match wins. If no branch matches, the Otherwise fallback formula applies.
Formulas
Formulas combine numbers, the operators + − × ÷, parentheses, and prefixed references to your data:
| Prefix | Refers to |
|---|---|
focus. |
A field from your cost data, such as focus.BILLED_COST. |
var. |
A customer variable. |
metric. |
Another custom metric. |
For example, focus.BILLED_COST * 0.9 computes a 10% discount on the billed cost.
Every identifier in a formula must carry one of the prefixes above, and each formula must reference at least one field or variable.
Use a custom metric in a billing ruleset
Inside a billing ruleset, attach a library metric with Assign Custom Metric. The metric’s definition is read-only within the ruleset: the ruleset consumes it, but the calculation itself is managed here.
Edits made on the Custom Metrics page flow to every ruleset that references the metric on the next pipeline run.
Edit or delete a custom metric
Use the Edit and Delete actions in the metrics list. A few guardrails protect metrics that are in use:
- Delete: A metric cannot be deleted while any ruleset still references it. Remove the reference in each one before deleting. The Assignments column shows you where it is used.
- Rename: A metric cannot be renamed while it is a ruleset’s source metric.