Skip to main content

Create widgets

Last updated on

Overview

Widgets are the building blocks of a dashboard. Each widget displays a piece of information — either data from a query or static text that you type in. You can mix both types on the same dashboard to create a clear, organized view.

This topic explains how to add widgets, configure their data, and customize how they look.

tip

You can also create widgets using the AI assistant instead of configuring them manually. Go to AI-assisted dashboards for details.

Widget categories

There are two categories of widgets:

  • Data widgets: Pull data from a data source and display it as a chart, table, number, or gauge. You configure what data to show by building a query.
  • Text widgets: Display static text that you type in. Use them for titles, descriptions, notes, or any other context you want to add to the dashboard.

Add a widget

  1. Open the dashboard and select Edit in the header to enter edit mode.

  2. Select New Widget. The widget editor opens.

    At the top of the editor, you see a row of icons representing the available widget types. The first group of icons represents data widgets (Table, Metric, Donut, Single Value, Bar, Column, Line, Area, Scatter). The last icon represents the text widget.

  3. Select a widget type. The editor updates to show the configuration options for that type.

  4. Give the widget a name by editing the New Widget title at the top. You can also add a subtitle.

  5. Configure the widget using the Data and Customizations tabs on the right side of the editor.

  6. Select Add Widget to place the widget on your dashboard.

The widget appears on the dashboard grid. You can drag it to reposition it or resize it by dragging the bottom-right corner.

Widget actions

In edit mode, each widget shows action icons when you hover over it:

  • Edit (pencil icon) — Open the widget editor to change the query, type, or display settings. Available on data widgets only.
  • Clone — Create an exact copy of the widget with the same configuration.
  • Delete — Remove the widget from the dashboard.

Text widgets support Clone and Delete only. To change the text, select the text widget directly in edit mode.

Data tab

When you select a data widget, the right side of the editor shows two tabs: Data and Customizations. The Data tab is where you define what data the widget displays.

Query

The Query section lets you build a query to retrieve data. You can use the visual builder (default) or switch to the code editor.

Datasource

Start by selecting a Datasource from the dropdown. A datasource determines which data the widget can access. Some of the available datasources include:

DatasourceDescription
CCM Cloud Costs DailyDaily cost data across AWS, Azure, and GCP cloud providers.
CD Pipeline Execution SummaryCD pipeline runs including status, duration, trigger type, branch, environment, and MTTR.
CI Pipeline Execution SummaryCI build runs including status, duration, trigger type, branch, and license tier.
Universal Pipeline ExecutionsCross-module pipeline executions including status, duration, trigger, and policy violations.
Licensing Billing Raw Events15-minute billing event data with usage metrics at the org and account level.
STO Security ScansSecurity scan results including vulnerabilities, severity, scan tool, and target.
Artifact RegistryArtifact registry metadata including artifacts, versions, and registry information.
OrganizationsOrganization-level metadata across all modules.
ProjectsProject-level metadata across all modules.

The list of available datasources depends on the modules enabled in your Harness account.

Select

After choosing a datasource, use the Select section to pick the columns (data points) you want to display. For each selected column, you can optionally choose an Aggregation (such as count, sum, average, min, or max) and an Alias to rename the column in the results.

Select + Select to add more columns. You can add as many columns as you need, and they are combined when the widget is built.

Dashboard filters

The Dashboard Filters section shows any filters that are applied at the dashboard level. These filters pass variables to the widget query. For example, a Time Range filter with the field window_start_time and range Last 1 Month applies automatically to the widget.

Filter

Select + Filter to add conditions that narrow down the results. For each filter, you select a field, a condition, and a value. The available conditions include:

  • Equals
  • Not equals
  • Contains
  • Not contains
  • Greater than
  • Less than
  • Is null
  • Is not null

You can add multiple filters and they are combined together.

Sort

Select + Sort to order the results by a specific column. Choose the column, an optional aggregation, and the sort direction (Ascending or Descending).

Time field and variables

  • Time field: Select the timestamp field used to filter data by time range (for example, window_start_time or start_time).
  • Variables: Define query variables that make the widget dynamic. Variables can be referenced using ${variableName} in the query.

Code view

Next to the Query heading, there is a Code View toggle. Turn it on to switch from the visual builder to a code editor where you can write queries directly using Harness Query Language (HQL).

In code view, you can:

  • Write HQL queries with full syntax support.
  • Run the query to test the results.
  • Use the Format button to clean up indentation.

Go to Harness Query Language (HQL) for the complete syntax reference.

info

You can switch between the visual builder and code view at any time. If you write a query in code view that uses features the visual builder does not support (such as JOINs or OR conditions), the builder displays a message indicating the query cannot be represented visually.

Filters

