Calculated fields, otherwise known as Derived Columns, allow you to compute properties in a Dataset or an Environment. The field’s value is based on the result of an expression that performs functions, mathematical, and/or logical operations on other fields’ values; similar to expressions defined in a spreadsheet.
These calculated fields are equivalent to other fields in your data. Use in query builder, boards, triggers, and Service Level Objectives (SLOs).
Use calculated fields to express:
Calculated fields exist in the schema of a Dataset or an Environment.
In Datasets, select a Dataset.
The Dataset Settings page displays several tabs.
Select the Schema tab.
Select Calculated Fields to expand.
The schema displays a button to create a new calculated field, a search box, and a list of any existing calculated fields.
In the left navigation bar under the Honeycomb logo, select the Environments banner. A menu appears with Manage Environments and a list of existing Environments.
Select Manage Environments. The next screen displays a list of Environments and details about each Environment.
In the row of the target Environment, select the target Environment’s name. The next screen displays the Environment Settings page with several tabs.
Select the Schema tab.
The schema displays a button to create a new calculated field, a search box, and a list of any existing calculated fields.
Any team owner or member can create a calculated field in the Honeycomb UI.
Create calculated fields by accessing the Dataset’s schema, the Environment’s schema, or through query builder.
In Query Builder, select the GROUP BY clause.
A list of suggested fields appears automatically when selected with a mouse/trackpad or by pressing the down arrow on the keyboard.
Select Create Calculated Field.
The “Create a Calculated Field” editor appears.
Any team owner or member can edit a calculated field in the Honeycomb UI.
Edit calculated fields by accessing the Dataset’s schema or the Environment’s schema.
Select Edit for the calculated field.
Changes to a calculated field may effect boards, triggers, or SLOs.
If a dependency exists, an “Edit Calculated Field” modal appears first and presents the choice to clone or continue with editing the calculated field. If you are unsure whether to clone or edit the column, reach out to the most recent editor of the calculated field.
Select Clone or Continue.
Clone creates an unsaved copy of the calculated field with a new name in the editor. Continue opens the existing calculated field in the editor.
Any team owner or member can clone a calculated field in the Honeycomb UI.
Clone calculated fields by accessing the Dataset’s schema or the Environment’s schema.
Select Clone next to the target calculated field. The calculated field editor appears.
An unsaved copy of the target calculated field populates in the editor.
Modify the calculated field name and formula as needed.
Select Continue to save.
The editor displays the following elements:
Only the calculated field’s creator or a Team Owner can delete a calculated field in the Honeycomb UI.
Delete calculated fields by accessing the Dataset’s schema or the Environment’s schema.
Select Delete for the calculated field.
Queries that use a calculated field continue to work, but the alias no longer appears in the query builder. Changes to a calculated field may effect boards, triggers, or SLOs. If any dependency exists, a “Delete Calculated Field” modal presents a list of its dependencies.
To continue deletion, remove any objects dependent on the calculated field.
Each object links directly to their respective editor. If you are unsure whether to remove the dependencies, reach out to the most recent editor of the dependent object.
Select Refresh Dependencies to reload the list after removing all dependencies.
A modal appears to confirm deletion of the calculated field.
Select Delete to confirm deletion of the calculated field.
A web server handles requests with varying sizes of content.
A query with GROUP BY content_length
returns a time series graph that displays the count for each value of content_length
.
The operations team wants to compare small requests to all other requests.
The team internally categorizes a small request as having a content_length
of less than or equal to 1000.
The team creates a calculated field named smallRequest
with the function LTE($content_length, 1000)
.
A query with GROUP BY smallRequest
returns a time series graph that displays the small requests alongside the other requests.
An Environment named Production contains three Datasets named PaymentService, CheckoutService, and SupportService. The datasets all define a calculated field with the same alias.
Dataset | Calculated Field Alias | Expression |
---|---|---|
PaymentService | total_amount_in_usd | COALESCE($usd_total, ADD(MUL($tax_rate, $item_total), $fees)) |
CheckoutService | total_amount_in_usd | MUL($cart_total, $tax_rate) |
SupportService | total_amount_in_usd | SUM(0) |
A query across the Production Environment returns data for the:
total_amount_in_usd
values calculated with its expression.total_amount_in_usd
values calculated with its expression.total_amount_in_usd
values calculated with its expression.The Production Environment cannot define a calculated field with the alias total_amount_in_usd
because the alias is already used by a calculated field in one or more datasets.