Table of Contents

BTP Cost and Spend

This monitor reports what a SAP BTP global account is charged, for every subaccount, service,
plan and measure.
It reads the monthlySubaccountsCost API of the SAP Usage Data Management service and reports
the total cost together with the two sources it is made of, pay as you go and cloud credits.
It raises alarms when a cost crosses a budget, when it rises sharply from one month to the next,
and when something that was being charged stops appearing.

Note: this API only serves global accounts on the CPEA or BTPEA consumption based commercial model. A subscription based account receives an empty result, not an error. Confirm the commercial model of the client before deploying this monitor. See Commercial model.

Prerequisites

Note: this is the same connector as BTP Global Usage and BTP Subaccount Usage. If one of those monitors is already set up for the global account, nothing else needs to be provisioned. See the BTP Global Usage page for the connector configuration.

Note: it is not the connector of BTP Directory Usage. A directory service key answers 403 on this API.

Commercial model

Note: an empty result is reported as information and the run finishes successfully. It is not an error, because for a subscription client it is the correct and permanent answer.

Note: this is the trap to avoid. Deployed against a subscription client the monitor reports no cost for ever, which looks like “nothing is being spent” rather than “this monitor cannot work here”. If no cost is ever reported, check the commercial model of the global account before looking for a fault.

Configuration hints

Months back

Note: the current month is never compared. It is still filling, and SAP restates its figures until the month is billed.

Estimated figures

Note: once a month is billed, its rows switch to estimated false. In a monitoring tool this starts a new series for that month, because the tag is part of the series identity. This is intended: a billed figure and a provisional one are not the same measurement.

Surveillance table

Parameter Description
Active Use this field to activate or deactivate a line of configuration.
Subaccount A filter to match only a given subaccount, by its display name.
Service A filter to match only a given service, by its display name, for example Destination.
Plan A filter to match only a given service plan, by its display name, for example Lite.
Measure A filter to match only a given measure, for example api_calls or memory_per_hour.
Cost A graded threshold on the cost of the most recent month, in the currency the API reports. Leave a grade at 0 to disable it.
Increase % A graded threshold on the increase, in percent, between the last two months that have ended. Leave a grade at 0 to disable it.
No data after (months) Raises a warning when something that was being charged has reported no cost for longer than this many months. 0 disables it. Default 1.
Auto clear If checked, the alarm is cleared automatically once the condition is gone.
enable Alarm If checked, this line of surveillance will be used for alarm generation.
enable QOS If checked, this line of surveillance will be used for metric generation.

Note: the cost threshold is a budget in the account's currency, not a percentage. Set it per service rather than on a line matching everything, otherwise the largest service decides when the alarm fires.

Note: no increase is computed when the previous month cost nothing, since a percentage of zero has no meaning. A service charged for the first time therefore raises no increase alarm, only a cost alarm if it passes its budget.

Note: when several lines match the same subaccount, service, plan and measure, one alarm is raised, at the highest severity any of those lines asks for.

Note: the monitor remembers the last month each subaccount and service was charged, so the no data warning is still raised once something has disappeared from the collected range. A series silent for 12 months is forgotten and its alarm clears. An empty result never raises these warnings.

Alarm content

Examples

Example 1

Active Subaccount Service Plan Measure Cost Increase % No data after Auto clear enable Alarm enable QOS
true * * * * G2W:0 W2M:0 G2W:0 W2M:0 0 true false true

Effect: Publishes the cost of every subaccount, service, plan and measure as metrics, and raises no alarm. This is the line to start with, so the normal spend of an account can be observed before choosing any budget.

Example 2

Active Subaccount Service Plan Measure Cost Increase % No data after Auto clear enable Alarm enable QOS
true PROD * * * G2W:500 W2M:1000 G2W:0 W2M:0 0 true true true

Effect: Sends a WARNING when any single service of the production subaccount passes 500 in the account's currency this month, and a MAJOR past 1000.

Example 3

Active Subaccount Service Plan Measure Cost Increase % No data after Auto clear enable Alarm enable QOS
true * * * * G2W:0 W2M:0 G2W:50 W2M:200 2 true true true

Effect: Watches for cost that runs away rather than for a fixed budget. Sends a WARNING when a service costs half as much again as the previous month, a MAJOR when it triples, and a WARNING when a service that was being charged stops appearing for more than two months.

Generated metrics

metricId metricUnit metricTarget metricDescription
BTP_COST_AND_SPEND the currency reported by SAP [GLOBAL_ACCOUNT][SUBACCOUNT][SERVICE][PLAN][METRIC_NAME][CURRENCY][ESTIMATED][PERIOD] Sends the cost charged for one subaccount, service, plan and measure.

Note: three metrics are sent for each one, as promonitor.btp.cost.<measure>, promonitor.btp.cost_payg.<measure> and promonitor.btp.cost_credits.<measure>. The first is the total, the other two are the parts paid from pay as you go and from cloud credits.

Note: the total is the sum of the two others. They are three separate metrics rather than one metric with a source target precisely so that a dashboard cannot add them together and count the same spend twice.

Note: the value is a cumulative month to date figure and must be read as a gauge, like the usage metrics. A dashboard that aggregates the series as a sum multiplies it by the number of runs in the month.