You can filter the data shown in your widgets at two levels: at the dashboard level (applies to all widgets) and at the widget level (applies to a single widget's query).

Dashboard-level filters

When you open a dashboard in edit mode, a filter bar appears below the dashboard header. This bar lets you apply filters that affect all widgets on the dashboard at once.

The filter bar includes the following controls:

  • Variables (curly braces icon) — View and manage query variables that are passed to all widgets.
  • Time range (clock icon with a dropdown, for example 30d) — Set a time range that applies to every widget. Widgets that reference a time field automatically use this range.
  • + Add Filter — Add a field-based filter that narrows down results across all widgets. You can filter by any field available in the datasource, using conditions such as equals, not equals, contains, and more.

Dashboard-level filters are useful when you want viewers to be able to change the time range or filter the entire dashboard without editing individual widgets.

Widget-level filters

Inside the widget editor, the Data tab includes a + Filter option within the query section. These filters apply only to the specific widget you are editing.

For each filter, you select a field, a condition, and a value. The available conditions include:

  • Equals
  • Not equals
  • Contains
  • Not contains
  • Greater than
  • Less than
  • Is null
  • Is not null

You can add multiple filters to a single widget. All filters are combined together when the query runs.

tip

Use dashboard-level filters for settings that viewers should be able to change (such as time range or environment). Use widget-level filters for conditions that should always apply to a specific widget regardless of the dashboard filters.

Customizations tab

The Customizations tab controls how the widget looks. The available settings depend on the widget type you selected.

Table

SettingDescription
PaginationSplit large result sets into pages.
Column FormattingControl how individual columns display values (timestamp format, number format).

Metric (Single Value)

SettingDescription
UnitA text label shown after the number (for example, "req/s", "%").
Value TypeHow the number is formatted: Auto, Integer, Percentage, Duration, File Size, or Raw.
Decimal PlacesNumber of digits shown after the decimal point.

Donut

SettingDescription
CategoriesThe column that provides segment names.
ValueThe column that provides the value for each segment.
Color ColumnAn optional column that determines segment colors. Select "None (use color palette)" to use the default colors.
Show Center TotalDisplay the total of all segments in the center of the donut.
Center TitleA label shown above the center total (for example, "Total").
Center Value FormatHow the center number is formatted (for example, "Auto (Number)").
Donut AlignmentHorizontal position of the chart: Left, Center, or Right.
Legend PositionWhere the legend appears: Bottom, Right, Top, Left, Auto, or Hidden.
Show Tooltip on HoverShow the value and percentage when you hover over a segment.

Gauge

SettingDescription
Value MappingThe column that provides the gauge value.
Max ValueThe highest point on the gauge scale (defaults to 100).
ThresholdsColor-coded ranges with a start value, end value, color, and label (for example, 0–70 Green "Normal", 70–90 Yellow "Warning", 90–100 Red "Critical").
Default LabelLabel shown when the value falls outside defined thresholds.
Default ColorColor shown when the value falls outside defined thresholds.

Bar and Column

SettingDescription
Series MappingWhich columns map to the X-axis and Y-axis.
Legend PositionWhere the legend appears.
Show X-axis / Show Y-axisToggle the visibility of each axis.
StackingStack multiple data series on top of each other instead of overlapping.

Line and Area

SettingDescription
Series MappingWhich columns map to the X-axis and Y-axis.
Legend PositionWhere the legend appears.
Show X-axis / Show Y-axisToggle the visibility of each axis.
Line StyleSolid or dashed lines.

Scatter

SettingDescription
Series MappingWhich columns map to the X-axis and Y-axis.
Legend PositionWhere the legend appears.
Show X-axis / Show Y-axisToggle the visibility of each axis.

HQL reference

For details on writing queries in code view, including the full list of operators, functions, and syntax, go to Harness Query Language (HQL).

Common operators

OperatorDescriptionExample
=Equalsservice = "api"
!=Does not equalstatus != "success"
>, >=Greater than (or equal to)duration > 100
<, <=Less than (or equal to)duration <= 500
inMatches any value in a listservice in ("api", "web")
containsContains the specified textname contains "pay"
!containsDoes not contain the specified textname !contains "test"
is nullHas no valueerror is null
is not nullHas a valueerror is not null

Common functions

FunctionDescription
count()Total number of records.
sum(field)Total of all values in a field.
avg(field)Average of all values.
min(field)Smallest value.
max(field)Largest value.
distinct_count(field)Number of unique values.
median(field)Middle value (50th percentile).
p95(field)95th percentile.
p99(field)99th percentile.

Value formatting

Metric value types

TypeDescriptionExample inputExample output
AutoDetects the format and scales large numbers.12341.23K
IntegerWhole number with automatic scaling.12341K
DecimalFixed decimal places with comma separators.1234.56781,234.57
PercentageNumber followed by a percent sign.99.599.5%
DurationConverts milliseconds to readable time.36610001h 1m 1s
File SizeConverts bytes to readable file size.10485761 MB
DateConverts epoch milliseconds to a formatted date.1704067200000Jan 1, 2024
RawExact number with no formatting.1234.56781234.5678

Column formatting for tables

FormatDescription
LocaleBrowser's local date and time format.
UTCCoordinated Universal Time.
ISOISO 8601 format (for example, 2024-01-15T14:30:00Z).
RawRaw numeric value without conversion.

Troubleshooting

Widget shows "No Data"

  • Test the query: Open the widget in edit mode and run the query in code view to check for results.
  • Check field names: Make sure the selected columns exist in the chosen datasource.
  • Review filters: Check both dashboard-level and widget-level filters. Try removing filters one at a time to identify the issue.
  • Check the time range: Make sure the time range covers a period that has data.

Query errors

  • Read the error message: The editor highlights the problem and shows a description.
  • Check field names: Field names are case-sensitive.
  • Match select and group_by: If you use an aggregation function in your select, every non-aggregated field must also appear in the group by section.
  • Check variables: Make sure each ${variableName} is defined and has a value.

Next steps