Custom Labels
Learn how Custom Labels in Ternary allow organizations to create business-relevant labels from cloud billing data using rules, templates, data mapping, and advanced matching logic.
Custom Labels in Ternary allow organizations to create new business relevant labels on top of existing cloud cost data. These labels are built using existing metadata such as cloud provider tags, resource labels, project identifiers, account identifiers, or other available attributes. This makes it possible to analyze billing data in a way that reflects how the business is structured and operated.
In practice, Custom Labels help teams:
- Define clear relationships between business units and cloud costs, such as mapping projects or accounts to cost centers or internal teamS
- Connect cloud resources to business operations by assigning labels for environments, departments, applications, or other internal categories
Once applied, Custom Labels allow cloud spend to be viewed and filtered using business aligned dimensions that may not exist in the original billing export. This adds meaningful context to reports and dashboards and improves transparency and accountability across finance and engineering teams.
What’s new with Ternary Custom Labels?
The latest version of Custom Labels introduces several enhancements that expand flexibility and improve usability:
- Ability to create entirely new label dimensions from any existing label, including outputs from previously created custom labels.
- Multiple creation methods, including pre-built templates for common use cases, bulk CSV uploads, and full manual configuration.
- Expanded matching capabilities such as wildcard pattern matching and regular expression support, now fully available in the user interface.
- Support for combining multiple conditions within a single rule and assigning multiple output labels in the same rule, simplifying complex mappings.
- Improved performance, with new labels typically becoming available in under an hour and often within minutes for smaller datasets.
- Updated user interface with draft and publish functionality, enabling both technical and non technical users to create, review, and manage custom label rules more efficiently.
Key Concepts of Ternary Custom Labels
Before creating custom labels, it is important to understand the core components of a Custom Label rule and how they work together.
Rule Title
Each custom label rule includes a descriptive Rule Title. This is not the label key itself, but a name used to identify the purpose of the rule, such as “Map Projects to Cost Centers.” Clear naming becomes important as the number of rules grows over time.
Conditions
Conditions define which cost line items the rule applies to. Each condition evaluates an existing key from billing data using a selected operator and value or pattern. All conditions within a rule must evaluate according to the selected logical structure for the rule to apply. Multiple conditions can be combined to target a specific subset of data, such as Account equals X and Region equals Y.
- Existing Label Key: It is the source field evaluated by the rule. Ternary automatically ingests keys from cloud billing data, including project tags, resource labels, project IDs, and account IDs. An existing Custom Label key can also be selected. This allows chaining, where the output of one custom label becomes the input for another. Key names must match exactly as they appear in the data.
- Operator: The operator defines how the key’s value is evaluated. Supported operators include:
- equals: Matches an exact string value
- pattern match: Supports wildcard matching using the asterisk character to represent any sequence of
- characters. For example, env* would match env, env-prod, or environment.
- regex matches: Uses a full regular expression pattern for advanced matching
- is set: Checks whether the key exists and contains a value Operators can also be configured to negate a condition where required.
- Value or Pattern: This specifies what the key is compared against or a pattern if using wildcard/regex. For equals, one or multiple values can be selected. For pattern or regex matches, a valid pattern must be provided. For is set, no value is required.
Outputs
Outputs define which new labels are assigned to cost items that meet the rule’s conditions. A single rule can assign multiple custom labels simultaneously. Two output modes are supported:
- Direct Assignment: Define a new custom label key and value that will be applied to all matching items. Multiple direct assignments can be added within the same rule.
- Conditional Mapping: Assign output values based on the value of an existing field. In this mode, an existing key is selected and its values are mapped to corresponding new output values.
Draft and Published States
Custom Label rules can be saved as a draft before being made active. Saving as Draft allows the rule logic to be reviewed and refined without affecting billing data. Publishing activates the rule and applies it to eligible cost line items.
Processing and Propagation
After a rule is published, Ternary processes it against billing data. This processing typically completes within a few hours, though timing may vary depending on data volume. Once processing is complete, the newly created labels become available across the platform, including reports, dashboards, and filters.
Methods for Creating Custom Labels in Ternary
Ternary provides three ways to create Custom Labels depending on the level of control and scale required.
1. Using Pre Built Templates
Templates provide a guided setup for common labeling scenarios and reduce the need to configure rules from scratch. To use a template:
- Navigate to Custom Labels and select New Custom Label.
- Choose a relevant template such as Normalize Environment Labels.
- Fill in or adjust the predefined placeholders based on your requirements.
- Review the rule configuration and publish when ready.
Templates are useful for standard use cases where consistent logic is required across environments.
2. Data Mapping
Data Mapping allows bulk creation of labels using a structured CSV file or a BigQuery table. To use Data Mapping:
- Prepare a CSV file or BigQuery table containing the required mapping structure. An example template is available within the Data Mapping interface.
- Select either the CSV or BigQuery option in the Custom Labels workflow.
- Upload the file or reference the table and validate the data. A preview will be displayed before publishing. If errors are detected, the system will provide guidance on what must be corrected.
- Submit the configuration and allow the system to process the labels.
This method is best suited for large scale mappings such as project to business unit or account to cost center relationships.
3. Manual Rule Creation
Manual setup provides full control over rule logic. To create a rule from scratch:
- Select New Custom Label and start with a blank rule.
- Enter a clear and descriptive Rule Title.
- Add one or more Conditions using the appropriate keys, operators, and values.
- Define Outputs using direct assignment or conditional mapping.
- Review the rule summary to confirm accuracy.
- Save as Draft or Publish the rule.
Manual configuration is recommended when complex logic or precise targeting is required.
Using Custom Labels in Reports and Dashboards
Once published and processed, Custom Labels become available throughout the platform. They appear in grouping selectors within reports, dashboards, and other analysis views.
Custom Labels can be located by searching for the label name directly or by selecting the quick filter pill labeled Ternary, which displays all Custom Labels created within the tenant. This allows teams to immediately group, filter, and analyze cost data using newly defined business dimensions.
Managing and Editing Custom Labels
All Custom Label rules are managed from the Custom Labels admin page.
- Viewing rules: All existing rules are listed in the management table for visibility and tracking.
- Editing a rule: Select Edit to update conditions or outputs, then republish to apply changes.
- Deleting a rule: Removing a rule deletes the associated label from the platform.
- Execution order and chained labels: When a Custom Label uses the output of another Custom Label as an input, it becomes a chained label. Execution order is important in this scenario. Chained labels are automatically identified and grouped at the top of the Custom Labels management page. The order can be adjusted using drag and drop controls to ensure rules are processed in the correct sequence.
Updated 1 day ago