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

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

      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.

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

    • For EMR

      For EMR, you must add AWS account details on the Billing page. For information, see Add AWS account details in Unravel for EMR chargeback data and cluster insights.

      After adding AWS account details, create a pricing file to specify the pre-negotiated price for each instance 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 emr_instance_type_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/emr_instance_type_price_usd.json

        Following is a sample JSON file, where the numeric values are the price (in USD) for the corresponding workload types.

        {
        "c1.medium": 0.22,
        ...
        "z1d.xlarge": 0.22
        }
      4. Replace the values in the JSON file as needed.

  4. 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
    
  5. 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:

  • pay_in_advance

  • pay_as_you_go

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.

Note

The start and end dates are applicable only for the pay_in_advance pricing plan. If you specify the pay_as_you_go pricing plan, the start and end dates are not applicable. See Example 2: “Example for configuring billing properties for EMR:.

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.

Threshold

unravel.billing.threshold

Set a threshold for UI alerts.

Email

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:

  • 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


Example 2. Example for configuring billing properties for EMR:
<Unravel installation directory>/unravel/manager config properties set unravel.billing.enabled true
<Unravel installation directory>/unravel/manager config properties set unravel.billing.pricingplan pay_as_you_go
<Unravel installation directory>/unravel/manager config properties set unravel.billing.unit instance_hour
<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