Documentation and Best Practices

Learn how to use Cloudability and get the most out of our cloud cost management tool.

Follow

Business Mapping | Customizing Costs Using Business Metrics

What is Business Mapping for Cost Contextualization & Customization?

 

The Business Mapping feature is used to create a special type of 'synthetic' metrics called Business Metrics, which can be utilized through Cloudability's cost analytics reporting and dashboards.

The native Cloudability metrics are a set of useful, powerful measures for users to gain insight into their cloud spend and efficiency. However, for bespoke customer use cases, users need to contextualize and customize Cloud spending against business specific KPIs to visualise trends; this will enable stakeholders to make decisions based on data that is meaningful to them and their business.

Business Metrics are crafted using Business Mapping statements that leverage a combination of existing billing data and customer provided data. This empowers our users to create truly custom metrics related to Cloud billing concepts, populated with the specific values from logic that best fits their reporting needs in the context of their own business.

  

Use cases

Business Metrics can help address a number of use cases where, in addition to Cloudability's native metrics, you may need custom metrics for your business' reporting requirements; below are examples of a few of the more popular customer use cases:

 Unit Economics

also known as "Cost per X".  a customer can contextualize their Cloud spend as a unit cost in a single in-app metric. for example: "cost per ride", "cost per active user", "cost per subscription", etc...

KPI Driven Cost

cost in the context of a business specific KPI. for example: a customer can contextualize "cost" in terms of full time engineers (cost in FTEs) to understand their Cloud spend in terms of the number of DevOps Engineers needed to support a deployed application.

Surcharge / Markup

 a surcharge or markup for Cloud spend can be built in and surface costs inclusive of management fees, license costs or other surcharges using a single in-app metric.

The rules engine that drives this feature is equipped with sophisticated logic capabilities and individual rules can be based on pretty much all of the important attributes that vendors supply with the billing and usage data. These attributes include vendor supplied dimensions & metrics like cost tags, account names, unblended cost but also include enhanced dimensions & metrics provided by Cloudability like usage familylease type and adjusted cost.

business-metrics-usecase-surcharge-widget.png

business-metrics-usecase-unit_economics-report.png business-metrics-usecase-unit_economics-widget_comp.png

 

How are Business Metrics Created ?

Business Metrics are created using an API and leveraging the Business Mapping expression language. Rules are defined through JSON formatted expressions and statements which are arithmetically evaluated resulting in a custom metric and corresponding value.

 

How Does A Business Metric Work?

Evaluated at Ingestion

When Cloudability ingests the detailed billing data from cloud vendors we evaluate each and every cost line item against the Business Mapping statements for your configured Business Metrics. For those of you with a programming background you can think of the list of statements as similar to a case statement, as soon as there is a match then the name of the statement itself is evaluated and the resultant value is arithmetically calculated and used to populate the Business Metric for that item. This custom metric name can simply be a meaningful string that you provide. When Cloud vendors post new billing data, we will automatically pick up any changes/additions you make to your Business Mapping statements. To have historic months reflect the updated rules you can reach out to support or your TAM for this to be actioned.

The custom metric name

Every Business Metric you create requires a name. Think deeply about the business context that you are trying to share and choose a name that people will quickly make sense of. You are giving a name to the custom metric as it will appear in Cloudability reports and dashboards.

The custom metric format

As well as a name, you must decide if this custom metric will surface data formatted as currency or a regular number.  The use case driving this custom metric will help you decide on the appropriate format. For example: if your usecase is to provide a surcharge for management fees, then the custom metric format will be currency.

The default value

Once you've decided on a name and a format, you need to set a default value. This is the value the Business Metric will inherit if none of the statements you declare match.  For example: an option here would  be to use the cost amount already in the billing data.   As you build your Business Metrics, each use case will help you with determining a good default value.

It's about matching with Statements

Every statement has two components:

  1. an expression for what to match against. This expression can involve complex boolean logic, a timeframe, and has a very comprehensive list of operators that can be applied against all the important attributes of the cost items
  2. an expression to evaluate resulting in the value for the Business Metric if the criteria in #1 happens to match

Below is a simple example:

"statements": [{
"matchExpression": "DIMENSION['vendor'] == 'Amazon'
|| DIMENSION['vendor'] == 'Azure' ",
"valueExpression": "METRIC['unblended_cost'] * 1.15"
}]

 

Working with Business Metrics

From the Business Mappings API reference page you can see a feature overview, including the Business Metrics endpoints with corresponding descriptions and examples available for you to work with Business Metrics.  Additionally, you will find templates that you can use to help kickstart your custom metric setup and other helpful resources. Note that you can setup a maximum of 5 Business Metrics. 

Below are a quick reference and examples for (i) listing a Business Metric you have already created, (ii) creating a new Business Metric and (iii) updating an existing Business Metric.

Please refer to the the Business Mappings API reference page for full details.

 

Listing and Reviewing a Business Metric

curl -X GET \
https://api.cloudability.com/.../business-mappings/1/metrics \
-u '[auth_token]:'

 

Create a Business Metric

curl -X POST \
https://api.cloudability.com/.../business-mappings/metrics \
-H 'Content-Type: application/json' \
-u '[auth_token]:' \
-d @- << EOF
{
"name": "Cost (Surcharge)",
"numberFormat": "number",
"defaultValueExpression": "METRIC['unblended_cost']",
"statements": [{
"matchExpression": "DIMENSION['vendor'] == 'Amazon'
|| DIMENSION['vendor'] == 'Azure' ",
"valueExpression": "METRIC['unblended_cost'] * 1.15"
}]
}

EOF

 

Update a Business Metric

curl -X PUT \
https://api.cloudability.com/.../business-mappings/1/metrics \
-H 'Content-Type: application/json' \
-u '[auth_token]:' \
-d @- << EOF
{
"name": "Cost (Surcharge)",
"numberFormat": "number",
"defaultValueExpression": "METRIC['unblended_cost']",
"statements": [{
"matchExpression": "DIMENSION['vendor'] == 'Amazon'
|| DIMENSION['vendor'] == 'Azure' ",
"valueExpression": "METRIC['unblended_cost'] * 1.25"
}]
}

EOF

 

Operators

Using the Business Mappings expression language, you'll have a vast array of operators to test the logic of your statements. Some examples of operator available for you to use include  "greater than" which can be very handy for testing against things like dates. Choose an operator which makes your statement as straightforward as possible. Using our API you'll have some additional options including regular expressions.

"name": "Cost (Surcharge)",
"numberFormat": "currency",
"defaultValueExpression": "METRIC['unblended_cost']",
"statements": [{
"matchExpression": "DIMENSION['date'] >= '2019-01-01T00:00'
&& DIMENSION['date'] <= '2019-01-31T23:59'",
"valueExpression": "METRIC['unblended_cost'] * 1.15"
},
...

 

Boolean Logic

Within an individual statement you can group expressions together using 'OR' operators and combine with 'AND' operators to get the exact logical outcome to match your business rules. Below is a very basic example:


"name": "Cost (in FTEs)",
"numberFormat": "number",
"defaultValueExpression": "METRIC['unblended_cost']",
"statements": [{
"matchExpression": "DIMENSION['date'] >= '2019-01-01T00:00:00'
&& DIMENSION['date'] <= '2019-01-31T23:59:59'
&& (DIMENSION['transaction_type'] == 'usage'
|| DIMENSION['transaction_type'] == 'recurring' )",
"valueExpression": "METRIC['unblended_cost'] / 115000"
},
...

 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.