Skip to main content

Home

Configuring Billing Service

To configure the billing service, do the following:

  1. Stop Unravel

    <Unravel installation directory>/unravel/manager stop
    
  2. Set up a new plan.

    Navigate to the Unravel installation directory where you deployed the Unravel binaries. Use the manager config properties set command to configure the billing properties:

    <Unravel installation directory>/unravel/manager config properties set <Property> <Value>

    For example:

    <Unravel installation directory>/unravel/manager config properties set unravel.billing.startdate.plan 2024-01-20
    <Unravel installation directory>/unravel/manager config properties set unravel.billing.enddate.plan 2025-01-19
    <Unravel installation directory>/unravel/manager config properties set unravel.billing.startingcredit 287000
    <Unravel installation directory>/unravel/manager config properties set unravel.bill

    In the above example, the starting credit for the new plan is set to $287,000.

    Configuring the starting credit

    The starting credit is generally calculated based on the customer's contract, which specifies a flat pricing model rather than a tiered pricing model.

    Let us understand how the starting credit is calculated from the DBU. Let us assume that the customer has purchased 4.1 million DBUs at a list price of $0.22. Unravel has given them a discount of 68% and the extended unit price becomes $0.07 after applying the discount.

    In this example, we have:

    The starting credit here is calculated as follows:

    Number of DBUs x Extended unit price
    = 4,100,000 x $0.07
    = $287,000
    • Number of DBUs: 4.1 million

    • List price: $0.22 per DBU

    • Extended list price: $0.07 (68% discount)

  3. Create a pricing json 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:

      1. Navigate to <installation directory>/unravel/data/conf.

      2. Create a directory billing and enter the directory.

      3. Create a JSON file named dbu_price_usd.json in the billing 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.

      4. If `discount` is given then set both default price and discount value.

        { "light": { "cost": 0.22, "discount": 32}, "job compute": {     "cost": 0.22, "discount": 32}, "all purpose compute": { "cost": 0.22, "discount": 32 }
      5. If `discount` is not applicable then only set the default price value.

        For example: Based on the default price for each compute types configure the json as given below -

        { "light": 0.5, "job compute": 1.2, "all purpose compute": 0.75 }
      6. Replace the values in the JSON file as needed.

  4. Choose vendor billing data (Azure billing data)

    Option 1: If Azure billing data for the entire contract period is available:

    1. Set the following Unravel property:

      unravel.billing.vendor.cost.data.available=true
    2. Import Azure billing data from the month when the contract started till today in the billing table.

    Option 2: If no Azure billing data or only partial billing data is available in the selected timeframe:

    unravel.billing.vendor.cost.data.available=false
    • Set the following Unravel property:

  5. Apply the changes and restart services.

    If Unravel is still running, perform the following steps:

    Refresh properties

    <Unravel installation directory>/unravel/manager refresh properties

    Start Unravel Sensor Service

    <Unravel installation directory>/unravel/manager restart us

    If Unravel is already stopped, perform the following steps:

    Config apply

    <Unravel installation directory>/unravel/manager config apply
    

    Start Unravel Services

    <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:

  • pay_in_advance

  • pay_as_you_go

  • standard

unravel.billing.startdate.plan

Specify the start date of the plan in the yyyy-mm-dd format. For example, 2021-01-01. The start date must always be the first day of the month.

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 yyyy-mm-dd format. For example, 2021-01-31.

The end date should always be the last day of the month and the date after the start date.

Billing unit

unravel.billing.unit

Set this to any of the following:

  • For Databricks: dbu

  • For EMR: instance_hour

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.

Adjusted credit

unravel.billing.adjusted.credit

unravel.billing.adjusted.credit.date

This property specifies the amount of money in USD that is adjusted for the customer for the previous month.

This is applicable to both the plans. Pay-in-advance and Pay-as-you-go.

The credits are adjusted at the end of the day when it is added.

The date property is given for the current day when the adjusted credit property is added.

Purchased credit

unravel.billing.purchased.credit

unravel.billing.purchased.credit.date

This property specifies the amount in USD that is purchased by the customer in the month.

This is applicable to only Pay-in-advance plan.

The purchased credits are added at the end of the day when it is added.

The date property is given for the current day when the purchased credit property is added.

Threshold

unravel.billing.threshold

Set a threshold for UI alerts.

Email

The following properties must be configured to set up the SMTP to receive the billing reports:

  • mail.smtp.port

  • mail.smtp.auth

  • mail.smtp.starttls.enable

  • mail.smtp.user

  • mail.smtp.pw

  • mail.smtp.host

  • mail.smtp.localhost

  • mail.smtp.debug

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
Example 1. Example for configuring billing properties for Databricks:
<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