Configuring Billing Service
To configure the billing service, do the following:
Stop Unravel
<Unravel installation directory>/unravel/manager stop
From the Unravel installation directory, where you deployed the Unravel binaries, set the Billing properties with the manager config properties set command as follows:
<Unravel installation directory>/unravel/manager config properties set
<Property>
<Value>
For example:
<Unravel installation directory>
/unravel/manager config properties set unravel.billing.enabled true<Unravel installation directory>
/unravel/manager config properties set unravel.billing.pricingplan pay_in_advance
Refer to Billing properties for the complete list of properties that can be set for the Billing service. Ensure all required billing properties for your plan are specified before you start Unravel. Billing records are immutable once they are created in the database. They are not overwritten automatically in case of errors.
Create a pricing file.
For Databricks
If DBU is used as the billing unit to track Databricks usage, then you must create a pricing file to specify the pre-negotiated price for each workload type as follows:
Navigate to
<installation directory>/unravel/data/conf
.Create a directory
billing
and enter the directory.Create a JSON file named
dbu_price_usd.json
in thebilling
directory. The location of the JSON file will be<Unravel data directory>/conf/billing
/, for example,/opt/unravel/data/conf/billing/dbu_price_usd.json
Following is a sample JSON file, where the numeric values are the price (in USD) for the corresponding workload types.
{ "light": 0.5, "job compute": 1.2, "all purpose compute": 0.75 }
Replace the values in the JSON file as needed.
Apply the changes. If you have not stopped the Unravel services, you will be prompted to do so. Run manager stop to stop Unravel services.
<Unravel installation directory>/unravel/manager config apply
Start Unravel
<Unravel installation directory>/unravel/manager start
Setting | Property | Description |
---|---|---|
Billing Report | unravel.billing.enabled | Set this to true to enable the billing service. The default value is false. |
Plan | unravel.billing.pricingplan | Set this to any of the following plans:
|
unravel.billing.startdate.plan | Specify the start date of the plan in the When you add more credit, you must specify a new start date using this property. The new credit takes effect on the new start date. The earliest start date is the month after the current month. | |
unravel.billing.enddate.plan | Specify the end date of the plan in the The end date should always be the last day of the month and the date after the start date. | |
NoteThe start and end dates are applicable only for the | ||
Billing unit | unravel.billing.unit | Set this to any of the following:
For dbu, the cost of a cluster is attributed to the day when the cluster terminates. When dbu is selected, users need to create a pricing config file (see Create a pricing file that specifies different prices for different workload types). |
Pricing | unravel.billing.defaultprice | When unravel.billing.unit is dbu, this property (unravel.billing.defaultprice) specifies the default price in USD for any workload type not listed in the pricing config file. When unravel.billing.unit is instance_hour, this property specifies the price in USD for all instance types. When this property is not specified, the internal default value is 0.22 ($0.22). You must specify the value with at least one integer and one or two fractional digits. For example, 0.22 or 1.0. |
Starting credit | unravel.billing.startingcredit | This property specifies the amount of money in USD that the customer pays in advance. Only applicable when the plan is pay_in_advance, so unravel.billing.pricingplan property is set to pay_in_advance. For pay_as_you_go, this property is not relevant, and its value is internally set to zero. The credits are deducted at the end of each day by the amount that corresponds to the usage (measured in unravel.billing.unit) multiplied by the price per unit. In the case of DBU, there can be a different price for each workload type, as specified in the pricing config file. You must specify the value with at least one integer and one or two fractional digits. For example, 0.22 or 1.0. |
Threshold | unravel.billing.threshold | Set a threshold for UI alerts. |
To set these properties for email alerts, refer to Configuring properties. | The following properties must be configured to set up the SMTP to receive the billing reports:
| A sample of the Unravel SMTP setup is shown here: # Sample Unravel SMTP setup: mail.smtp.port=587 mail.smtp.auth=true mail.smtp.starttls.enable=true mail.smtp.user=daemon@unraveldata.com mail.smtp.pw=<password> mail.smtp.host smtp.gmail.com mail.smtp.from=daemon@unraveldata.com mail.smtp.localhost=unraveldata.com mail.smtp.debug=true |
com.unraveldata.ualert.recipient | Unravel email id to send Billing report to. The default is ualert@unraveldata.com. For example: <Unravel installation directory>/unravel/manager config properties set com.unraveldata.ualert.recipient ualert@unraveldata.com | |
com.unraveldata.login.admins | All the admin users will receive the Billing report. However, to set any user as admin, you can specify the users in a comma-delimited list. For example: <Unravel installation directory>/unravel/manager config properties set com.unraveldata.login.admins admin,user1,user2 | |
com.unraveldata.report.user.email.domain | Specify the domain name for users who will receive the billing report. For example: <Unravel installation directory>/unravel/manager config properties set com.unraveldata.report.user.email.domain unraveldata.com |
<Unravel installation directory>/unravel/manager config properties set unravel.billing.enabled true <Unravel installation directory>/unravel/manager config properties set unravel.billing.pricingplan pay_in_advance <Unravel installation directory>/unravel/manager config properties set unravel.billing.startdate.plan 2021-01-01 <Unravel installation directory>/unravel/manager config properties set unravel.billing.enddate.plan 2021-12-31 <Unravel installation directory>/unravel/manager config properties set unravel.billing.unit dbu <Unravel installation directory>/unravel/manager config properties set unravel.billing.defaultprice 0.2 <Unravel installation directory>/unravel/manager config properties set unravel.billing.startingcredit 800.0